diff options
| author | 2026-09-17 11:05:45 +0200 | |
|---|---|---|
| committer | 2026-09-17 11:05:45 +0200 | |
| commit | ae3fa667bda75f11881c9209dc67226f98bcfd95 (patch) | |
| tree | 1c2b16d8a97342fa608a15583ecc85ff0ec968eb /flake.nix | |
| 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 'flake.nix')
| -rw-r--r-- | flake.nix | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..729ab7e --- /dev/null +++ b/flake.nix | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | { | ||
| 2 | description = "Cross-platform Nix system configuration (NixOS + standalone home-manager)"; | ||
| 3 | |||
| 4 | inputs = { | ||
| 5 | nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; | ||
| 6 | |||
| 7 | home-manager = { | ||
| 8 | url = "github:nix-community/home-manager"; | ||
| 9 | inputs.nixpkgs.follows = "nixpkgs"; | ||
| 10 | }; | ||
| 11 | }; | ||
| 12 | |||
| 13 | outputs = { self, nixpkgs, home-manager, ... }@inputs: | ||
| 14 | let | ||
| 15 | lib = import ./lib { inherit inputs; }; | ||
| 16 | |||
| 17 | forAllSystems = nixpkgs.lib.genAttrs [ | ||
| 18 | "x86_64-linux" | ||
| 19 | "aarch64-linux" | ||
| 20 | "x86_64-darwin" | ||
| 21 | "aarch64-darwin" | ||
| 22 | ]; | ||
| 23 | in | ||
| 24 | { | ||
| 25 | # No real NixOS host exists yet. hosts/template/ is copy-source only and | ||
| 26 | # is deliberately not wired in here — see hosts/template/ and README.md. | ||
| 27 | nixosConfigurations = { }; | ||
| 28 | |||
| 29 | homeConfigurations = { | ||
| 30 | "tom@linux" = lib.mkHome { | ||
| 31 | username = "tom"; | ||
| 32 | system = "x86_64-linux"; | ||
| 33 | }; | ||
| 34 | }; | ||
| 35 | |||
| 36 | formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style); | ||
| 37 | |||
| 38 | devShells = forAllSystems (system: | ||
| 39 | let | ||
| 40 | pkgs = nixpkgs.legacyPackages.${system}; | ||
| 41 | in | ||
| 42 | { | ||
| 43 | default = pkgs.mkShell { | ||
| 44 | packages = [ pkgs.statix pkgs.deadnix pkgs.nixfmt-rfc-style ]; | ||
| 45 | }; | ||
| 46 | }); | ||
| 47 | }; | ||
| 48 | } | ||
