diff options
| -rw-r--r-- | machines/enzo/desktop.nix | 70 | ||||
| -rw-r--r-- | machines/kusanagi/desktop.nix | 28 | ||||
| -rw-r--r-- | profiles/desktop.nix | 10 |
3 files changed, 104 insertions, 4 deletions
diff --git a/machines/enzo/desktop.nix b/machines/enzo/desktop.nix index 8375e13..294fe41 100644 --- a/machines/enzo/desktop.nix +++ b/machines/enzo/desktop.nix @@ -11,15 +11,79 @@ environment.sessionVariables = { XCURSOR_THEME = "Adwaita"; XCURSOR_SIZE = "24"; + + # TODO: move to dotfiles + LESSHISTFILE = "$HOME/.local/state/lesshst"; + HISTFILE = "$HOME/.local/state/bash_history"; }; - # Cursor theme referenced by XCURSOR_THEME / niri's xcursor-theme. Without this - # package the Adwaita cursor files aren't on disk, so named shapes (e.g. the - # link "pointer"/hand) fail to load and the cursor never changes on hover. + + nix.settings.use-xdg-base-directories = true; + environment.systemPackages = with pkgs; [ adwaita-icon-theme yambar # text status bar + xdg-user-dirs ]; + # --- XDG user directories (~/Downloads, ~/Pictures, …) --- + # Bare niri runs no desktop environment, so nothing generates + # ~/.config/user-dirs.dirs on its own — Firefox downloads land in $HOME, the + # GTK file chooser and Nautilus have a bare sidebar, and screenshot tools have + # no Pictures default. This trims the default set (Templates/Publicshare + # dropped — unused under niri) and runs the generator at login. + environment.etc."xdg/user-dirs.defaults".text = '' + DESKTOP=Desktop + DOWNLOAD=Downloads + DOCUMENTS=Documents + MUSIC=Music + PICTURES=Pictures + VIDEOS=Videos + ''; + # A oneshot bound to graphical-session.target (the target niri-session brings + # up — same hook swayidle uses). Before= makes the session wait for the dirs to + # exist before apps start. GTK/GLib reads user-dirs.dirs directly, so no env + # export is needed for the file to take effect. + systemd.user.services.xdg-user-dirs-update = { + description = "Create/update XDG user directories (~/Downloads, ~/Pictures, …)"; + wantedBy = [ "graphical-session.target" ]; + partOf = [ "graphical-session.target" ]; + before = [ "graphical-session.target" ]; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${pkgs.xdg-user-dirs}/bin/xdg-user-dirs-update"; + }; + }; + + # --- Bar + wallpaper (was spawn-at-startup in the shared niri config.kdl) --- + # The bar and wallpaper differ per host, so they live in nixos-config rather + # than the stowed niri config. Long-running user services bound to + # graphical-session.target (the target niri-session activates), same hook as + # xdg-user-dirs-update above. + systemd.user.services.yambar = { + description = "yambar status bar"; + wantedBy = [ "graphical-session.target" ]; + partOf = [ "graphical-session.target" ]; + after = [ "graphical-session.target" ]; + serviceConfig = { + ExecStart = "${pkgs.yambar}/bin/yambar"; + Restart = "on-failure"; + }; + }; + + systemd.user.services.swaybg = { + description = "swaybg wallpaper"; + wantedBy = [ "graphical-session.target" ]; + partOf = [ "graphical-session.target" ]; + after = [ "graphical-session.target" ]; + serviceConfig = { + # Solid color (the old shared config's --image path pointed at + # /home/henz, kusanagi's user, so enzo never had a valid image). Swap in + # an enzo-local image path here if desired. + ExecStart = "${pkgs.swaybg}/bin/swaybg --color '#24273a'"; + Restart = "on-failure"; + }; + }; + # --- User: desktop groups (niri essentials) --- users.users.hwebs.extraGroups = [ "audio" diff --git a/machines/kusanagi/desktop.nix b/machines/kusanagi/desktop.nix index 15bec13..e4b2bc3 100644 --- a/machines/kusanagi/desktop.nix +++ b/machines/kusanagi/desktop.nix @@ -121,4 +121,32 @@ nautilus # file manager loupe # image viewer ]; + + # --- Bar + wallpaper (was spawn-at-startup in the shared niri config.kdl) --- + # The bar and wallpaper differ per host, so they live in nixos-config rather + # than the stowed niri config. Long-running user services bound to + # graphical-session.target (the target niri-session activates). + # NOTE: there's no waybar package in the dotfiles repo yet, so this starts + # default waybar; styling/modules are a separate follow-up. + systemd.user.services.waybar = { + description = "waybar status bar"; + wantedBy = [ "graphical-session.target" ]; + partOf = [ "graphical-session.target" ]; + after = [ "graphical-session.target" ]; + serviceConfig = { + ExecStart = "${pkgs.waybar}/bin/waybar"; + Restart = "on-failure"; + }; + }; + + systemd.user.services.swaybg = { + description = "swaybg wallpaper"; + wantedBy = [ "graphical-session.target" ]; + partOf = [ "graphical-session.target" ]; + after = [ "graphical-session.target" ]; + serviceConfig = { + ExecStart = "${pkgs.swaybg}/bin/swaybg --image '/home/henz/resources/photography/nasa/55196710272_1289069236_o.jpg' --mode fill"; + Restart = "on-failure"; + }; + }; } diff --git a/profiles/desktop.nix b/profiles/desktop.nix index 6d7d465..f84b2de 100644 --- a/profiles/desktop.nix +++ b/profiles/desktop.nix @@ -7,6 +7,14 @@ # and per-user groups live in the machine files. { pkgs, ... }: +let + greeter = pkgs.writeShellScript "tuigreet-fortune" '' + exec ${pkgs.tuigreet}/bin/tuigreet \ + --time --remember \ + --greeting "$(${pkgs.fortune}/bin/fortune)" \ + --cmd niri-session + ''; +in { # --- Session / login --- programs.niri.enable = true; @@ -38,7 +46,7 @@ services.greetd = { enable = true; settings.default_session = { - command = "${pkgs.tuigreet}/bin/tuigreet --time --remember --cmd niri-session"; + command = "${greeter}"; user = "greeter"; }; }; |
