hyacinth/filesystem: add cream
This commit is contained in:
parent
71ef24eab2
commit
7c499fed49
1 changed files with 25 additions and 8 deletions
|
|
@ -1,13 +1,14 @@
|
||||||
{ config, ... }:
|
{ config, lib, ... }:
|
||||||
let
|
let
|
||||||
mkLabelMount = label: type: {
|
mkLabelMount = label: type: {
|
||||||
device = "/dev/disk/by-label/${label}";
|
device = "/dev/disk/by-label/${label}";
|
||||||
fsType = type;
|
fsType = type;
|
||||||
options = [ "defaults" "relatime" ];
|
options = [ "defaults" "relatime" ];
|
||||||
};
|
};
|
||||||
mkBtrfsMount = subvol: atime: mkLabelMount "CAKE" "btrfs" // {
|
mkBtrfsMount = name: subvol: atime: mkLabelMount name "btrfs" // {
|
||||||
options = [ "autodefrag" "compress=zstd:3" "defaults" "discard=async" "space_cache=v2" "ssd" "subvol=${subvol}" (if atime then "relatime" else "noatime") ];
|
options = [ "autodefrag" "compress=zstd:3" "defaults" "discard=async" "space_cache=v2" "ssd" "subvol=${subvol}" (if atime then "relatime" else "noatime") ];
|
||||||
};
|
};
|
||||||
|
mkCakeMount = mkBtrfsMount "CAKE";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
fileSystems = {
|
fileSystems = {
|
||||||
|
|
@ -18,12 +19,14 @@ in
|
||||||
};
|
};
|
||||||
"/boot" = mkLabelMount "CUP" "vfat";
|
"/boot" = mkLabelMount "CUP" "vfat";
|
||||||
|
|
||||||
"/mnt/butter" = mkBtrfsMount "/" true;
|
"/mnt/butter" = mkCakeMount "/" true;
|
||||||
"/nix" = mkBtrfsMount "/current/snow" false;
|
"/mnt/cream" = mkBtrfsMount "CREAM" "/" true;
|
||||||
"/home" = mkBtrfsMount "/current/home" true;
|
"/mnt/cream/permanence/.snapshots" = mkBtrfsMount "CREAM" "/snapshot/permanence" false;
|
||||||
"/home/.snapshots" = mkBtrfsMount "/snapshot/home" false;
|
"/nix" = mkCakeMount "/current/snow" false;
|
||||||
"/root" = mkBtrfsMount "/current/root" false;
|
"/home" = mkCakeMount "/current/home" true;
|
||||||
"/var" = mkBtrfsMount "/current/var" false;
|
"/home/.snapshots" = mkCakeMount "/snapshot/home" false;
|
||||||
|
"/root" = mkCakeMount "/current/root" false;
|
||||||
|
"/var" = mkCakeMount "/current/var" false;
|
||||||
"/persist" = {
|
"/persist" = {
|
||||||
depends = [ "/var" ];
|
depends = [ "/var" ];
|
||||||
device = "/var/persist";
|
device = "/var/persist";
|
||||||
|
|
@ -32,4 +35,18 @@ in
|
||||||
neededForBoot = true;
|
neededForBoot = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
services.snapper.configs.cream = {
|
||||||
|
fstype = "btrfs";
|
||||||
|
subvolume = "/mnt/cream/permanence";
|
||||||
|
extraConfig = lib.concatStringsSep "\n" (lib.mapAttrsToList (k: v: "${k}=${v}") {
|
||||||
|
TIMELINE_CLEANUP = "yes";
|
||||||
|
TIMELINE_CREATE = "yes";
|
||||||
|
TIMELINE_MIN_AGE = "1800";
|
||||||
|
TIMELINE_LIMIT_HOURLY = "5";
|
||||||
|
TIMELINE_LIMIT_DAILY = "7";
|
||||||
|
TIMELINE_LIMIT_WEEKLY = "0";
|
||||||
|
TIMELINE_LIMIT_MONTHLY = "0";
|
||||||
|
TIMELINE_LIMIT_YEARLY = "0";
|
||||||
|
});
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue