diff options
| author | Raghuram Subramani <raghus2247@gmail.com> | 2024-10-10 10:03:42 +0530 | 
|---|---|---|
| committer | Raghuram Subramani <raghus2247@gmail.com> | 2024-10-10 10:03:42 +0530 | 
| commit | acd2d93ad81ffad72c067e0cbf90bee809276951 (patch) | |
| tree | 9d2e7564a153d485a7bf4dbe9c84de18573e41a5 /machines/x/configuration.nix | |
| parent | 5587dc4f07576e73a7fabcb527c108d00752cbe7 (diff) | |
(impermanence): Modularize config.
Diffstat (limited to 'machines/x/configuration.nix')
| -rw-r--r-- | machines/x/configuration.nix | 55 | 
1 files changed, 8 insertions, 47 deletions
| diff --git a/machines/x/configuration.nix b/machines/x/configuration.nix index 64da9ac..19305a1 100644 --- a/machines/x/configuration.nix +++ b/machines/x/configuration.nix @@ -1,11 +1,17 @@  { lib, inputs, pkgs, ... }: -{ +let +  drive = "/dev/nvme0n1"; +in {    imports = [      ./hardware-configuration.nix      inputs.home-manager.nixosModules.default + +    (import ../../disko.nix { device = drive; }) +    ] ++ (map (path: ../../modules/${path}) [      "core/global.nix" +    "core/impermanence.nix"      "amdgpu.nix"      "amd.nix" @@ -33,57 +39,12 @@      grub = {        enable = true;        efiSupport = true; -      device = "/dev/nvme0n1"; +      device = drive;      };    }; -  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' -        for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do -            delete_subvolume_recursively "/btrfs_tmp/$i" -        done -        btrfs subvolume delete "$1" -    } - -    for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do -        delete_subvolume_recursively "$i" -    done - -    btrfs subvolume create /btrfs_tmp/root -    umount /btrfs_tmp -  ''; - -  fileSystems."/persist".neededForBoot = true; -  environment.persistence."/persist/system" = { -    hideMounts = true; -    directories = [ -      "/etc/nixos" -      "/var/log" -      "/var/lib/bluetooth" -      "/var/lib/nixos" -      "/var/lib/systemd/coredump" -      "/etc/NetworkManager/system-connections" -    ]; -    files = [ -      "/etc/machine-id" -      { file = "/var/keys/secret_file"; parentDirectory = { mode = "u=rwx,g=,o="; }; } -    ]; -  }; -    boot.extraModprobeConfig = "options kvm_amd nested=1"; -  nixpkgs.config.allowUnfree = true; -  nixpkgs.config.allowUnfreePredicate = _: true; -    services.fstrim.enable = true;    networking.hostName = "x"; | 
