import all the keys
Signed-off-by: ahuston-0 <aliceghuston@gmail.com>
This commit is contained in:
parent
12555ebc3a
commit
164e86468d
@ -1,37 +1,41 @@
|
|||||||
{ lib, ... }:
|
{ lib, pkgs, ... }:
|
||||||
{
|
{
|
||||||
|
|
||||||
boot.zfs.requestEncryptionCredentials = lib.mkForce false;
|
boot = {
|
||||||
|
zfs.requestEncryptionCredentials = lib.mkForce false;
|
||||||
boot.initrd = {
|
postBootCommands = ''
|
||||||
services.lvm.enable = true;
|
${pkgs.zfs}/bin/zfs load-key -a
|
||||||
luks.devices = {
|
|
||||||
"nixos-pv" = {
|
|
||||||
device = "/dev/disk/by-uuid/614787a6-784a-4932-b787-cb6424725444";
|
|
||||||
preLVM = true;
|
|
||||||
allowDiscards = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
postResumeCommands = ''
|
|
||||||
# let root mount and everything, then manually unlock stuff
|
|
||||||
load_zfs_nix() {
|
|
||||||
local device="/dev/disk/by-uuid/8bfaa32b-09dd-45c8-831e-05e80be82f9e"
|
|
||||||
local mountPoint="/"
|
|
||||||
local options="x-initrd.mount,noatime,nodiratime"
|
|
||||||
local fsType="ext4"
|
|
||||||
|
|
||||||
echo "manually mounting key location, then unmounting"
|
|
||||||
udevadm settle
|
|
||||||
|
|
||||||
mountFS "$device" "$(escapeFstab "$mountPoint")" "$(escapeFstab "$options")" "$fsType"
|
|
||||||
|
|
||||||
zfs load-key -L "file://$targetRoot/crypto/keys/zfs-nix-store-key" "ZFS-primary/nix"
|
|
||||||
umount "$targetRoot/"
|
|
||||||
}
|
|
||||||
|
|
||||||
load_zfs_nix
|
|
||||||
'';
|
'';
|
||||||
|
initrd = {
|
||||||
|
services.lvm.enable = true;
|
||||||
|
luks.devices = {
|
||||||
|
"nixos-pv" = {
|
||||||
|
device = "/dev/disk/by-uuid/614787a6-784a-4932-b787-cb6424725444";
|
||||||
|
preLVM = true;
|
||||||
|
allowDiscards = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
postResumeCommands = ''
|
||||||
|
# let root mount and everything, then manually unlock stuff
|
||||||
|
load_zfs_nix() {
|
||||||
|
local device="/dev/disk/by-uuid/8bfaa32b-09dd-45c8-831e-05e80be82f9e"
|
||||||
|
local mountPoint="/"
|
||||||
|
local options="x-initrd.mount,noatime,nodiratime"
|
||||||
|
local fsType="ext4"
|
||||||
|
|
||||||
|
echo "manually mounting key location, then unmounting"
|
||||||
|
udevadm settle
|
||||||
|
|
||||||
|
mountFS "$device" "$(escapeFstab "$mountPoint")" "$(escapeFstab "$options")" "$fsType"
|
||||||
|
|
||||||
|
zfs load-key -L "file://$targetRoot/crypto/keys/zfs-nix-store-key" "ZFS-primary/nix"
|
||||||
|
umount "$targetRoot/"
|
||||||
|
}
|
||||||
|
|
||||||
|
load_zfs_nix
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems = {
|
fileSystems = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user