From ae3fa667bda75f11881c9209dc67226f98bcfd95 Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Thu, 17 Sep 2026 11:05:45 +0200 Subject: 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. --- hosts/template/configuration.nix | 23 +++++++++++++++++++++++ hosts/template/hardware-configuration.nix | 26 ++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 hosts/template/configuration.nix create mode 100644 hosts/template/hardware-configuration.nix (limited to 'hosts') 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 @@ +# Copy-source only — this directory is never wired into flake.nix as a real +# nixosConfigurations output. To bootstrap a real host: +# cp -r hosts/template hosts/ +# then edit the CHANGEME values below and replace hardware-configuration.nix +# with the output of `nixos-generate-config`. See README.md for the full flow. +{ ... }: +{ + imports = [ ./hardware-configuration.nix ]; + + networking.hostName = "CHANGEME"; + + # UEFI (most modern machines): + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + # BIOS/legacy alternative — comment out the two lines above and use instead: + # boot.loader.grub.enable = true; + # boot.loader.grub.device = "/dev/sdX"; + + # Set to the NixOS release in use by the installer at install time + # (e.g. "24.05"). This only affects on-disk state format compatibility — + # never change it after the fact. + system.stateVersion = "CHANGEME"; +} 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 @@ +# Placeholder. Replace this entire file with the real output of: +# nixos-generate-config --root /mnt +# run against the target machine after partitioning and mounting it. +# The commented example below shows the shape of a real generated file — +# do not uncomment and use these values as-is, they describe no real disk. +{ modulesPath, ... }: +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + # boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ]; + # boot.initrd.kernelModules = [ ]; + # boot.kernelModules = [ ]; + # boot.extraModulePackages = [ ]; + # + # fileSystems."/" = { + # device = "/dev/disk/by-uuid/CHANGEME"; + # fsType = "ext4"; + # }; + # + # fileSystems."/boot" = { + # device = "/dev/disk/by-uuid/CHANGEME"; + # fsType = "vfat"; + # }; + # + # swapDevices = [ ]; +} -- cgit v1.3