diff options
| author | 2026-09-17 11:05:45 +0200 | |
|---|---|---|
| committer | 2026-09-17 11:05:45 +0200 | |
| commit | ae3fa667bda75f11881c9209dc67226f98bcfd95 (patch) | |
| tree | 1c2b16d8a97342fa608a15583ecc85ff0ec968eb /hosts | |
| download | desktop-flake-ae3fa667bda75f11881c9209dc67226f98bcfd95.tar.gz desktop-flake-ae3fa667bda75f11881c9209dc67226f98bcfd95.tar.bz2 desktop-flake-ae3fa667bda75f11881c9209dc67226f98bcfd95.zip | |
Add cross-platform Nix flake bootstrap
Adds a flake providing shared modules for NixOS and standalone
home-manager, a copyable NixOS host template, and the OpenSpec
tooling/change scaffolding used to plan this work.
Diffstat (limited to 'hosts')
| -rw-r--r-- | hosts/template/configuration.nix | 23 | ||||
| -rw-r--r-- | hosts/template/hardware-configuration.nix | 26 |
2 files changed, 49 insertions, 0 deletions
diff --git a/hosts/template/configuration.nix b/hosts/template/configuration.nix new file mode 100644 index 0000000..192ccb5 --- /dev/null +++ b/hosts/template/configuration.nix | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | # Copy-source only — this directory is never wired into flake.nix as a real | ||
| 2 | # nixosConfigurations output. To bootstrap a real host: | ||
| 3 | # cp -r hosts/template hosts/<real-hostname> | ||
| 4 | # then edit the CHANGEME values below and replace hardware-configuration.nix | ||
| 5 | # with the output of `nixos-generate-config`. See README.md for the full flow. | ||
| 6 | { ... }: | ||
| 7 | { | ||
| 8 | imports = [ ./hardware-configuration.nix ]; | ||
| 9 | |||
| 10 | networking.hostName = "CHANGEME"; | ||
| 11 | |||
| 12 | # UEFI (most modern machines): | ||
| 13 | boot.loader.systemd-boot.enable = true; | ||
| 14 | boot.loader.efi.canTouchEfiVariables = true; | ||
| 15 | # BIOS/legacy alternative — comment out the two lines above and use instead: | ||
| 16 | # boot.loader.grub.enable = true; | ||
| 17 | # boot.loader.grub.device = "/dev/sdX"; | ||
| 18 | |||
| 19 | # Set to the NixOS release in use by the installer at install time | ||
| 20 | # (e.g. "24.05"). This only affects on-disk state format compatibility — | ||
| 21 | # never change it after the fact. | ||
| 22 | system.stateVersion = "CHANGEME"; | ||
| 23 | } | ||
diff --git a/hosts/template/hardware-configuration.nix b/hosts/template/hardware-configuration.nix new file mode 100644 index 0000000..a074323 --- /dev/null +++ b/hosts/template/hardware-configuration.nix | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | # Placeholder. Replace this entire file with the real output of: | ||
| 2 | # nixos-generate-config --root /mnt | ||
| 3 | # run against the target machine after partitioning and mounting it. | ||
| 4 | # The commented example below shows the shape of a real generated file — | ||
| 5 | # do not uncomment and use these values as-is, they describe no real disk. | ||
| 6 | { modulesPath, ... }: | ||
| 7 | { | ||
| 8 | imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; | ||
| 9 | |||
| 10 | # boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ]; | ||
| 11 | # boot.initrd.kernelModules = [ ]; | ||
| 12 | # boot.kernelModules = [ ]; | ||
| 13 | # boot.extraModulePackages = [ ]; | ||
| 14 | # | ||
| 15 | # fileSystems."/" = { | ||
| 16 | # device = "/dev/disk/by-uuid/CHANGEME"; | ||
| 17 | # fsType = "ext4"; | ||
| 18 | # }; | ||
| 19 | # | ||
| 20 | # fileSystems."/boot" = { | ||
| 21 | # device = "/dev/disk/by-uuid/CHANGEME"; | ||
| 22 | # fsType = "vfat"; | ||
| 23 | # }; | ||
| 24 | # | ||
| 25 | # swapDevices = [ ]; | ||
| 26 | } | ||
