Revert "Gonna reinstall with zfs now wish me luck"

This reverts commit ee7dc7925d.
This commit is contained in:
Jimbo 2024-11-05 01:48:41 -05:00
parent ee7dc7925d
commit 6a5774b9b9
5 changed files with 67 additions and 39 deletions

View file

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

View file

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

View file

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

View file

@ -0,0 +1,12 @@
{ ... }:
{
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

@ -0,0 +1,12 @@
{ ... }:
{
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;
};
}