convert bbswitch job to systemd unit

dramatically speeds up my boot time because it was the last
service (for me) that depended on udev-settle.service

udev-settle isn't needed for modern system initialization but some
oldschool services (mdadm/lvm/cryptsetup) depend on it so they can
just enumerate devices instead of having to react to changes
dynamically. In NixOS these things are usually already taken care of
during stage 1 (early ramdisk) if you use them.
This commit is contained in:
Mathijs Kwik 2013-08-24 11:38:32 +02:00
parent 48cdd60e02
commit 651686626f

View file

@ -27,13 +27,17 @@ in
boot.kernelModules = [ "bbswitch" ];
boot.extraModulePackages = [ kernel.bbswitch ];
jobs.bbswitch = {
name = "bbswitch";
systemd.services.bbswitch = {
description = "turn off nvidia card";
startOn = "stopped udevtrigger";
exec = "discrete_vga_poweroff";
path = [kernel.bbswitch];
task = true;
after = [ "sysinit.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
ExecStart = "${kernel.bbswitch}/bin/discrete_vga_poweroff";
ExecStop = "${kernel.bbswitch}/bin/discrete_vga_poweron";
};
path = [ kernel.bbswitch ];
};
};