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: {