From 010bc4e8c33e458735d6a51e18da94baae3332c7 Mon Sep 17 00:00:00 2001 From: bokicoder <1556588440@qq.com> Date: Fri, 10 Oct 2025 01:23:33 +0800 Subject: [PATCH] fix systemd startup (#364) --- nix/default.nix | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/nix/default.nix b/nix/default.nix index 3f6f1c06..1b3cbc53 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -82,12 +82,21 @@ in { configs.dms = "${ dmsPkgs.dankMaterialShell }/etc/xdg/quickshell/DankMaterialShell"; - activeConfig = lib.mkIf cfg.enableSystemd "dms"; + }; - systemd = lib.mkIf cfg.enableSystemd { - enable = true; - target = "graphical-session.target"; + systemd.user.services.dms = lib.mkIf cfg.enableSystemd { + Unit = { + Description = "DankMaterialShell"; + PartOf = [ config.wayland.systemd.target ]; + After = [ config.wayland.systemd.target ]; }; + + Service = { + ExecStart = lib.getExe dmsPkgs.dmsCli + " run"; + Restart = "on-failure"; + }; + + Install.WantedBy = [ config.wayland.systemd.target ]; }; xdg.configFile = lib.mapAttrs' (name: plugin: {