From feac7d06b28895e64cfccef3a96167ad07b1c975 Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Mon, 15 Jul 2024 01:14:11 -0400 Subject: [PATCH] Infini-FRAMEWORK: refactor filesystems using filesystems lib --- hosts/Infini-FRAMEWORK/filesystems.nix | 60 +++++--------------------- 1 file changed, 11 insertions(+), 49 deletions(-) diff --git a/hosts/Infini-FRAMEWORK/filesystems.nix b/hosts/Infini-FRAMEWORK/filesystems.nix index 483fd56..70b9dd2 100644 --- a/hosts/Infini-FRAMEWORK/filesystems.nix +++ b/hosts/Infini-FRAMEWORK/filesystems.nix @@ -1,60 +1,22 @@ -{ config, lib, pkgs, ... }: - +{ lib, ... }: +with lib.our.filesystems; let - uuid = uuid: "/dev/disk/by-uuid/${uuid}"; - main = uuid "a44af0ff-5667-465d-b80a-1934d1aab8d9"; - commonOptions = [ "autodefrag" "noatime" "ssd" "compress=zstd:1" ]; + main = mkBtrfs "a44af0ff-5667-465d-b80a-1934d1aab8d9"; in { fileSystems = { - "/" = { - device = "none"; - fsType = "tmpfs"; - options = [ "defaults" "size=16G" "mode=755" ]; - }; + "/" = mkTmpfs "root" "16G"; + "/boot/efi" = mkEFI "3FC9-0182"; - "/media/main" = { - device = main; - fsType = "btrfs"; - options = commonOptions; - }; + "/media/main" = main [ ]; - "/persist" = { - device = main; - fsType = "btrfs"; - options = [ "subvol=root" ] ++ commonOptions; - neededForBoot = true; - }; - - "/etc/ssh" = { - device = main; - fsType = "btrfs"; - options = [ "subvolid=628" ] ++ 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" = { - device = uuid "3FC9-0182"; - fsType = "vfat"; - neededForBoot = true; - }; + "/persist" = neededForBoot main [ "subvol=root" ]; + "/etc/ssh" = neededForBoot main [ "subvolid=628" ]; + "/nix" = neededForBoot main [ "subvol=nix" ]; + "/boot" = neededForBoot main [ "subvol=boot" ]; }; swapDevices = [ - { device = uuid "28672ffb-9f1c-462b-b49d-8a14b3dd72b3"; } + (mkSwap "28672ffb-9f1c-462b-b49d-8a14b3dd72b3") ]; }