2024-11-05 05:49:14 -05:00
|
|
|
{ disko, config, ... }:
|
2024-11-02 17:19:40 -04:00
|
|
|
{
|
2024-11-05 02:23:30 -05:00
|
|
|
imports = [ disko.nixosModules.disko ];
|
2024-11-02 17:19:40 -04:00
|
|
|
|
|
|
|
disko.devices = {
|
|
|
|
disk = {
|
2024-11-05 05:49:14 -05:00
|
|
|
"${config.networking.hostName}" = {
|
2024-11-02 17:19:40 -04:00
|
|
|
type = "disk";
|
|
|
|
device = "/dev/nvme0n1";
|
|
|
|
content = {
|
|
|
|
type = "gpt";
|
|
|
|
partitions = {
|
|
|
|
ESP = {
|
|
|
|
size = "2G";
|
|
|
|
type = "EF00";
|
|
|
|
content = {
|
|
|
|
type = "filesystem";
|
|
|
|
format = "vfat";
|
|
|
|
mountpoint = "/boot";
|
2024-11-06 11:49:40 -05:00
|
|
|
mountOptions = [ "umask=0077" ];
|
2024-11-02 17:19:40 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
luks = {
|
|
|
|
size = "100%";
|
|
|
|
content = {
|
|
|
|
type = "luks";
|
2024-11-06 11:49:40 -05:00
|
|
|
name = "${config.networking.hostName}-disk";
|
2024-11-05 01:48:41 -05:00
|
|
|
settings.allowDiscards = true;
|
2024-11-05 02:23:30 -05:00
|
|
|
passwordFile = "/tmp/secret.key";
|
2024-11-02 17:19:40 -04:00
|
|
|
content = {
|
|
|
|
type = "lvm_pv";
|
2024-11-05 05:49:14 -05:00
|
|
|
vg = "${config.networking.hostName}";
|
2024-11-02 17:19:40 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
lvm_vg = {
|
2024-11-05 05:49:14 -05:00
|
|
|
"${config.networking.hostName}" = {
|
2024-11-02 17:19:40 -04:00
|
|
|
type = "lvm_vg";
|
|
|
|
lvs = {
|
|
|
|
root = {
|
|
|
|
size = "100%";
|
|
|
|
content = {
|
2024-11-05 01:48:41 -05:00
|
|
|
type = "btrfs";
|
|
|
|
extraArgs = [ "-f" ];
|
|
|
|
subvolumes = {
|
2024-11-05 02:23:30 -05:00
|
|
|
"/root" = {
|
2024-11-05 01:48:41 -05:00
|
|
|
mountpoint = "/";
|
|
|
|
mountOptions = [ "compress=zstd" "noatime" ];
|
|
|
|
};
|
2024-11-05 02:23:30 -05:00
|
|
|
"/prev" = {
|
2024-11-05 01:48:41 -05:00
|
|
|
mountpoint = "/prev";
|
|
|
|
mountOptions = [ "compress=zstd" "noatime" ];
|
|
|
|
};
|
2024-11-05 02:23:30 -05:00
|
|
|
"/nix" = {
|
2024-11-05 01:48:41 -05:00
|
|
|
mountpoint = "/nix";
|
|
|
|
mountOptions = [ "compress=zstd" "noatime" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
# Impermanence
|
2024-11-05 02:23:30 -05:00
|
|
|
"/persist" = {
|
2024-11-05 01:48:41 -05:00
|
|
|
mountpoint = "/persist";
|
|
|
|
mountOptions = [ "compress=zstd" "noatime" ];
|
|
|
|
};
|
2024-11-05 02:58:39 -05:00
|
|
|
"/persist/.snapshots" = { };
|
2024-11-05 02:23:30 -05:00
|
|
|
|
|
|
|
"/jimbo" = {
|
2024-11-05 01:48:41 -05:00
|
|
|
mountpoint = "/persist/home/jimbo";
|
|
|
|
mountOptions = [ "compress=zstd" "noatime" ];
|
|
|
|
};
|
2024-11-05 02:58:39 -05:00
|
|
|
"/jimbo/.snapshots" = { };
|
2024-11-05 01:48:41 -05:00
|
|
|
};
|
2024-11-02 17:19:40 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
swap = {
|
|
|
|
size = "8G";
|
|
|
|
content = {
|
|
|
|
type = "swap";
|
|
|
|
discardPolicy = "both";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# Needed for impermanence
|
|
|
|
fileSystems = {
|
|
|
|
"/persist".neededForBoot = true;
|
|
|
|
"/persist/home/jimbo".neededForBoot = true;
|
|
|
|
};
|
|
|
|
}
|