From 027971bb9af5a0c3d35f7f43c9ed44e083fe4113 Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Thu, 4 Nov 2021 00:23:01 -0400 Subject: [PATCH] hosts/Infini-FRAMEWORK: setup root on tmpfs --- hosts/Infini-FRAMEWORK/default.nix | 13 ++++++ .../hardware-configuration.nix | 46 +++++++++++++++---- 2 files changed, 50 insertions(+), 9 deletions(-) diff --git a/hosts/Infini-FRAMEWORK/default.nix b/hosts/Infini-FRAMEWORK/default.nix index 3768b82..5d1c892 100644 --- a/hosts/Infini-FRAMEWORK/default.nix +++ b/hosts/Infini-FRAMEWORK/default.nix @@ -21,6 +21,19 @@ system.stateVersion = "21.11"; + environment.persistence."/persist" = { + directories = [ + "/home" + "/var/log" + "/var/lib/bluetooth" + "/var/lib/systemd/coredump" + ]; + + files = [ + "/etc/machine-id" + ]; + }; + networking.interfaces.wlp170s0.useDHCP = true; hardware.video.hidpi.enable = false; diff --git a/hosts/Infini-FRAMEWORK/hardware-configuration.nix b/hosts/Infini-FRAMEWORK/hardware-configuration.nix index dab10af..8288d16 100644 --- a/hosts/Infini-FRAMEWORK/hardware-configuration.nix +++ b/hosts/Infini-FRAMEWORK/hardware-configuration.nix @@ -13,16 +13,44 @@ boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = { - device = "/dev/disk/by-uuid/b99971c6-bdd2-4c55-8992-72d17c19e4b1"; - fsType = "btrfs"; - options = [ "subvol=subvolumes/root" "autodefrag" "noatime" ]; - }; + fileSystems = + let + uuid = uuid: "/dev/disk/by-uuid/${uuid}"; + in + { + "/" = { + device = "none"; + fsType = "tmpfs"; + options = [ "defaults" "size=4G" "mode=755" ]; + }; - fileSystems."/boot/efi" = { - device = "/dev/disk/by-uuid/3FC9-0182"; - fsType = "vfat"; - }; + "/persist" = { + device = uuid "a44af0ff-5667-465d-b80a-1934d1aab8d9"; + fsType = "btrfs"; + options = [ "subvol=root" "autodefrag" "noatime" ]; + neededForBoot = true; + }; + + "/nix" = { + device = uuid "a44af0ff-5667-465d-b80a-1934d1aab8d9"; + fsType = "btrfs"; + options = [ "subvol=nix" "autodefrag" "noatime" ]; + neededForBoot = true; + }; + + "/boot" = { + device = uuid "a44af0ff-5667-465d-b80a-1934d1aab8d9"; + fsType = "btrfs"; + options = [ "subvol=boot" "autodefrag" "noatime" ]; + neededForBoot = true; + }; + + "/boot/efi" = { + device = uuid "3FC9-0182"; + fsType = "vfat"; + neededForBoot = true; + }; + }; swapDevices = [{ device = "/dev/disk/by-uuid/28672ffb-9f1c-462b-b49d-8a14b3dd72b3"; }];