diff --git a/modules/hardware/zfs.nix b/modules/hardware/zfs.nix index d5aad72..359e9f2 100644 --- a/modules/hardware/zfs.nix +++ b/modules/hardware/zfs.nix @@ -38,4 +38,6 @@ interval = "weekly"; }; }; + # TODO remove once this is upstreamed + boot.initrd.systemd.services."zfs-import-rpool".after = ["cryptsetup.target"]; } diff --git a/users/common/graphical/Xorg/default.nix b/users/common/graphical/Xorg/default.nix index fc16c8a..5219fd6 100644 --- a/users/common/graphical/Xorg/default.nix +++ b/users/common/graphical/Xorg/default.nix @@ -5,5 +5,6 @@ ./polybar.nix ./autorandr.nix ./i3.nix + ./wallpapers.nix ]; } diff --git a/users/common/graphical/Xorg/i3.nix b/users/common/graphical/Xorg/i3.nix index 89708f0..2af1791 100644 --- a/users/common/graphical/Xorg/i3.nix +++ b/users/common/graphical/Xorg/i3.nix @@ -1,6 +1,21 @@ { + config, + lib, + ... +}: { xsession.windowManager.i3 = { enable = true; - config = import ../sway3.nix; + config = + lib.attrsets.recursiveUpdate + (import ../sway3.nix) + { + menu = "rofi -show drun"; + keybindings = let + cfg = config.xsession.windowManager.i3.config; + in { + "Menu" = "exec ${cfg.menu}"; + "${cfg.modifier}+c" = "exec ${cfg.menu}"; + }; + }; }; } diff --git a/users/common/graphical/Xorg/wallpapers.nix b/users/common/graphical/Xorg/wallpapers.nix new file mode 100644 index 0000000..90a54fb --- /dev/null +++ b/users/common/graphical/Xorg/wallpapers.nix @@ -0,0 +1,42 @@ +{ + config, + pkgs, + ... +}: let + wallpaper-folder = "${config.home.homeDirectory}/.local/share/wallpapers"; + exe = + pkgs.writeShellScript "set-wallpaper" + '' + for D in /tmp/.X11-unix/*; do + file=$(${pkgs.coreutils}/bin/basename $D) + DISPLAY=":''${file:1}" ${pkgs.feh}/bin/feh --bg-fill --randomize --recursive ${wallpaper-folder}/ + done + ''; +in { + systemd.user = { + timers = { + set-wallpaper = { + Unit = { + Description = "Set a random wallpaper every 3 minutes"; + }; + Timer = { + OnActiveSec = "0 sec"; + OnUnitActiveSec = "3 min"; + }; + Install.WantedBy = ["timers.target"]; + }; + }; + services = { + set-wallpaper = { + Unit = { + Description = "Set a random wallpaper on all X displays"; + }; + Service = { + Type = "oneshot"; + ExecStart = + exe; + }; + }; + }; + }; +} diff --git a/users/common/graphical/default.nix b/users/common/graphical/default.nix index e536815..affeecc 100644 --- a/users/common/graphical/default.nix +++ b/users/common/graphical/default.nix @@ -3,6 +3,7 @@ ./kitty.nix ./Xorg ./firefox.nix + ./themes.nix ]; home = { packages = with pkgs; [ @@ -21,7 +22,4 @@ # notification are nice to have services.dunst.enable = true; - gtk.gtk3.extraConfig = { - gtk-application-prefer-dark-theme = 1; - }; } diff --git a/users/common/graphical/firefox.nix b/users/common/graphical/firefox.nix index 6a608ae..ebadda1 100644 --- a/users/common/graphical/firefox.nix +++ b/users/common/graphical/firefox.nix @@ -16,6 +16,7 @@ "x-scheme-handler/http" = ["firefox.desktop"]; "x-scheme-handler/https" = ["firefox.desktop"]; }; + xdg.mimeApps.enable = true; programs.firefox = { enable = true; profiles.patrick = { diff --git a/users/common/graphical/themes.nix b/users/common/graphical/themes.nix new file mode 100644 index 0000000..26e1e69 --- /dev/null +++ b/users/common/graphical/themes.nix @@ -0,0 +1,57 @@ +{ + pkgs, + config, + ... +}: { + home.pointerCursor = { + gtk.enable = true; + x11.enable = true; + package = pkgs.bibata-cursors; + name = "Bibata-Original-Ice"; + size = 24; + }; + + xresources.properties = { + "Xft.hinting" = true; + "Xft.antialias" = true; + "Xft.autohint" = false; + "Xft.lcdfilter" = "lcddefault"; + "Xft.hintstyle" = "hintfull"; + "Xft.rgba" = "rgb"; + }; + + gtk = let + gtk34extraConfig = { + gtk-application-prefer-dark-theme = 1; + gtk-cursor-theme-size = 32; + gtk-enable-animations = true; + gtk-xft-antialias = 1; + gtk-xft-dpi = 96; # XXX: delete for wayland? + gtk-xft-hinting = 1; + gtk-xft-hintstyle = "hintfull"; + gtk-xft-rgba = "rgb"; + }; + in { + enable = true; + iconTheme = { + name = "Vimix-Doder"; + package = pkgs.vimix-icon-theme; + }; + + theme = { + name = "Orchis-purple-solid-black"; + package = pkgs.orchis-theme; + }; + + gtk2.extraConfig = "gtk-application-prefer-dark-theme = true"; + gtk3.extraConfig = gtk34extraConfig; + gtk4.extraConfig = gtk34extraConfig; + }; + + home.sessionVariables.GTK_THEME = config.gtk.theme.name; + + qt = { + enable = true; + platformTheme = "gtk"; + }; +} diff --git a/users/common/graphical/wayland/sway.nix b/users/common/graphical/wayland/sway.nix index 416b039..c57b0b1 100644 --- a/users/common/graphical/wayland/sway.nix +++ b/users/common/graphical/wayland/sway.nix @@ -2,6 +2,7 @@ config, pkgs, nixosConfig, + lib, ... }: { home.packages = [ @@ -10,8 +11,9 @@ wayland.windowManager.sway = { enable = true; config = + lib.attrsets.recursiveUpdate (import ../sway3.nix) - // { + { menu = "fuzzel"; input = { "*" = { diff --git a/users/common/impermanence.nix b/users/common/impermanence.nix index c5bad97..0280545 100644 --- a/users/common/impermanence.nix +++ b/users/common/impermanence.nix @@ -4,12 +4,16 @@ ... }: { home.persistence."/state" = { - files = with lib.lists; [ - ".ssh/known_hosts" - ".cache/fuzzel" - ]; + files = with lib.lists; + [ + ".ssh/known_hosts" + ".cache/fuzzel" + ] + ++ optionals config.programs.rofi.enable [ + ".cache/rofi3.druncache" + ]; directories = with lib.lists; - [] + [".config/dconf"] ++ # firefox cannot be a symlink as home manager refuses put files outside your $HOME optionals config.programs.firefox.enable [ diff --git a/users/common/programs/bottles.nix b/users/common/programs/bottles.nix index 2bd75e1..ce61a48 100644 --- a/users/common/programs/bottles.nix +++ b/users/common/programs/bottles.nix @@ -1,12 +1,10 @@ -{ - pkgs, - lib, - ... -}: { +{pkgs, ...}: { home.packages = with pkgs; [ bottles winetricks wineWowPackages.fonts wineWowPackages.stagingFull ]; + # To enable dark mode use the command: + # dconf write /com/usebottles/bottles/dark-theme true } diff --git a/users/common/shells/alias.nix b/users/common/shells/alias.nix index 48126af..74ee00c 100644 --- a/users/common/shells/alias.nix +++ b/users/common/shells/alias.nix @@ -1,4 +1,4 @@ -_: { +{pkgs, ...}: { home.shellAliases = { # Aliases l = "ls -lahF --group-directories-first --show-control-chars --quoting-style=escape --color=auto"; @@ -24,5 +24,6 @@ _: { rg = "rg -S"; zf = "zathura --fork"; + gdb = "${pkgs.pwndbg}/bin/pwndbg"; }; } diff --git a/users/patrick/patrick.nix b/users/patrick/patrick.nix index 6b13d7a..f2ded17 100644 --- a/users/patrick/patrick.nix +++ b/users/patrick/patrick.nix @@ -4,6 +4,7 @@ nextcloud-client discord netflix + pwndbg ]; }; }