nixos/hardened: simplify script
This commit is contained in:
parent
84bd2f4ab0
commit
15a4f9d8ef
@ -21,15 +21,15 @@ with lib;
|
|||||||
description = "Disable kernel module loading";
|
description = "Disable kernel module loading";
|
||||||
|
|
||||||
wantedBy = [ config.systemd.defaultUnit ];
|
wantedBy = [ config.systemd.defaultUnit ];
|
||||||
after = [ "systemd-udev-settle.service" "firewall.service" "systemd-modules-load.service" ] ++ wantedBy;
|
|
||||||
|
|
||||||
script = "echo -n 1 > /proc/sys/kernel/modules_disabled";
|
after = [ "systemd-udev-settle.service" "firewall.service" "systemd-modules-load.service" ] ++ wantedBy;
|
||||||
|
|
||||||
unitConfig.ConditionPathIsReadWrite = "/proc/sys/kernel";
|
unitConfig.ConditionPathIsReadWrite = "/proc/sys/kernel";
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
RemainAfterExit = true;
|
RemainAfterExit = true;
|
||||||
|
ExecStart = "/bin/sh -c 'echo -n 1 >/proc/sys/kernel/modules_disabled'";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user