swap: depend on rngd if enabled and randomEncryption is configured to

avoid entropy starvation during boot
This commit is contained in:
Daniel Frank
2020-02-08 12:26:09 +01:00
parent 2de41ccab3
commit 1ac86e14c7
+2
View File
@@ -185,6 +185,8 @@ in
{ description = "Initialisation of swap device ${sw.device}";
wantedBy = [ "${realDevice'}.swap" ];
before = [ "${realDevice'}.swap" ];
# If swap is encrypted, depending on rngd resolves a possible entropy starvation during boot
after = mkIf (config.security.rngd.enable && sw.randomEncryption.enable) [ "rngd.service" ];
path = [ pkgs.utillinux ] ++ optional sw.randomEncryption.enable pkgs.cryptsetup;
script =