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. --- flake.nix | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 flake.nix (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..729ab7e --- /dev/null +++ b/flake.nix @@ -0,0 +1,48 @@ +{ + description = "Cross-platform Nix system configuration (NixOS + standalone home-manager)"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { self, nixpkgs, home-manager, ... }@inputs: + let + lib = import ./lib { inherit inputs; }; + + forAllSystems = nixpkgs.lib.genAttrs [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + in + { + # No real NixOS host exists yet. hosts/template/ is copy-source only and + # is deliberately not wired in here — see hosts/template/ and README.md. + nixosConfigurations = { }; + + homeConfigurations = { + "tom@linux" = lib.mkHome { + username = "tom"; + system = "x86_64-linux"; + }; + }; + + formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style); + + devShells = forAllSystems (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + default = pkgs.mkShell { + packages = [ pkgs.statix pkgs.deadnix pkgs.nixfmt-rfc-style ]; + }; + }); + }; +} -- cgit v1.3