Merge pull request #41446 from aszlig/make-serviceconfig-overridable
nixos/systemd: Allow to override serviceConfig
This commit is contained in:
commit
70faa56775
@ -78,10 +78,16 @@ in rec {
|
|||||||
optional (badFields != [ ])
|
optional (badFields != [ ])
|
||||||
"Systemd ${group} has extra fields [${concatStringsSep " " badFields}].";
|
"Systemd ${group} has extra fields [${concatStringsSep " " badFields}].";
|
||||||
|
|
||||||
checkUnitConfig = group: checks: v:
|
checkUnitConfig = group: checks: attrs: let
|
||||||
let errors = concatMap (c: c group v) checks; in
|
# We're applied at the top-level type (attrsOf unitOption), so the actual
|
||||||
if errors == [] then true
|
# unit options might contain attributes from mkOverride that we need to
|
||||||
else builtins.trace (concatStringsSep "\n" errors) false;
|
# convert into single values before checking them.
|
||||||
|
defs = mapAttrs (const (v:
|
||||||
|
if v._type or "" == "override" then v.content else v
|
||||||
|
)) attrs;
|
||||||
|
errors = concatMap (c: c group defs) checks;
|
||||||
|
in if errors == [] then true
|
||||||
|
else builtins.trace (concatStringsSep "\n" errors) false;
|
||||||
|
|
||||||
toOption = x:
|
toOption = x:
|
||||||
if x == true then "true"
|
if x == true then "true"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user