fs/disko: add encrypted-zfs
This commit is contained in:
parent
bc92453745
commit
828fdb9736
2configs/fs/disko
|
@ -1,4 +1,5 @@
|
|||
{ disks ? [ "/dev/sda" ], ... }: {
|
||||
boot.supportedFilesystems = [ "bcachefs" ];
|
||||
disko.devices = {
|
||||
disk = {
|
||||
vdb = {
|
||||
|
@ -26,7 +27,7 @@
|
|||
part-type = "primary";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "bcachefs";
|
||||
format = "btrfs";
|
||||
mountpoint = "/";
|
||||
};
|
||||
}
|
||||
|
|
71
2configs/fs/disko/single-disk-encrypted-zfs.nix
Normal file
71
2configs/fs/disko/single-disk-encrypted-zfs.nix
Normal file
|
@ -0,0 +1,71 @@
|
|||
{ disks ? [ "/dev/nvme0n1" ], ... }:
|
||||
let
|
||||
disk = builtins.elemAt disks 0;
|
||||
in {
|
||||
boot.supportedFilesystems = [ "zfs" ];
|
||||
disko.devices = {
|
||||
disk = {
|
||||
nvme = {
|
||||
type = "disk";
|
||||
device = disk;
|
||||
content = {
|
||||
type = "table";
|
||||
format = "gpt";
|
||||
partitions = [
|
||||
{
|
||||
name = "ESP";
|
||||
start = "0";
|
||||
end = "512MiB";
|
||||
fs-type = "fat32";
|
||||
bootable = true;
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "zfs";
|
||||
start = "512MiB";
|
||||
end = "100%";
|
||||
content = {
|
||||
type = "zfs";
|
||||
pool = "tank";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
zpool = {
|
||||
tank = {
|
||||
type = "zpool";
|
||||
rootFsOptions = {
|
||||
compression = "lz4";
|
||||
#reservation = "5G";
|
||||
"com.sun:auto-snapshot" = "false";
|
||||
};
|
||||
mountpoint = null;
|
||||
postCreateHook = "zfs snapshot tank@blank";
|
||||
|
||||
datasets = {
|
||||
|
||||
root = {
|
||||
type = "zfs_fs";
|
||||
mountpoint = "/";
|
||||
options = {
|
||||
encryption = "aes-256-gcm";
|
||||
keyformat = "passphrase";
|
||||
"com.sun:auto-snapshot" = "true";
|
||||
};
|
||||
#keylocation = "file:///tmp/secret.key";
|
||||
};
|
||||
"root/home" = {
|
||||
type = "zfs_fs";
|
||||
mountpoint = "/home";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue