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:
parent
48cdd60e02
commit
651686626f
1 changed files with 10 additions and 6 deletions
|
@ -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 ];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue