Files
nixos/hosts/stationette/hardware-configuration.nix

72 lines
2.3 KiB
Nix
Raw Normal View History

2026-02-22 19:54:17 +00:00
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
2026-02-27 00:51:33 +00:00
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-partlabel/disk-stationette-root";
fsType = "btrfs";
options = [ "subvol=root" ];
};
boot.initrd.postDeviceCommands = lib.mkAfter ''
mkdir /btrfs_tmp
2026-02-28 14:31:09 +00:00
mount /dev/disk/by-partlabel/disk-stationette-root /btrfs_tmp
2026-02-27 00:51:33 +00:00
if [[ -e /btrfs_tmp/root ]]; then
mkdir -p /btrfs_tmp/old_roots
2026-02-28 15:39:36 +00:00
timestamp=$(date +%Y-%m-%d_%H-%M-%S)
2026-02-27 00:51:33 +00:00
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"
}
2026-02-28 15:39:36 +00:00
for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +7); do
2026-02-27 00:51:33 +00:00
delete_subvolume_recursively "$i"
done
btrfs subvolume create /btrfs_tmp/root
umount /btrfs_tmp
'';
fileSystems."/persist" = {
device = "/dev/disk/by-partlabel/disk-stationette-root";
neededForBoot = true;
fsType = "btrfs";
options = [ "subvol=persist" ];
};
fileSystems."/nix" = {
device = "/dev/disk/by-partlabel/disk-stationette-root";
neededForBoot = true;
fsType = "btrfs";
options = [ "subvol=nix" ];
2026-02-22 19:54:17 +00:00
};
2026-02-27 00:51:33 +00:00
fileSystems."/boot" = {
device = "/dev/disk/by-partlabel/disk-stationette-ESP";
fsType = "vfat";
2026-02-27 01:03:11 +00:00
options = [ "fmask=0022" "dmask=0022" "umask=0077" ];
2026-02-22 19:54:17 +00:00
};
2026-03-09 20:27:18 +00:00
swapDevices = [ {
device = "/.swapvol/swapfile";
} ];
2026-02-22 19:54:17 +00:00
2026-02-27 00:51:33 +00:00
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
2026-02-22 19:54:17 +00:00
}