mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-06 01:38:06 +00:00
[Filesystems] Add disk-related udev rules both normally and to initrd
This commit is contained in:
parent
b358a3d72d
commit
7c6198be6f
1 changed files with 22 additions and 13 deletions
|
|
@ -33,7 +33,10 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
services.udev.extraRules = concatStringsSep "\n" (
|
|
||||||
|
services.udev =
|
||||||
|
let
|
||||||
|
udevRules = concatStringsSep "\n" (
|
||||||
concatLists [
|
concatLists [
|
||||||
(optional (!(builtins.isNull cfg.hddScheduler))
|
(optional (!(builtins.isNull cfg.hddScheduler))
|
||||||
''ACTION=="add|change" SUBSYSTEM=="block", KERNEL=="sd[a-z]*", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}!="none", ATTR{queue/scheduler}="${cfg.hddScheduler}"''
|
''ACTION=="add|change" SUBSYSTEM=="block", KERNEL=="sd[a-z]*", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}!="none", ATTR{queue/scheduler}="${cfg.hddScheduler}"''
|
||||||
|
|
@ -46,6 +49,12 @@ in
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
in
|
||||||
|
{
|
||||||
|
extraRules = udevRules;
|
||||||
|
initrdRules = udevRules;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
services.smartd = {
|
services.smartd = {
|
||||||
enable = mkDefault true;
|
enable = mkDefault true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue