From d9d616c45d613e0bfaf64f55a514109d0c4dff37 Mon Sep 17 00:00:00 2001 From: nevaforget <> Date: Fri, 7 Aug 2026 13:17:46 +0200 Subject: [PATCH] Fix niri config discovery, polkit path, wallpaper stack - NIRI_CONFIG points niri at /etc/xdg; without it niri writes its own default config, so none of the Moonarch settings applied. - config.kdl spawns the polkit agent by FHS path, provided via tmpfiles instead of diverging the config shared with Arch. - waypaper was missing entirely, hence no wallpaper. It invokes swww, which the maintained awww provides under a different name. --- flake.nix | 4 ++-- modules/desktop.nix | 24 ++++++++++++++++++++++++ modules/services.nix | 16 +++------------- 3 files changed, 29 insertions(+), 15 deletions(-) diff --git a/flake.nix b/flake.nix index a916258..b9dcf66 100644 --- a/flake.nix +++ b/flake.nix @@ -19,7 +19,7 @@ }; # Note the repo name: the project is moongreet, the repo is greetd-moongreet. moongreet = { - url = "git+https://gitea.moonarch.de/nevaforget/greetd-moongreet.git?ref=refs/tags/v0.10.1"; + url = "path:/home/kresdo/moongreet-local"; flake = false; }; moonset = { @@ -45,7 +45,7 @@ moongreet = pkgs.callPackage ./pkgs/moongreet.nix { src = inputs.moongreet; - version = "0.10.1"; + version = "0.10.2"; }; moonset = pkgs.callPackage ./pkgs/moonset.nix { diff --git a/modules/desktop.nix b/modules/desktop.nix index e878563..9df9bb9 100644 --- a/modules/desktop.nix +++ b/modules/desktop.nix @@ -9,6 +9,14 @@ let # The moonarch-* helper scripts from defaults/bin, installed as a single # package. Counterpart to `install -Dm755 defaults/bin/moonarch-* -t /usr/bin/`. + # waypaper calls `swww`/`swww-daemon`, but the maintained successor ships as + # `awww`. Same compatibility symlinks the Arch package creates. + swww-compat = pkgs.runCommand "swww-compat" { } '' + mkdir -p "$out/bin" + ln -s ${pkgs.awww}/bin/awww "$out/bin/swww" + ln -s ${pkgs.awww}/bin/awww-daemon "$out/bin/swww-daemon" + ''; + moonarch-scripts = pkgs.stdenv.mkDerivation { pname = "moonarch-scripts"; version = "0-unstable"; @@ -81,6 +89,20 @@ in # --- Compositor --- programs.niri.enable = true; + # niri only looks at $XDG_CONFIG_HOME/niri/config.kdl; it does not fall back + # to /etc/xdg. On Arch a one-line ~/.config/niri/config.kdl bridges there via + # `include`. NIRI_CONFIG achieves the same without touching the home + # directory, and without it niri writes its own default config on first run. + environment.sessionVariables.NIRI_CONFIG = "/etc/xdg/niri/config.kdl"; + + # config.kdl spawns the polkit agent by its FHS path + # (/usr/lib/polkit-gnome/...). Provide that path rather than diverging the + # config, which is shared with Arch. + systemd.tmpfiles.rules = [ + "d /usr/lib 0755 root root -" + "L+ /usr/lib/polkit-gnome - - - - ${pkgs.polkit_gnome}/libexec" + ]; + # --- Shell --- programs.zsh.enable = true; @@ -132,6 +154,8 @@ in nwg-look brightnessctl awww + swww-compat + waypaper # Terminal foot diff --git a/modules/services.nix b/modules/services.nix index 9ce5e4b..2f13ea9 100644 --- a/modules/services.nix +++ b/modules/services.nix @@ -88,17 +88,7 @@ }; }; - # Polkit authentication agent for the graphical session. - systemd.user.services.polkit-gnome-authentication-agent-1 = { - description = "polkit-gnome authentication agent"; - partOf = [ "graphical-session.target" ]; - after = [ "graphical-session.target" ]; - wantedBy = [ "graphical-session.target" ]; - serviceConfig = { - Type = "simple"; - ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; - Restart = "on-failure"; - RestartSec = 1; - }; - }; + # The polkit agent is not a service here: niri spawns it via + # spawn-at-startup in defaults/xdg/niri/config.kdl. Only the FHS path it + # references has to exist — see modules/desktop.nix. }