1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

nix: Support specifying systemd target (#1385)

This commit is contained in:
Bailey
2026-01-16 00:01:51 -05:00
committed by GitHub
parent 3539aca1f7
commit aab4b6765d
2 changed files with 17 additions and 7 deletions

View File

@@ -73,6 +73,12 @@ in
default = hasPluginSettings; default = hasPluginSettings;
description = ''Whether to manage plugin settings. Automatically enabled if any plugins have settings configured.''; description = ''Whether to manage plugin settings. Automatically enabled if any plugins have settings configured.'';
}; };
systemd.target = lib.mkOption {
type = lib.types.str;
default = config.wayland.systemd.target;
defaultText = lib.literalExpression "config.wayland.systemd.target";
description = "Systemd target to bind to.";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
@@ -84,8 +90,8 @@ in
systemd.user.services.dms = lib.mkIf cfg.systemd.enable { systemd.user.services.dms = lib.mkIf cfg.systemd.enable {
Unit = { Unit = {
Description = "DankMaterialShell"; Description = "DankMaterialShell";
PartOf = [ config.wayland.systemd.target ]; PartOf = [ cfg.systemd.target ];
After = [ config.wayland.systemd.target ]; After = [ cfg.systemd.target ];
}; };
Service = { Service = {
@@ -93,7 +99,7 @@ in
Restart = "on-failure"; Restart = "on-failure";
}; };
Install.WantedBy = [ config.wayland.systemd.target ]; Install.WantedBy = [ cfg.systemd.target ];
}; };
xdg.stateFile."DankMaterialShell/session.json" = lib.mkIf (cfg.session != { }) { xdg.stateFile."DankMaterialShell/session.json" = lib.mkIf (cfg.session != { }) {

View File

@@ -20,15 +20,19 @@ in
imports = [ imports = [
(import ./options.nix args) (import ./options.nix args)
]; ];
options.programs.dank-material-shell.systemd.target = lib.mkOption {
type = lib.types.str;
description = "Systemd target to bind to.";
default = "graphical-session.target";
};
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
systemd.user.services.dms = lib.mkIf cfg.systemd.enable { systemd.user.services.dms = lib.mkIf cfg.systemd.enable {
description = "DankMaterialShell"; description = "DankMaterialShell";
path = lib.mkForce [ ]; path = lib.mkForce [ ];
partOf = [ "graphical-session.target" ]; partOf = [ cfg.systemd.target ];
after = [ "graphical-session.target" ]; after = [ cfg.systemd.target ];
wantedBy = [ "graphical-session.target" ]; wantedBy = [ cfg.systemd.target ];
restartIfChanged = cfg.systemd.restartIfChanged; restartIfChanged = cfg.systemd.restartIfChanged;
serviceConfig = { serviceConfig = {