Rename ‘system.build.systemd’ to ‘systemd.package’

This makes it cheaper to test a new systemd and is more consistent
with other modules.
This commit is contained in:
Eelco Dolstra 2013-01-16 13:17:57 +01:00
parent ae4e94d9ac
commit 4d983d4955
15 changed files with 28 additions and 24 deletions

View File

@ -6,7 +6,7 @@ let
inherit (pkgs) stdenv writeText procps; inherit (pkgs) stdenv writeText procps;
udev = config.system.build.systemd; udev = config.systemd.package;
cfg = config.services.udev; cfg = config.services.udev;

View File

@ -56,7 +56,7 @@ with pkgs.lib;
# the daemon. # the daemon.
powerManagement.resumeCommands = powerManagement.resumeCommands =
'' ''
${config.system.build.systemd}/bin/systemctl try-restart upower ${config.systemd.package}/bin/systemctl try-restart upower
''; '';
}; };

View File

@ -49,7 +49,7 @@ in
config = { config = {
services.cron.systemCronJobs = mkIf cfg.automatic (singleton services.cron.systemCronJobs = mkIf cfg.automatic (singleton
"${cfg.dates} root ${config.system.build.systemd}/bin/systemctl start nix-gc.service"); "${cfg.dates} root ${config.systemd.package}/bin/systemctl start nix-gc.service");
systemd.services."nix-gc" = systemd.services."nix-gc" =
{ description = "Nix Garbage Collector"; { description = "Nix Garbage Collector";

View File

@ -57,13 +57,13 @@ let
# server hostnames in its config file, then it will never do # server hostnames in its config file, then it will never do
# anything ever again ("couldn't resolve ..., giving up on # anything ever again ("couldn't resolve ..., giving up on
# it"), so we silently lose time synchronisation. # it"), so we silently lose time synchronisation.
${config.system.build.systemd}/bin/systemctl try-restart ntpd.service ${config.systemd.package}/bin/systemctl try-restart ntpd.service
${config.system.build.systemd}/bin/systemctl start ip-up.target ${config.systemd.package}/bin/systemctl start ip-up.target
fi fi
#if [ "$reason" = EXPIRE -o "$reason" = RELEASE -o "$reason" = NOCARRIER ] ; then #if [ "$reason" = EXPIRE -o "$reason" = RELEASE -o "$reason" = NOCARRIER ] ; then
# ${config.system.build.systemd}/bin/systemctl start ip-down.target # ${config.systemd.package}/bin/systemctl start ip-down.target
#fi #fi
''; '';
@ -126,7 +126,7 @@ in
powerManagement.resumeCommands = powerManagement.resumeCommands =
'' ''
# Tell dhcpcd to rebind its interfaces if it's running. # Tell dhcpcd to rebind its interfaces if it's running.
${config.system.build.systemd}/bin/systemctl reload dhcpcd.service ${config.systemd.package}/bin/systemctl reload dhcpcd.service
''; '';
}; };

View File

@ -39,7 +39,7 @@ let
ipUpScript = pkgs.writeScript "01nixos-ip-up" '' ipUpScript = pkgs.writeScript "01nixos-ip-up" ''
#!/bin/sh #!/bin/sh
if test "$2" = "up"; then if test "$2" = "up"; then
${config.system.build.systemd}/bin/systemctl start ip-up.target ${config.systemd.package}/bin/systemctl start ip-up.target
fi fi
''; '';

View File

@ -124,7 +124,7 @@ in
powerManagement.resumeCommands = powerManagement.resumeCommands =
'' ''
${config.system.build.systemd}/bin/systemctl try-restart wpa_supplicant ${config.systemd.package}/bin/systemctl try-restart wpa_supplicant
''; '';
assertions = [{ assertion = !cfg.userControlled.enable || cfg.interfaces != []; assertions = [{ assertion = !cfg.userControlled.enable || cfg.interfaces != [];

View File

@ -36,7 +36,7 @@ let
# since presumably the desktop environment will handle these. # since presumably the desktop environment will handle these.
if [ -z "$_INHIBITION_LOCK_TAKEN" ]; then if [ -z "$_INHIBITION_LOCK_TAKEN" ]; then
export _INHIBITION_LOCK_TAKEN=1 export _INHIBITION_LOCK_TAKEN=1
exec ${config.system.build.systemd}/bin/systemd-inhibit --what=handle-lid-switch:handle-power-key "$0" "$sessionType" exec ${config.systemd.package}/bin/systemd-inhibit --what=handle-lid-switch:handle-power-key "$0" "$sessionType"
fi fi
${optionalString cfg.startOpenSSHAgent '' ${optionalString cfg.startOpenSSHAgent ''

View File

@ -12,8 +12,8 @@ let
defaultConfig = defaultConfig =
'' ''
[Shutdown] [Shutdown]
HaltCmd=${config.system.build.systemd}/sbin/shutdown -h now HaltCmd=${config.systemd.package}/sbin/shutdown -h now
RebootCmd=${config.system.build.systemd}/sbin/shutdown -r now RebootCmd=${config.systemd.package}/sbin/shutdown -r now
${optionalString (config.system.boot.loader.id == "grub") '' ${optionalString (config.system.boot.loader.id == "grub") ''
BootManager=${if config.boot.loader.grub.version == 2 then "Grub2" else "Grub"} BootManager=${if config.boot.loader.grub.version == 2 then "Grub2" else "Grub"}
''} ''}

View File

@ -14,8 +14,8 @@ let
xserver_arguments ${dmcfg.xserverArgs} xserver_arguments ${dmcfg.xserverArgs}
sessions ${pkgs.lib.concatStringsSep "," (dmcfg.session.names ++ ["custom"])} sessions ${pkgs.lib.concatStringsSep "," (dmcfg.session.names ++ ["custom"])}
login_cmd exec ${pkgs.stdenv.shell} ${dmcfg.session.script} "%session" login_cmd exec ${pkgs.stdenv.shell} ${dmcfg.session.script} "%session"
halt_cmd ${config.system.build.systemd}/sbin/shutdown -h now halt_cmd ${config.systemd.package}/sbin/shutdown -h now
reboot_cmd ${config.system.build.systemd}/sbin/shutdown -r now reboot_cmd ${config.systemd.package}/sbin/shutdown -r now
${optionalString (cfg.defaultUser != "") ("default_user " + cfg.defaultUser)} ${optionalString (cfg.defaultUser != "") ("default_user " + cfg.defaultUser)}
${optionalString cfg.autoLogin "auto_login yes"} ${optionalString cfg.autoLogin "auto_login yes"}
''; '';

View File

@ -120,7 +120,7 @@ let
echo -n "$kernelParams" > $out/kernel-params echo -n "$kernelParams" > $out/kernel-params
echo -n "$configurationName" > $out/configuration-name echo -n "$configurationName" > $out/configuration-name
echo -n "systemd ${toString config.system.build.systemd.interfaceVersion}" > $out/init-interface-version echo -n "systemd ${toString config.systemd.package.interfaceVersion}" > $out/init-interface-version
echo -n "$nixosVersion" > $out/nixos-version echo -n "$nixosVersion" > $out/nixos-version
mkdir $out/fine-tune mkdir $out/fine-tune
@ -149,7 +149,7 @@ let
buildCommand = systemBuilder; buildCommand = systemBuilder;
inherit (pkgs) utillinux; inherit (pkgs) utillinux;
inherit (config.system.build) systemd; systemd = config.systemd.package;
inherit children; inherit children;
kernelParams = kernelParams =

View File

@ -224,7 +224,7 @@ in
serviceConfig = serviceConfig =
{ Type = "oneshot"; { Type = "oneshot";
RemainAfterExit = true; RemainAfterExit = true;
ExecStart = "${config.system.build.systemd}/lib/systemd/systemd-modules-load"; ExecStart = "${config.systemd.package}/lib/systemd/systemd-modules-load";
# Ignore failed module loads. Typically some of the # Ignore failed module loads. Typically some of the
# modules in boot.kernelModules are "nice to have but # modules in boot.kernelModules are "nice to have but
# not required" (e.g. acpi-cpufreq), so we don't want to # not required" (e.g. acpi-cpufreq), so we don't want to

View File

@ -9,7 +9,7 @@ with pkgs.lib;
let let
udev = config.system.build.systemd; udev = config.systemd.package;
options = { options = {

View File

@ -8,7 +8,7 @@ let
cfg = config.systemd; cfg = config.systemd;
systemd = pkgs.systemd; systemd = cfg.package;
makeUnit = name: unit: makeUnit = name: unit:
pkgs.runCommand "unit" { inherit (unit) text; } pkgs.runCommand "unit" { inherit (unit) text; }
@ -340,6 +340,12 @@ in
options = { options = {
systemd.package = mkOption {
default = pkgs.systemd;
type = types.package;
description = "The systemd package.";
};
systemd.units = mkOption { systemd.units = mkOption {
description = "Definition of systemd units."; description = "Definition of systemd units.";
default = {}; default = {};
@ -457,8 +463,6 @@ in
config = { config = {
system.build.systemd = systemd;
system.build.units = units; system.build.units = units;
environment.systemPackages = [ systemd ]; environment.systemPackages = [ systemd ];

View File

@ -85,7 +85,7 @@ in
serviceConfig = serviceConfig =
{ Type = "oneshot"; { Type = "oneshot";
RemainAfterExit = true; RemainAfterExit = true;
ExecStart = "${config.system.build.systemd}/lib/systemd/systemd-vconsole-setup /dev/tty1"; ExecStart = "${config.systemd.package}/lib/systemd/systemd-vconsole-setup /dev/tty1";
}; };
restartTriggers = [ vconsoleConf ]; restartTriggers = [ vconsoleConf ];
}; };

View File

@ -350,11 +350,11 @@ in
ip -4 addr add "${i.ipAddress}/${mask}" dev "${i.name}" ip -4 addr add "${i.ipAddress}/${mask}" dev "${i.name}"
# Ensure that the default gateway remains set. # Ensure that the default gateway remains set.
# (Flushing this interface may have removed it.) # (Flushing this interface may have removed it.)
${config.system.build.systemd}/bin/systemctl try-restart --no-block network-setup.service ${config.systemd.package}/bin/systemctl try-restart --no-block network-setup.service
else else
echo "skipping configuring interface" echo "skipping configuring interface"
fi fi
${config.system.build.systemd}/bin/systemctl start ip-up.target ${config.systemd.package}/bin/systemctl start ip-up.target
'' ''
+ optionalString i.proxyARP + optionalString i.proxyARP
'' ''