summaryrefslogtreecommitdiffstats
path: root/nixos/modules/config
diff options
context:
space:
mode:
authorMichele Guerini Rocco <rnhmjoj@users.noreply.github.com>2020-02-12 01:28:03 +0100
committerGitHub <noreply@github.com>2020-02-12 01:28:03 +0100
commit48704fbd4fc4dc9660ab04f938048b4894ecb140 (patch)
treebfcc0e1b28c219b5d32f742f87a4b8f8ded6c391 /nixos/modules/config
parent2f618146653ed55632fc2f0c720aec16246cf1a3 (diff)
parentd14ba1e1add6cca568515f87508ad5d00180bf16 (diff)
Merge pull request #71302 from tokudan/encrypted-swap-entropy-fix
rngd: Start early during boot and encrypted swap entropy fix
Diffstat (limited to 'nixos/modules/config')
-rw-r--r--nixos/modules/config/swap.nix2
1 files changed, 2 insertions, 0 deletions
diff --git a/nixos/modules/config/swap.nix b/nixos/modules/config/swap.nix
index d0fc0d4a3ea4..adb4e2294213 100644
--- a/nixos/modules/config/swap.nix
+++ b/nixos/modules/config/swap.nix
@@ -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 =