systemd-stage-1: managerEnvironment option
This commit is contained in:
parent
025d8692b2
commit
988184ca82
@ -158,6 +158,16 @@ in {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
managerEnvironment = mkOption {
|
||||||
|
type = with types; attrsOf (nullOr (oneOf [ str path package ]));
|
||||||
|
default = {};
|
||||||
|
example = { SYSTEMD_LOG_LEVEL = "debug"; };
|
||||||
|
description = lib.mdDoc ''
|
||||||
|
Environment variables of PID 1. These variables are
|
||||||
|
*not* passed to started units.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
contents = mkOption {
|
contents = mkOption {
|
||||||
description = lib.mdDoc "Set of files that have to be linked into the initrd";
|
description = lib.mdDoc "Set of files that have to be linked into the initrd";
|
||||||
example = literalExpression ''
|
example = literalExpression ''
|
||||||
@ -357,6 +367,8 @@ in {
|
|||||||
umount = "${cfg.package.util-linux}/bin/umount";
|
umount = "${cfg.package.util-linux}/bin/umount";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
managerEnvironment.PATH = "/bin:/sbin";
|
||||||
|
|
||||||
contents = {
|
contents = {
|
||||||
"/init".source = "${cfg.package}/lib/systemd/systemd";
|
"/init".source = "${cfg.package}/lib/systemd/systemd";
|
||||||
"/etc/systemd/system".source = stage1Units;
|
"/etc/systemd/system".source = stage1Units;
|
||||||
@ -365,6 +377,7 @@ in {
|
|||||||
[Manager]
|
[Manager]
|
||||||
DefaultEnvironment=PATH=/bin:/sbin ${optionalString (isBool cfg.emergencyAccess && cfg.emergencyAccess) "SYSTEMD_SULOGIN_FORCE=1"}
|
DefaultEnvironment=PATH=/bin:/sbin ${optionalString (isBool cfg.emergencyAccess && cfg.emergencyAccess) "SYSTEMD_SULOGIN_FORCE=1"}
|
||||||
${cfg.extraConfig}
|
${cfg.extraConfig}
|
||||||
|
ManagerEnvironment=${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "${n}=${lib.escapeShellArg v}") cfg.managerEnvironment)}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
"/lib/modules".source = "${modulesClosure}/lib/modules";
|
"/lib/modules".source = "${modulesClosure}/lib/modules";
|
||||||
|
Loading…
Reference in New Issue
Block a user