mirror of
https://github.com/CHN-beta/nixos.git
synced 2024-10-22 21:18:44 +08:00
modules.system.fileSystems.luks: fix manula decryption
This commit is contained in:
parent
61b9c4a45a
commit
d9c9ecad39
@ -61,20 +61,21 @@ inputs:
|
||||
boot.initrd =
|
||||
{
|
||||
luks.forceLuksSupportInInitrd = true;
|
||||
systemd.services.wait-manual-decrypt =
|
||||
systemd =
|
||||
{
|
||||
wantedBy = [ "initrd-root-fs.target" ];
|
||||
before = [ "roll-rootfs.service" ];
|
||||
unitConfig.DefaultDependencies = false;
|
||||
serviceConfig.Type = "oneshot";
|
||||
script = builtins.concatStringsSep "\n" (builtins.map
|
||||
(device: "while [ ! -e /dev/mapper/${device.value.mapper} ]; do sleep 1; done")
|
||||
(inputs.localLib.attrsToList luks.manual.devices));
|
||||
services.wait-manual-decrypt =
|
||||
{
|
||||
wantedBy = [ "initrd-root-fs.target" ];
|
||||
before = [ "roll-rootfs.service" ];
|
||||
unitConfig.DefaultDependencies = false;
|
||||
serviceConfig.Type = "oneshot";
|
||||
script = builtins.concatStringsSep "\n" (builtins.map
|
||||
(device: "while [ ! -e /dev/mapper/${device.value.mapper} ]; do sleep 1; done")
|
||||
(inputs.localLib.attrsToList luks.manual.devices));
|
||||
};
|
||||
extraBin.cryptsetup = "${inputs.pkgs.cryptsetup}/bin/cryptsetup";
|
||||
};
|
||||
};
|
||||
fileSystems = builtins.listToAttrs (builtins.map
|
||||
(mount: { name = mount; value.options = [ "x-systemd.device-timeout=48h" ]; })
|
||||
luks.manual.delayedMount);
|
||||
})
|
||||
];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user