diff --git a/modules/services/hardware/udev.nix b/modules/services/hardware/udev.nix index 2baa87e9547e..eebf9672a840 100644 --- a/modules/services/hardware/udev.nix +++ b/modules/services/hardware/udev.nix @@ -191,7 +191,7 @@ in ${udev}/sbin/udevadm trigger ${udev}/sbin/udevadm settle # wait for udev to finish - initctl emit new-devices + initctl emit -n new-devices ''; }; diff --git a/modules/services/networking/dhclient.nix b/modules/services/networking/dhclient.nix index 80451ce2a5a8..5a193e60728e 100644 --- a/modules/services/networking/dhclient.nix +++ b/modules/services/networking/dhclient.nix @@ -28,11 +28,11 @@ let # it"), so we silently lose time synchronisation. ${config.system.build.upstart}/sbin/initctl stop ntpd - ${config.system.build.upstart}/sbin/initctl emit ip-up + ${config.system.build.upstart}/sbin/initctl emit -n ip-up fi if test "$reason" = EXPIRE -o "$reason" = RELEASE; then - ${config.system.build.upstart}/sbin/initctl emit ip-down + ${config.system.build.upstart}/sbin/initctl emit -n ip-down fi ''; diff --git a/modules/services/networking/ntpd.nix b/modules/services/networking/ntpd.nix index 159c8022442d..895a8b8933bb 100644 --- a/modules/services/networking/ntpd.nix +++ b/modules/services/networking/ntpd.nix @@ -82,7 +82,7 @@ in chown ${ntpUser} ${stateDir} # Needed to run ntpd as an unprivileged user. - ${modprobe}/sbin/modprobe capability || true + ${modprobe}/sbin/modprobe --quiet capability # !!! This can hang indefinitely if the network is down or # the servers are unreachable. This is particularly bad diff --git a/modules/system/upstart-events/shutdown.nix b/modules/system/upstart-events/shutdown.nix index 02bce7979d0a..9c2359c0ff8c 100644 --- a/modules/system/upstart-events/shutdown.nix +++ b/modules/system/upstart-events/shutdown.nix @@ -61,7 +61,7 @@ with pkgs.lib; echo "<<< MAINTENANCE SHELL >>>" echo "" while ! ${pkgs.bash}/bin/bash --login; do true; done - initctl emit startup + initctl emit -n startup exit 0 fi diff --git a/modules/tasks/lvm.nix b/modules/tasks/lvm.nix index 92dfd52aefda..4aebb33767e5 100644 --- a/modules/tasks/lvm.nix +++ b/modules/tasks/lvm.nix @@ -23,7 +23,7 @@ # make them appear in /dev. ${pkgs.lvm2}/sbin/vgchange --available y - initctl emit new-devices + initctl emit -n new-devices ''; task = true; diff --git a/modules/tasks/network-interfaces.nix b/modules/tasks/network-interfaces.nix index 098828469a67..2868c251fca0 100644 --- a/modules/tasks/network-interfaces.nix +++ b/modules/tasks/network-interfaces.nix @@ -178,6 +178,11 @@ in # Run any user-specified commands. ${pkgs.stdenv.shell} ${pkgs.writeText "local-net-cmds" cfg.localCommands} || true + + # Emit the ip-up event (e.g. to start ntpd). + ${optionalString (cfg.interfaces != []) '' + initctl emit -n ip-up + ''} ''; postStop = diff --git a/modules/tasks/swraid.nix b/modules/tasks/swraid.nix index 74a34ba56891..b94658226013 100644 --- a/modules/tasks/swraid.nix +++ b/modules/tasks/swraid.nix @@ -31,7 +31,7 @@ in # Activate each device found. ${mdadm}/sbin/mdadm --assemble -c ${tempConf} --scan - initctl emit new-devices + initctl emit -n new-devices ''; task = true; diff --git a/modules/virtualisation/qemu-vm.nix b/modules/virtualisation/qemu-vm.nix index 6886a0b23d15..68ba340e6c23 100644 --- a/modules/virtualisation/qemu-vm.nix +++ b/modules/virtualisation/qemu-vm.nix @@ -9,6 +9,8 @@ {config, pkgs, ...}: +with pkgs.lib; + let vmName = config.networking.hostName; @@ -16,7 +18,7 @@ let options = { virtualisation.diskImage = - pkgs.lib.mkOption { + mkOption { default = "./${vmName}.qcow2"; description = '' @@ -90,7 +92,7 @@ in # where the regular value for the `fileSystems' attribute should be # disregarded for the purpose of building a VM test image (since # those filesystems don't exist in the VM). - fileSystems = pkgs.lib.mkOverride 50 {} + fileSystems = mkOverride 50 {} [ { mountPoint = "/"; device = "/dev/vda"; } @@ -121,6 +123,11 @@ in networking.nameservers = [ "10.0.2.3" ]; + networking.interfaces = singleton + { name = "eth0"; + ipAddress = "10.0.2.15"; + }; + system.build.vm = pkgs.runCommand "nixos-vm" {} '' ensureDir $out/bin @@ -137,11 +144,11 @@ in # When building a regular system configuration, override whatever # video driver the host uses. - services.xserver.videoDriver = pkgs.lib.mkOverride 50 {} null; - services.xserver.videoDrivers = pkgs.lib.mkOverride 50 {} [ "cirrus" "vesa" ]; - services.xserver.defaultDepth = pkgs.lib.mkOverride 50 {} 0; - services.xserver.resolutions = pkgs.lib.mkOverride 50 {} []; + services.xserver.videoDriver = mkOverride 50 {} null; + services.xserver.videoDrivers = mkOverride 50 {} [ "cirrus" "vesa" ]; + services.xserver.defaultDepth = mkOverride 50 {} 0; + services.xserver.resolutions = mkOverride 50 {} []; # Wireless won't work in the VM. - networking.enableWLAN = pkgs.lib.mkOverride 50 {} false; + networking.enableWLAN = mkOverride 50 {} false; }