summaryrefslogtreecommitdiff
path: root/machines/enzo/desktop.nix
diff options
context:
space:
mode:
authorHenry J. Webster <hwebs@hwebs.info>2026-07-31 09:51:20 -0500
committerHenry J. Webster <hwebs@hwebs.info>2026-07-31 09:51:20 -0500
commit9cba5e7886b326bfec049c4ca5024274e4b8e201 (patch)
tree57810aa48299dcf66c59cd7b30090af550336d37 /machines/enzo/desktop.nix
parent2b2e0cc61537fefdddf81f982668d43fe89c0d2f (diff)
desktop: start bar+wallpaper via systemd; fortune greeter
Move the niri bar (yambar on enzo, waybar on kusanagi) and swaybg wallpaper out of the shared stowed niri config and into per-machine systemd user services bound to graphical-session.target, mirroring the existing xdg-user-dirs-update unit. This makes the bar host-correct (kusanagi previously spawned yambar, which isn't installed there) and keeps host-specific paths out of the shared config. Also switch the greetd session to a small wrapper script that shows a fortune greeting in tuigreet. Assisted-by: Claude:claude-opus-4-8
Diffstat (limited to 'machines/enzo/desktop.nix')
-rw-r--r--machines/enzo/desktop.nix70
1 files changed, 67 insertions, 3 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"