From b81f7ca7f2390cbb57089a2138438bfdc557f60e Mon Sep 17 00:00:00 2001 From: nevaforget <> Date: Mon, 31 Aug 2026 12:55:16 +0200 Subject: [PATCH] feat(services): run quickshell as a user service Mirrors the unit moonarch now ships. spawn-at-startup never restarted it, so a crash cost the bar for the rest of the session. --- flake.lock | 8 ++++---- modules/services.nix | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 48b3227..2c56106 100644 --- a/flake.lock +++ b/flake.lock @@ -24,11 +24,11 @@ "moonarch": { "flake": false, "locked": { - "lastModified": 1788173356, - "narHash": "sha256-SbTfjyMc5qBhatIJGPdpwqGB/1m3TV+asCM3anVl+ak=", + "lastModified": 1788173707, + "narHash": "sha256-ukAWqcRbT696x3qeDTKUdAKcdOdhv8dBS9V4kS02mtI=", "ref": "refs/heads/main", - "rev": "e5eb946f66ccfc2ff8566cbe8de1e7974aa8c4d3", - "revCount": 172, + "rev": "56eae1d81d34ad1cb6b80f69056a735d445809b5", + "revCount": 173, "type": "git", "url": "https://gitea.moonarch.de/nevaforget/moonarch.git" }, diff --git a/modules/services.nix b/modules/services.nix index b805c75..d19786e 100644 --- a/modules/services.nix +++ b/modules/services.nix @@ -96,6 +96,21 @@ }; }; + # The bar, launcher and every popout. A unit rather than a spawn-at-startup so + # a crash does not leave the session without a bar until the next login. + systemd.user.services.quickshell = { + description = "Quickshell bar and shell"; + partOf = [ "graphical-session.target" ]; + after = [ "graphical-session.target" ]; + wantedBy = [ "graphical-session.target" ]; + serviceConfig = { + Type = "simple"; + ExecStart = "${lib.getExe pkgs.quickshell} -c moonarch"; + Restart = "on-failure"; + RestartSec = 3; + }; + }; + # nixpkgs ships the package but no module, and the package carries no unit of # its own, so it is declared here. Mirrors /usr/lib/systemd/user/stasis.service. systemd.user.services.stasis = {