systemd.generator-packages: Option to specify packages providing generators.
This commit is contained in:
parent
faa79e60cc
commit
88e2cc480f
|
@ -472,6 +472,13 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.generator-packages = mkOption {
|
||||||
|
default = [];
|
||||||
|
type = types.listOf types.package;
|
||||||
|
example = literalExample "[ pkgs.systemd-cryptsetup-generator ]";
|
||||||
|
description = "Packages providing systemd generators.";
|
||||||
|
};
|
||||||
|
|
||||||
systemd.defaultUnit = mkOption {
|
systemd.defaultUnit = mkOption {
|
||||||
default = "multi-user.target";
|
default = "multi-user.target";
|
||||||
type = types.str;
|
type = types.str;
|
||||||
|
@ -628,7 +635,13 @@ in
|
||||||
|
|
||||||
environment.systemPackages = [ systemd ];
|
environment.systemPackages = [ systemd ];
|
||||||
|
|
||||||
environment.etc = {
|
environment.etc = let
|
||||||
|
generators = (fold (p: attrs: let path = "${p}/lib/systemd/system-generators";
|
||||||
|
in attrs // (mapAttrs' (name: _: nameValuePair name "${path}/${toString name}")
|
||||||
|
(builtins.readDir "${path}")))
|
||||||
|
cfg.generators
|
||||||
|
cfg.generator-packages);
|
||||||
|
in ({
|
||||||
"systemd/system".source = generateUnits "system" cfg.units upstreamSystemUnits upstreamSystemWants;
|
"systemd/system".source = generateUnits "system" cfg.units upstreamSystemUnits upstreamSystemWants;
|
||||||
|
|
||||||
"systemd/user".source = generateUnits "user" cfg.user.units upstreamUserUnits [];
|
"systemd/user".source = generateUnits "user" cfg.user.units upstreamUserUnits [];
|
||||||
|
@ -667,7 +680,7 @@ in
|
||||||
|
|
||||||
${concatStringsSep "\n" cfg.tmpfiles.rules}
|
${concatStringsSep "\n" cfg.tmpfiles.rules}
|
||||||
'';
|
'';
|
||||||
} // mapAttrs' (n: v: nameValuePair "systemd/system-generators/${n}" {"source"=v;}) cfg.generators;
|
} // mapAttrs' (n: v: nameValuePair "systemd/system-generators/${n}" {"source"=v;}) generators);
|
||||||
|
|
||||||
system.activationScripts.systemd = stringAfter [ "groups" ]
|
system.activationScripts.systemd = stringAfter [ "groups" ]
|
||||||
''
|
''
|
||||||
|
|
Loading…
Reference in New Issue