Gonna reinstall with zfs now wish me luck

This commit is contained in:
Jimbo 2024-11-05 00:43:02 -05:00
parent 07cb2d67a2
commit ee7dc7925d
5 changed files with 39 additions and 67 deletions

View file

@ -19,7 +19,7 @@
type = "filesystem"; type = "filesystem";
format = "vfat"; format = "vfat";
mountpoint = "/boot"; mountpoint = "/boot";
mountOptions = [ "fmask=0022" "dmask=0022" ]; mountOptions = [ "umask=0077" ];
}; };
}; };
luks = { luks = {
@ -27,8 +27,7 @@
content = { content = {
type = "luks"; type = "luks";
name = "crypt-nvme"; name = "crypt-nvme";
settings.allowDiscards = true; passwordFile = "/tmp/secret.key";
#passwordFile = "/tmp/secret.key";
content = { content = {
type = "lvm_pv"; type = "lvm_pv";
vg = "nixos"; vg = "nixos";
@ -47,32 +46,8 @@
root = { root = {
size = "100%"; size = "100%";
content = { content = {
type = "btrfs"; type = "zfs";
extraArgs = [ "-f" ]; pool = "zroot";
subvolumes = {
"/@" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/@prev" = {
mountpoint = "/prev";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/@nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ];
};
# Impermanence
"/@root" = {
mountpoint = "/persist";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/@jimbo" = {
mountpoint = "/persist/home/jimbo";
mountOptions = [ "compress=zstd" "noatime" ];
};
};
}; };
}; };
swap = { swap = {
@ -85,6 +60,41 @@
}; };
}; };
}; };
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 # Needed for impermanence

View file

@ -3,6 +3,5 @@
imports = [ imports = [
./filesystems ./filesystems
./impermanence ./impermanence
./snapper
]; ];
} }

View file

@ -1,13 +0,0 @@
{ ... }:
{
imports = [
./root
./jimbo
];
services.snapper = {
snapshotInterval = "0/6:00:00";
cleanupInterval = "12:00:00";
persistentTimer = true;
};
}

View file

@ -1,12 +0,0 @@
{ ... }:
{
services.snapper.configs.jimbo = {
SUBVOLUME = "/persist/home/jimbo";
TIMELINE_CREATE = true;
TIMELINE_CLEANUP = true;
TIMELINE_LIMIT_DAILY = 1;
TIMELINE_LIMIT_WEEKLY = 1;
TIMELINE_LIMIT_MONTHLY = 0;
TIMELINE_LIMIT_YEARLY = 0;
};
}

View file

@ -1,12 +0,0 @@
{ ... }:
{
services.snapper.configs.root = {
SUBVOLUME = "/persist";
TIMELINE_CREATE = true;
TIMELINE_CLEANUP = true;
TIMELINE_LIMIT_DAILY = 1;
TIMELINE_LIMIT_WEEKLY = 0;
TIMELINE_LIMIT_MONTHLY = 0;
TIMELINE_LIMIT_YEARLY = 0;
};
}