mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
nixos/…/swap.nix: add some safety assertions for randomEncryption
This commit is contained in:
parent
d8d75ddec6
commit
a3621b1047
1 changed files with 2 additions and 0 deletions
|
@ -125,6 +125,8 @@ in
|
|||
|
||||
createSwapDevice = sw:
|
||||
assert sw.device != "";
|
||||
assert !(sw.randomEncryption && lib.hasPrefix "/dev/disk/by-uuid" sw.device);
|
||||
assert !(sw.randomEncryption && lib.hasPrefix "/dev/disk/by-label" sw.device);
|
||||
let realDevice' = escapeSystemdPath sw.realDevice;
|
||||
in nameValuePair "mkswap-${sw.deviceName}"
|
||||
{ description = "Initialisation of swap device ${sw.device}";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue