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
|
||||
mkLabelMount = label: type: {
|
||||
device = "/dev/disk/by-label/${label}";
|
||||
fsType = type;
|
||||
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") ];
|
||||
};
|
||||
mkCakeMount = mkBtrfsMount "CAKE";
|
||||
in
|
||||
{
|
||||
fileSystems = {
|
||||
|
|
@ -18,12 +19,14 @@ in
|
|||
};
|
||||
"/boot" = mkLabelMount "CUP" "vfat";
|
||||
|
||||
"/mnt/butter" = mkBtrfsMount "/" true;
|
||||
"/nix" = mkBtrfsMount "/current/snow" false;
|
||||
"/home" = mkBtrfsMount "/current/home" true;
|
||||
"/home/.snapshots" = mkBtrfsMount "/snapshot/home" false;
|
||||
"/root" = mkBtrfsMount "/current/root" false;
|
||||
"/var" = mkBtrfsMount "/current/var" false;
|
||||
"/mnt/butter" = mkCakeMount "/" true;
|
||||
"/mnt/cream" = mkBtrfsMount "CREAM" "/" true;
|
||||
"/mnt/cream/permanence/.snapshots" = mkBtrfsMount "CREAM" "/snapshot/permanence" false;
|
||||
"/nix" = mkCakeMount "/current/snow" false;
|
||||
"/home" = mkCakeMount "/current/home" true;
|
||||
"/home/.snapshots" = mkCakeMount "/snapshot/home" false;
|
||||
"/root" = mkCakeMount "/current/root" false;
|
||||
"/var" = mkCakeMount "/current/var" false;
|
||||
"/persist" = {
|
||||
depends = [ "/var" ];
|
||||
device = "/var/persist";
|
||||
|
|
@ -32,4 +35,18 @@ in
|
|||
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