diff options
| author | Raghuram Subramani <raghus2247@gmail.com> | 2024-10-10 11:35:30 +0530 |
|---|---|---|
| committer | Raghuram Subramani <raghus2247@gmail.com> | 2024-10-10 11:35:30 +0530 |
| commit | 9cb4903aa9c90b7b0f88fe1f954e7474247c06d2 (patch) | |
| tree | 4e838b4f3bf89103b198544aa415606df6d97ebe | |
| parent | 1f34404b653877e010332ae31de8ce07c541ef59 (diff) | |
(update): Install script, update btrfs erase script.
| -rw-r--r-- | disko.nix | 5 | ||||
| -rwxr-xr-x | install.sh | 14 | ||||
| -rw-r--r-- | machines/x/hardware-configuration.nix | 2 | ||||
| -rw-r--r-- | modules/core/impermanence.nix | 10 |
4 files changed, 21 insertions, 10 deletions
@@ -67,6 +67,11 @@ mountpoint = "/nix"; }; + "/config" = { + mountOptions = ["subvol=config" "noatime"]; + mountpoint = "/config"; + }; + "/home" = { mountOptions = ["subvol=home" "noatime"]; mountpoint = "/home"; diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..e3d8bbd --- /dev/null +++ b/install.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +MACHINE=x + +sudo mkdir -v /mnt/persist/system +sudo cp -rv * /mnt/config + +sudo nixos-generate-config --root /mnt --no-filesystems + +cd /mnt/config +sudo mv -v /mnt/etc/nixos/hardware-configuration.nix machines/$MACHINE/hardware-configuration.nix +sudo rm -rfv /mnt/etc + +sudo nixos-install --root /mnt --no-root-password --flake .#$MACHINE diff --git a/machines/x/hardware-configuration.nix b/machines/x/hardware-configuration.nix index 39216b4..3827c89 100644 --- a/machines/x/hardware-configuration.nix +++ b/machines/x/hardware-configuration.nix @@ -8,7 +8,7 @@ [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" ]; boot.initrd.kernelModules = [ "dm-snapshot" ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; diff --git a/modules/core/impermanence.nix b/modules/core/impermanence.nix index c5f3009..8540ed2 100644 --- a/modules/core/impermanence.nix +++ b/modules/core/impermanence.nix @@ -4,11 +4,6 @@ boot.initrd.postDeviceCommands = lib.mkAfter '' mkdir /btrfs_tmp mount /dev/root_vg/root /btrfs_tmp - if [[ -e /btrfs_tmp/root ]]; then - mkdir -p /btrfs_tmp/old_roots - timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S") - mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp" - fi delete_subvolume_recursively() { IFS=$'\n' @@ -18,9 +13,7 @@ btrfs subvolume delete "$1" } - for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do - delete_subvolume_recursively "$i" - done + delete_subvolume_recursively "/btrfs_tmp/root" btrfs subvolume create /btrfs_tmp/root umount /btrfs_tmp @@ -30,7 +23,6 @@ environment.persistence."/persist/system" = { hideMounts = true; directories = [ - "/etc/nixos" "/var/log" "/var/lib/bluetooth" "/var/lib/nixos" |
