diff --git a/home/linux.nix b/home/linux.nix index ab0b7ac..18f762b 100644 --- a/home/linux.nix +++ b/home/linux.nix @@ -28,6 +28,7 @@ libnotify bluez bluetui + swww ]; imports = [ @@ -38,7 +39,9 @@ ../modules/nvim ../modules/wezterm ../modules/fish + ../modules/firefox ../modules/wm/swaync + ../modules/wm/awww ../modules/wm/niri ]; diff --git a/hosts/dnsc-machine/default.nix b/hosts/dnsc-machine/default.nix index 93b7698..2ed3d57 100644 --- a/hosts/dnsc-machine/default.nix +++ b/hosts/dnsc-machine/default.nix @@ -92,7 +92,7 @@ programs.niri.enable = true; security.polkit.enable = true; services.gnome.gnome-keyring.enable = true; - security.pam.services.swaylock = {}; + security.pam.services.hyprlock = {}; # Nix settings nix.gc = { @@ -126,10 +126,10 @@ neovim btop wezterm + ghostty fish - firefox # TODO use zen browser instead - pavucontrol - swaybg + pcmanfm + pwvucontrol ]; # Some programs need SUID wrappers, can be configured further or are @@ -184,22 +184,6 @@ # Tailscale services.tailscale.enable = true; - # Custom systemd services - systemd.user.services.wallpaper = { - enable = true; - description = "Sets the wallpaper with swaybg"; - wantedBy = [ "niri.service" ]; - unitConfig = { - PartOf = "graphical-session.target"; - After = "graphical-session.target"; - Requisite = "graphical-session.target"; - }; - serviceConfig = { - ExecStart = "${pkgs.swaybg}/bin/swaybg -o * -i %h/Pictures/Wallpapers/coom.jpg -m fill"; - Restart = "on-failure"; - }; - }; - # Environment & session variables environment.variables.EDITOR = "nvim"; environment.sessionVariables.NIXOS_OZONE_WL = "1"; @@ -211,5 +195,4 @@ # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "25.05"; # Did you read the comment? - } diff --git a/modules/firefox/default.nix b/modules/firefox/default.nix new file mode 100644 index 0000000..ec7a80f --- /dev/null +++ b/modules/firefox/default.nix @@ -0,0 +1,86 @@ +{ config, pkgs, ... }: + +{ + programs.firefox = { + enable = true; + languagePacks = [ "en-US" "de" ]; + policies = { + DisableTelemetry = true; + DisableFirefoxStudies = true; + DisablePocket = true; + DisableFirefoxScreenshots = true; + DisplayBookmarksToolbar = "never"; + DisplayMenuBar = "default-off"; + SearchBar = "unified"; + OverrideFirstRunPage = ""; + OverridePostUpdatePage = ""; + EnableTrackingProtection = { + Value= true; + Locked = true; + Cryptomining = true; + Fingerprinting = true; + }; + DefaultDownloadDirectory = "\${home}/Downloads"; + ExtensionSettings = { + "{446900e4-71c2-419f-a6a7-df9c091e268b}" = { + default_area = "menupanel"; + install_url = "https://addons.mozilla.org/firefox/downloads/latest/%7B446900e4-71c2-419f-a6a7-df9c091e268b%7D/latest.xpi"; + installation_mode = "force_installed"; + private_browsing = true; + }; + "uBlock0@raymondhill.net" = { + default_area = "menupanel"; + install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; + installation_mode = "force_installed"; + private_browsing = true; + }; + "sponsorBlocker@ajay.app" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/sponsorBlocker@ajay.app/latest.xpi"; + installation_mode = "force_installed"; + private_browsing = true; + }; + }; + }; + profiles = { + "dennis" = { + id = 0; + isDefault = true; + search.force = true; + search.engines = { + "Nix Packages" = { + urls = [{ + template = "https://search.nixos.org/packages"; + params = [ + { name = "query"; value = "{searchTerms}"; } + ]; + }]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@np" ]; + }; + "Nix Options" = { + definedAliases = [ "@no" ]; + urls = [{ + template = "https://search.nixos.org/options"; + params = [ + { name = "query"; value = "{searchTerms}"; } + ]; + }]; + }; + bing.metaData.hidden = true; + perplexity.metaData.hidden = true; + wikipedia.metaData.hidden = true; + ddg.metaData.hidden = true; + }; + settings = { + "browser.startup.homepage" = "https://home.dnsc.io"; + "browser.newtabpage.pinned" = [{ + title = "[dnsc] Home"; + url = "https://home.dnsc.io"; + }]; + "browser.search.region" = "DE"; + "general.useragent.locale" = "en-US"; + }; + }; + }; + }; +} diff --git a/modules/wezterm/config/overrides.lua b/modules/wezterm/config/overrides.lua index b98fecf..4b4d217 100644 --- a/modules/wezterm/config/overrides.lua +++ b/modules/wezterm/config/overrides.lua @@ -16,6 +16,7 @@ function M.apply_to_config(config) config.window_decorations = "NONE" config.window_padding = helpers.get_padding(18, 6) config.window_background_opacity = 0.95 + -- config.enable_wayland = false; end end diff --git a/modules/wm/awww/default.nix b/modules/wm/awww/default.nix new file mode 100644 index 0000000..135022e --- /dev/null +++ b/modules/wm/awww/default.nix @@ -0,0 +1,7 @@ +{ config, ... }: + +{ + xdg.configFile."awww/bin" = { + source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/dev/nix-config/modules/wm/awww/scripts"; + }; +} diff --git a/modules/wm/awww/scripts/random-bg.sh b/modules/wm/awww/scripts/random-bg.sh new file mode 100755 index 0000000..a77db71 --- /dev/null +++ b/modules/wm/awww/scripts/random-bg.sh @@ -0,0 +1,28 @@ +#!/bin/sh +# Changes the wallpaper to a randomly chosen image in a given directory +# at a set interval. + +DEFAULT_INTERVAL=300 # In seconds + +if [ $# -lt 1 ] || [ ! -d "$1" ]; then + printf "Usage:\n\t\e[1m%s\e[0m \e[4mDIRECTORY\e[0m [\e[4mINTERVAL\e[0m]\n" "$0" + printf "\tChanges the wallpaper to a randomly chosen image in DIRECTORY every\n\tINTERVAL seconds (or every %d seconds if unspecified)." "$DEFAULT_INTERVAL" + exit 1 +fi + +# See awww-img(1) +RESIZE_TYPE="fit" +export AWWW_TRANSITION_FPS="${AWWW_TRANSITION_FPS:-60}" +export AWWW_TRANSITION_STEP="${AWWW_TRANSITION_STEP:-2}" + +while true; do + find "$1" -type f \ + | while read -r img; do + echo "$(