NixOS-Config/hosts/firefly/disko/default.nix

106 lines
2.3 KiB
Nix

{ disko, ... }:
{
imports = [
disko.nixosModules.disko
];
disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {
ESP = {
size = "2G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "crypt-nvme";
passwordFile = "/tmp/secret.key";
content = {
type = "lvm_pv";
vg = "nixos";
};
};
};
};
};
};
};
lvm_vg = {
nixos = {
type = "lvm_vg";
lvs = {
root = {
size = "100%";
content = {
type = "zfs";
pool = "zroot";
};
};
swap = {
size = "8G";
content = {
type = "swap";
discardPolicy = "both";
};
};
};
};
};
zpool = {
zroot = {
type = "zpool";
mode = "single";
options.cachefile = "none";
datasets = {
root = {
type = "zfs_fs";
mountpoint = "/";
options."com.sun:auto-snapshot" = "false";
};
prev = {
type = "zfs_fs";
mountpoint = "/prev";
options."com.sun:auto-snapshot" = "false";
};
nix = {
type = "zfs_fs";
mountpoint = "/nix";
options."com.sun:auto-snapshot" = "false";
};
# Impermanence
persist = {
type = "zfs_fs";
mountpoint = "/persist";
};
jimbo = {
type = "zfs_fs";
mountpoint = "/persist/home/jimbo";
};
};
};
};
};
# Needed for impermanence
fileSystems = {
"/persist".neededForBoot = true;
"/persist/home/jimbo".neededForBoot = true;
};
}