Infini-OPTIPLEX: refactor filesystems

This commit is contained in:
Infinidoge 2024-02-03 01:43:16 -05:00
parent 2d1304bf29
commit ba7580c2a2
Signed by: Infinidoge
SSH key fingerprint: SHA256:oAMyvotlNFraMmZmr+p6AxnNfW/GioTs1pOn3V4tQ7A

View file

@ -3,6 +3,14 @@ let
uuid = uuid: "/dev/disk/by-uuid/${uuid}"; uuid = uuid: "/dev/disk/by-uuid/${uuid}";
main = uuid "9d4bf2d8-f139-42e7-937a-541a7870d806"; main = uuid "9d4bf2d8-f139-42e7-937a-541a7870d806";
commonOptions = [ "autodefrag" "noatime" "ssd" "compress=zstd:1" ]; commonOptions = [ "autodefrag" "noatime" "ssd" "compress=zstd:1" ];
mkMain' = options: {
device = main;
fsType = "btrfs";
options = commonOptions ++ options;
};
mkMainOpt = options: (mkMain' options) // { neededForBoot = true; };
mkMain = subvol: mkMainOpt [ "subvol=${subvol}" ];
in in
{ {
fileSystems = { fileSystems = {
@ -12,39 +20,11 @@ in
options = [ "defaults" "size=16G" "mode=755" ]; options = [ "defaults" "size=16G" "mode=755" ];
}; };
"/media/main" = { "/media/main" = mkMain' [ ];
device = main; "/persist" = mkMain "root";
fsType = "btrfs"; "/etc/ssh" = mkMain "root/etc/ssh";
options = commonOptions; "/nix" = mkMain "nix";
}; "/boot" = mkMain "boot";
"/persist" = {
device = main;
fsType = "btrfs";
options = [ "subvol=root" ] ++ commonOptions;
neededForBoot = true;
};
"/etc/ssh" = {
device = main;
fsType = "btrfs";
options = [ "subvol=root/etc/ssh" ] ++ commonOptions;
neededForBoot = true;
};
"/nix" = {
device = main;
fsType = "btrfs";
options = [ "subvol=nix" ] ++ commonOptions;
neededForBoot = true;
};
"/boot" = {
device = main;
fsType = "btrfs";
options = [ "subvol=boot" ] ++ commonOptions;
neededForBoot = true;
};
"/boot/efi" = { "/boot/efi" = {
device = uuid "23B2-DCD2"; device = uuid "23B2-DCD2";