From a0f0e1a1f884ed50c83a6978435b0dc71b2de172 Mon Sep 17 00:00:00 2001 From: Alexander Szczepanski Date: Mon, 25 Nov 2024 00:02:03 +0100 Subject: [PATCH] framework-2024-11-25-00-02-03 --- configs/common-server.nix | 13 --- configs/common.nix | 78 +++++++++++++++++- configs/plasma.nix | 1 + configs/user-gui.nix | 8 +- ...{virtualisation.nix => virtualization.nix} | 0 flake.lock | 38 ++++----- flake.nix | 2 +- machine/desktop/configuration.nix | 75 +---------------- machine/framework/configuration.nix | 81 +------------------ machine/mini/configuration.nix | 76 ----------------- machine/nixos-virtualbox/configuration.nix | 63 --------------- machine/vps-arm/configuration.nix | 73 ----------------- 12 files changed, 103 insertions(+), 405 deletions(-) delete mode 100644 configs/common-server.nix rename configs/{virtualisation.nix => virtualization.nix} (100%) diff --git a/configs/common-server.nix b/configs/common-server.nix deleted file mode 100644 index c5aff2e..0000000 --- a/configs/common-server.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: { - imports = [../configs/common.nix ../configs/docker.nix ../configs/user.nix]; - - fileSystems."/export/docker" = { - device = "/home/alex/docker"; - options = ["bind"]; - }; -} diff --git a/configs/common.nix b/configs/common.nix index cb8b30c..34e859c 100644 --- a/configs/common.nix +++ b/configs/common.nix @@ -5,14 +5,73 @@ inputs, ... }: { + nixpkgs = { + config = { + allowUnfree = true; + }; + }; + boot = { + loader = { + efi.canTouchEfiVariables = true; + grub = { + enable = true; + device = "nodev"; + efiSupport = true; + configurationLimit = 5; + enableCryptodisk = true; + useOSProber = true; + }; + }; + tmp = { useTmpfs = lib.mkDefault true; cleanOnBoot = true; }; consoleLogLevel = 0; kernel.sysctl = {"vm.max_map_count" = 262144;}; - supportedFilesystems = ["ntfs"]; + supportedFilesystems = ["ntfs" "btrfs"]; + + initrd = { + postDeviceCommands = pkgs.lib.mkBefore '' + mkdir -p /mnt + + # We first mount the btrfs root to /mnt + # so we can manipulate btrfs subvolumes. + mount -o subvol=/ /dev/mapper/lvm-root /mnt + + # While we're tempted to just delete /root and create + # a new snapshot from /root-blank, /root is already + # populated at this point with a number of subvolumes, + # which makes `btrfs subvolume delete` fail. + # So, we remove them first. + # + # /root contains subvolumes: + # - /root/var/lib/portables + # - /root/var/lib/machines + # + # I suspect these are related to systemd-nspawn, but + # since I don't use it I'm not 100% sure. + # Anyhow, deleting these subvolumes hasn't resulted + # in any issues so far, except for fairly + # benign-looking errors from systemd-tmpfiles. + btrfs subvolume list -o /mnt/root | + cut -f9 -d' ' | + while read subvolume; do + echo "deleting /$subvolume subvolume..." + btrfs subvolume delete "/mnt/$subvolume" + done && + echo "deleting /root subvolume..." && + btrfs subvolume delete /mnt/root + + echo "restoring blank /root subvolume..." + btrfs subvolume snapshot /mnt/root-blank /mnt/root + + # Once we're done rolling back to a blank snapshot, + # we can unmount /mnt and continue on the boot process. + umount /mnt + ''; + }; }; # Work around for https://github.com/NixOS/nixpkgs/issues/124215 @@ -88,6 +147,23 @@ man-pages man-pages-posix ]; + + persistence."/persist" = { + directories = [ + "/var/lib/nixos" + "/var/lib/tailscale" + "/var/lib/tuptime" + "/var/lib/vnstat" + ]; + files = [ + "/etc/machine-id" + "/etc/NIXOS" + "/etc/ssh/ssh_host_ed25519_key" + "/etc/ssh/ssh_host_ed25519_key.pub" + "/etc/ssh/ssh_host_rsa_key" + "/etc/ssh/ssh_host_rsa_key.pub" + ]; + }; }; i18n = { diff --git a/configs/plasma.nix b/configs/plasma.nix index 674ce0d..8ac8d09 100644 --- a/configs/plasma.nix +++ b/configs/plasma.nix @@ -49,6 +49,7 @@ ktimetracker kdiff3 kdiskmark + maliit-keyboard ]; }; diff --git a/configs/user-gui.nix b/configs/user-gui.nix index fbc8436..271e2d5 100644 --- a/configs/user-gui.nix +++ b/configs/user-gui.nix @@ -32,11 +32,6 @@ ]; }; - # services = { - # gvfs.enable = true; - # mullvad-vpn.enable = true; - # }; - programs = { ssh = {startAgent = true;}; # dconf.enable = true; @@ -49,7 +44,6 @@ environment.systemPackages = with pkgs; [ czkawka # fslint before - grsync handbrake keepassxc nextcloud-client @@ -66,6 +60,8 @@ kitty lan-mouse_git + + libreoffice ]; home-manager.users.alex = {pkgs, ...}: { diff --git a/configs/virtualisation.nix b/configs/virtualization.nix similarity index 100% rename from configs/virtualisation.nix rename to configs/virtualization.nix diff --git a/flake.lock b/flake.lock index 5ada787..ab616d8 100644 --- a/flake.lock +++ b/flake.lock @@ -8,11 +8,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1732150710, - "narHash": "sha256-H6ps/jlPn3kkGtrZeduLtfMnV8htI117/qUgMtUzJBM=", + "lastModified": 1732400024, + "narHash": "sha256-uf1QzIl0Jj5dr7+erWjHWiCUEvywLaR7ir1jcqGgjeQ=", "owner": "chaotic-cx", "repo": "nyx", - "rev": "4621aec08aa50869a305e275c2b8a0c766f3b59b", + "rev": "376a2e022a5d8fa21cecb5bb0fef0cb54db5cdfc", "type": "github" }, "original": { @@ -82,11 +82,11 @@ ] }, "locked": { - "lastModified": 1732025103, - "narHash": "sha256-qjEI64RKvDxRyEarY0jTzrZMa8ebezh2DEZmJJrpVdo=", + "lastModified": 1732303962, + "narHash": "sha256-5Umjb5AdtxV5jSJd5jxoCckh5mlg+FBQDsyAilu637g=", "owner": "nix-community", "repo": "home-manager", - "rev": "a46e702093a5c46e192243edbd977d5749e7f294", + "rev": "8cf9cb2ee78aa129e5b8220135a511a2be254c0c", "type": "github" }, "original": { @@ -102,11 +102,11 @@ ] }, "locked": { - "lastModified": 1732303962, - "narHash": "sha256-5Umjb5AdtxV5jSJd5jxoCckh5mlg+FBQDsyAilu637g=", + "lastModified": 1732482255, + "narHash": "sha256-GUffLwzawz5WRVfWaWCg78n/HrBJrOG7QadFY6rtV8A=", "owner": "nix-community", "repo": "home-manager", - "rev": "8cf9cb2ee78aa129e5b8220135a511a2be254c0c", + "rev": "a9953635d7f34e7358d5189751110f87e3ac17da", "type": "github" }, "original": { @@ -161,11 +161,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1730468752, - "narHash": "sha256-PixWHyqvcwst38jnOunWe/WjwlZ5R327zR/C+e0slAA=", + "lastModified": 1732459504, + "narHash": "sha256-WSHxq6cZz/GWkEK8LeYR4PM5Wh/KsG+WTZklB4pHJSQ=", "owner": "taj-ny", "repo": "kwin-effects-forceblur", - "rev": "411567be19109495f9afe56a2ccf404be0599d86", + "rev": "669ba8729d5703823c2e9712e2d68abe57eb342e", "type": "github" }, "original": { @@ -199,11 +199,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1731797098, - "narHash": "sha256-UhWmEZhwJZmVZ1jfHZFzCg+ZLO9Tb/v3Y6LC0UNyeTo=", + "lastModified": 1732483221, + "narHash": "sha256-kF6rDeCshoCgmQz+7uiuPdREVFuzhIorGOoPXMalL2U=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "672ac2ac86f7dff2f6f3406405bddecf960e0db6", + "rev": "45348ad6fb8ac0e8415f6e5e96efe47dd7f39405", "type": "github" }, "original": { @@ -231,16 +231,16 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1732310578, - "narHash": "sha256-kk5Cv6wB20ujrB8w2ny5Co20xCHYOjUSyk2VRuP0sZw=", + "lastModified": 1732014248, + "narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=", "owner": "nixos", "repo": "nixpkgs", - "rev": "72f68849662579c8d4e5d13bd4d400723a1d8edd", + "rev": "23e89b7da85c3640bbc2173fe04f4bd114342367", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-unstable-small", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index ba463cd..4b390d2 100644 --- a/flake.nix +++ b/flake.nix @@ -3,7 +3,7 @@ inputs = { # nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05"; - nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable-small"; + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; nixos-hardware.url = "github:nixos/nixos-hardware/master"; chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; diff --git a/machine/desktop/configuration.nix b/machine/desktop/configuration.nix index 85b6276..b21f5b7 100644 --- a/machine/desktop/configuration.nix +++ b/machine/desktop/configuration.nix @@ -7,16 +7,6 @@ }: let be = import ../../configs/borg-exclude.nix; in { - nixpkgs = { - overlays = [ - outputs.overlays.additions - outputs.overlays.modifications - ]; - config = { - allowUnfree = true; - }; - }; - imports = [ ./hardware-configuration.nix ../../configs/browser.nix @@ -25,7 +15,7 @@ in { ../../configs/games.nix ../../configs/develop.nix ../../configs/hardware.nix - ../../configs/virtualisation.nix + ../../configs/virtualization.nix ../../configs/plasma.nix ../../configs/user-gui.nix ../../configs/user.nix @@ -75,19 +65,7 @@ in { # }; boot = { - loader = { - grub = { - enable = true; - efiSupport = true; - device = "nodev"; - configurationLimit = 5; - useOSProber = true; - }; - efi = {canTouchEfiVariables = true;}; - }; - tmp.useTmpfs = false; - supportedFilesystems = ["btrfs"]; kernelPackages = pkgs.linuxPackages_cachyos; kernelParams = ["clearcpuid=514" "ip=dhcp"]; kernelModules = ["nct6775"]; @@ -116,45 +94,6 @@ in { preLVM = true; }; }; - - postDeviceCommands = pkgs.lib.mkBefore '' - mkdir -p /mnt - - # We first mount the btrfs root to /mnt - # so we can manipulate btrfs subvolumes. - mount -o subvol=/ /dev/mapper/lvm-root /mnt - - # While we're tempted to just delete /root and create - # a new snapshot from /root-blank, /root is already - # populated at this point with a number of subvolumes, - # which makes `btrfs subvolume delete` fail. - # So, we remove them first. - # - # /root contains subvolumes: - # - /root/var/lib/portables - # - /root/var/lib/machines - # - # I suspect these are related to systemd-nspawn, but - # since I don't use it I'm not 100% sure. - # Anyhow, deleting these subvolumes hasn't resulted - # in any issues so far, except for fairly - # benign-looking errors from systemd-tmpfiles. - btrfs subvolume list -o /mnt/root | - cut -f9 -d' ' | - while read subvolume; do - echo "deleting /$subvolume subvolume..." - btrfs subvolume delete "/mnt/$subvolume" - done && - echo "deleting /root subvolume..." && - btrfs subvolume delete /mnt/root - - echo "restoring blank /root subvolume..." - btrfs subvolume snapshot /mnt/root-blank /mnt/root - - # Once we're done rolling back to a blank snapshot, - # we can unmount /mnt and continue on the boot process. - umount /mnt - ''; }; }; @@ -205,21 +144,9 @@ in { "/etc/NetworkManager/system-connections" "/var/lib/bluetooth" "/var/lib/docker" - "/var/lib/nixos" "/var/lib/samba" "/var/lib/sddm" "/var/lib/systemd/rfkill" - "/var/lib/tailscale" - "/var/lib/tuptime" - "/var/lib/vnstat" - ]; - files = [ - # "/etc/machine-id" - "/etc/NIXOS" - "/etc/ssh/ssh_host_ed25519_key" - "/etc/ssh/ssh_host_ed25519_key.pub" - "/etc/ssh/ssh_host_rsa_key" - "/etc/ssh/ssh_host_rsa_key.pub" ]; }; }; diff --git a/machine/framework/configuration.nix b/machine/framework/configuration.nix index e95c87f..7602503 100644 --- a/machine/framework/configuration.nix +++ b/machine/framework/configuration.nix @@ -8,26 +8,13 @@ }: let be = import ../../configs/borg-exclude.nix; in { - nixpkgs = { - overlays = [ - outputs.overlays.additions - ]; - config = { - allowUnfree = true; - # packageOverrides = pkgs: { - # intel-vaapi-driver = - # pkgs.intel-vaapi-driver.override { enableHybridCodec = true; }; - # }; - }; - }; - imports = [ ./hardware-configuration.nix ../../configs/browser.nix ../../configs/common.nix ../../configs/docker.nix ../../configs/games.nix - ../../configs/virtualisation.nix + ../../configs/virtualization.nix ../../configs/plasma.nix ../../configs/user-gui.nix ../../configs/user.nix @@ -70,19 +57,7 @@ in { # }; boot = { - loader = { - grub = { - enable = true; - efiSupport = true; - device = "nodev"; - configurationLimit = 5; - # enableCryptodisk = true; - }; - efi = {canTouchEfiVariables = true;}; - }; - tmp.useTmpfs = false; - supportedFilesystems = ["btrfs"]; kernelPackages = pkgs.linuxPackages_6_11; initrd = { @@ -93,45 +68,6 @@ in { preLVM = true; }; }; - - postDeviceCommands = pkgs.lib.mkBefore '' - mkdir -p /mnt - - # We first mount the btrfs root to /mnt - # so we can manipulate btrfs subvolumes. - mount -o subvol=/ /dev/mapper/lvm-root /mnt - - # While we're tempted to just delete /root and create - # a new snapshot from /root-blank, /root is already - # populated at this point with a number of subvolumes, - # which makes `btrfs subvolume delete` fail. - # So, we remove them first. - # - # /root contains subvolumes: - # - /root/var/lib/portables - # - /root/var/lib/machines - # - # I suspect these are related to systemd-nspawn, but - # since I don't use it I'm not 100% sure. - # Anyhow, deleting these subvolumes hasn't resulted - # in any issues so far, except for fairly - # benign-looking errors from systemd-tmpfiles. - btrfs subvolume list -o /mnt/root | - cut -f9 -d' ' | - while read subvolume; do - echo "deleting /$subvolume subvolume..." - btrfs subvolume delete "/mnt/$subvolume" - done && - echo "deleting /root subvolume..." && - btrfs subvolume delete /mnt/root - - echo "restoring blank /root subvolume..." - btrfs subvolume snapshot /mnt/root-blank /mnt/root - - # Once we're done rolling back to a blank snapshot, - # we can unmount /mnt and continue on the boot process. - umount /mnt - ''; }; }; @@ -225,7 +161,7 @@ in { borgbackup.jobs.home = rec { repo = "ssh://u278697-sub9@u278697.your-storagebox.de:23/./borg"; - + compression = "auto,zstd"; encryption = { mode = "repokey-blake2"; @@ -293,21 +229,8 @@ in { "/etc/NetworkManager/system-connections" # "/var/lib/bluetooth" "/var/lib/docker" - "/var/lib/nixos" # "/var/lib/samba" "/var/lib/sddm" - # "/var/lib/systemd/rfkill" - "/var/lib/tailscale" - "/var/lib/tuptime" - "/var/lib/vnstat" - ]; - files = [ - "/etc/machine-id" - "/etc/NIXOS" - "/etc/ssh/ssh_host_ed25519_key" - "/etc/ssh/ssh_host_ed25519_key.pub" - "/etc/ssh/ssh_host_rsa_key" - "/etc/ssh/ssh_host_rsa_key.pub" ]; }; }; diff --git a/machine/mini/configuration.nix b/machine/mini/configuration.nix index 4fa213d..12c9176 100644 --- a/machine/mini/configuration.nix +++ b/machine/mini/configuration.nix @@ -5,17 +5,6 @@ outputs, ... }: { - nixpkgs = { - overlays = [ - outputs.overlays.additions - outputs.overlays.modifications - outputs.overlays.unstable-packages - ]; - config = { - allowUnfree = true; - }; - }; - imports = [ ./hardware-configuration.nix ../../configs/docker.nix @@ -46,17 +35,6 @@ }; boot = { - loader = { - grub = { - enable = true; - device = "nodev"; - efiSupport = true; - configurationLimit = 5; - }; - - efi.canTouchEfiVariables = true; - }; - initrd = { availableKernelModules = ["r8169"]; systemd.users.root.shell = "/bin/cryptsetup-askpass"; @@ -79,50 +57,8 @@ preLVM = true; }; }; - - postDeviceCommands = pkgs.lib.mkBefore '' - mkdir -p /mnt - - # We first mount the btrfs root to /mnt - # so we can manipulate btrfs subvolumes. - mount -o subvol=/ /dev/mapper/lvm-root /mnt - - # While we're tempted to just delete /root and create - # a new snapshot from /root-blank, /root is already - # populated at this point with a number of subvolumes, - # which makes `btrfs subvolume delete` fail. - # So, we remove them first. - # - # /root contains subvolumes: - # - /root/var/lib/portables - # - /root/var/lib/machines - # - # I suspect these are related to systemd-nspawn, but - # since I don't use it I'm not 100% sure. - # Anyhow, deleting these subvolumes hasn't resulted - # in any issues so far, except for fairly - # benign-looking errors from systemd-tmpfiles. - btrfs subvolume list -o /mnt/root | - cut -f9 -d' ' | - while read subvolume; do - echo "deleting /$subvolume subvolume..." - btrfs subvolume delete "/mnt/$subvolume" - done && - echo "deleting /root subvolume..." && - btrfs subvolume delete /mnt/root - - echo "restoring blank /root subvolume..." - btrfs subvolume snapshot /mnt/root-blank /mnt/root - - # Once we're done rolling back to a blank snapshot, - # we can unmount /mnt and continue on the boot process. - umount /mnt - ''; }; - - supportedFilesystems = ["btrfs"]; kernelPackages = pkgs.linuxPackages_latest; - extraModulePackages = with pkgs.linuxPackages_latest; [rtl88x2bu]; }; @@ -175,19 +111,7 @@ persistence."/persist" = { directories = [ # "/var/lib/docker" - "/var/lib/nixos" "/var/lib/tor" - "/var/lib/tailscale" - "/var/lib/tuptime" - "/var/lib/vnstat" - ]; - files = [ - "/etc/machine-id" - "/etc/NIXOS" - "/etc/ssh/ssh_host_ed25519_key" - "/etc/ssh/ssh_host_ed25519_key.pub" - "/etc/ssh/ssh_host_rsa_key" - "/etc/ssh/ssh_host_rsa_key.pub" ]; }; }; diff --git a/machine/nixos-virtualbox/configuration.nix b/machine/nixos-virtualbox/configuration.nix index a9f5718..9550b6f 100644 --- a/machine/nixos-virtualbox/configuration.nix +++ b/machine/nixos-virtualbox/configuration.nix @@ -5,12 +5,6 @@ outputs, ... }: { - nixpkgs = { - config = { - allowUnfree = true; - }; - }; - imports = [ ./hardware-configuration.nix ../../configs/common.nix @@ -37,57 +31,9 @@ time.timeZone = "Europe/Berlin"; boot = { - loader = { - efi.canTouchEfiVariables = true; - grub = { - enable = true; - efiSupport = true; - device = "nodev"; - }; - }; - supportedFilesystems = ["btrfs"]; - initrd = { enable = true; supportedFilesystems = ["btrfs"]; - - postResumeCommands = lib.mkAfter '' - mkdir -p /mnt - # We first mount the btrfs root to /mnt - # so we can manipulate btrfs subvolumes. - mount -o subvol=/ /dev/vda3 /mnt - - # While we're tempted to just delete /root and create - # a new snapshot from /root-blank, /root is already - # populated at this point with a number of subvolumes, - # which makes `btrfs subvolume delete` fail. - # So, we remove them first. - # - # /root contains subvolumes: - # - /root/var/lib/portables - # - /root/var/lib/machines - # - # I suspect these are related to systemd-nspawn, but - # since I don't use it I'm not 100% sure. - # Anyhow, deleting these subvolumes hasn't resulted - # in any issues so far, except for fairly - # benign-looking errors from systemd-tmpfiles. - btrfs subvolume list -o /mnt/root | - cut -f9 -d' ' | - while read subvolume; do - echo "deleting /$subvolume subvolume..." - btrfs subvolume delete "/mnt/$subvolume" - done && - echo "deleting /root subvolume..." && - btrfs subvolume delete /mnt/root - - echo "restoring blank /root subvolume..." - btrfs subvolume snapshot /mnt/root-blank /mnt/root - - # Once we're done rolling back to a blank snapshot, - # we can unmount /mnt and continue on the boot process. - umount /mnt - ''; }; }; @@ -100,15 +46,6 @@ persistence."/persist" = { directories = [ "/var/lib/docker" - "/var/lib/nixos" - "/var/lib/tuptime" - "/var/lib/vnstat" - ]; - files = [ - "/etc/ssh/ssh_host_ed25519_key" - "/etc/ssh/ssh_host_ed25519_key.pub" - "/etc/ssh/ssh_host_rsa_key" - "/etc/ssh/ssh_host_rsa_key.pub" ]; }; }; diff --git a/machine/vps-arm/configuration.nix b/machine/vps-arm/configuration.nix index eacdee3..d04c7cb 100644 --- a/machine/vps-arm/configuration.nix +++ b/machine/vps-arm/configuration.nix @@ -9,17 +9,6 @@ secrets = import ../../configs/secrets.nix; be = import ../../configs/borg-exclude.nix; in { - nixpkgs = { - overlays = [ - outputs.overlays.additions - outputs.overlays.modifications - outputs.overlays.unstable-packages - ]; - config = { - allowUnfree = true; - }; - }; - imports = [ ./hardware-configuration.nix ../../configs/common.nix @@ -80,18 +69,7 @@ in { }; boot = { - loader = { - efi.canTouchEfiVariables = true; - grub = { - enable = true; - device = "nodev"; - efiSupport = true; - enableCryptodisk = true; - }; - }; - kernelPackages = pkgs.linuxPackages_latest; - supportedFilesystems = ["btrfs"]; kernelParams = ["ip=dhcp"]; initrd = { availableKernelModules = ["virtio-pci"]; @@ -115,45 +93,6 @@ in { preLVM = true; }; }; - - postDeviceCommands = pkgs.lib.mkBefore '' - mkdir -p /mnt - - # We first mount the btrfs root to /mnt - # so we can manipulate btrfs subvolumes. - mount -o subvol=/ /dev/mapper/lvm-root /mnt - - # While we're tempted to just delete /root and create - # a new snapshot from /root-blank, /root is already - # populated at this point with a number of subvolumes, - # which makes `btrfs subvolume delete` fail. - # So, we remove them first. - # - # /root contains subvolumes: - # - /root/var/lib/portables - # - /root/var/lib/machines - # - # I suspect these are related to systemd-nspawn, but - # since I don't use it I'm not 100% sure. - # Anyhow, deleting these subvolumes hasn't resulted - # in any issues so far, except for fairly - # benign-looking errors from systemd-tmpfiles. - btrfs subvolume list -o /mnt/root | - cut -f9 -d' ' | - while read subvolume; do - echo "deleting /$subvolume subvolume..." - btrfs subvolume delete "/mnt/$subvolume" - done && - echo "deleting /root subvolume..." && - btrfs subvolume delete /mnt/root - - echo "restoring blank /root subvolume..." - btrfs subvolume snapshot /mnt/root-blank /mnt/root - - # Once we're done rolling back to a blank snapshot, - # we can unmount /mnt and continue on the boot process. - umount /mnt - ''; }; }; @@ -210,23 +149,11 @@ in { "/var/lib/gitea" "/var/lib/headscale" "/var/lib/nextcloud" - "/var/lib/nixos" "/var/lib/postgresql" "/var/lib/private" "/var/lib/redis-nextcloud" - "/var/lib/tailscale" - "/var/lib/tuptime" - "/var/lib/vnstat" "/var/www" ]; - files = [ - "/etc/machine-id" - "/etc/NIXOS" - "/etc/ssh/ssh_host_ed25519_key" - "/etc/ssh/ssh_host_ed25519_key.pub" - "/etc/ssh/ssh_host_rsa_key" - "/etc/ssh/ssh_host_rsa_key.pub" - ]; }; };