diff options
| Commit | dbd413e482d6ec53836232ae89bb57f808609635 (patch) | |
|---|---|---|
| Author | 2023-11-28 11:18:58 +0200 | |
| Committer | 2023-11-28 11:18:58 +0200 | |
| Files | 7be2e3bd551cf9d9c391e8aced216963ee9ef4b2 | |
| nix-dbd413e482d6ec53836232ae89bb57f808609635.tar nix-dbd413e482d6ec53836232ae89bb57f808609635.tar.gz nix-dbd413e482d6ec53836232ae89bb57f808609635.zip | ||
| Parent | 27277358421716b56c477d92c7d74fc435293cf6 (diff) | |
(autoconfig) Initial implementation
3 files changed, 26 insertions, 8 deletions
| -rw-r--r-- | autoconfig.nix | 20 | ||||
| -rw-r--r-- | flake.nix | 13 | ||||
| -rw-r--r-- | machines/juno/sysidentity.nix | 1 |
diff --git a/autoconfig.nix b/autoconfig.nix new file mode 100644 index 0000000..5460362 --- /dev/null +++ b/autoconfig.nix @@ -0,0 +1,20 @@ +{ inputs, ... }: +let + inherit (inputs) nixpkgs; + inherit (nixpkgs) lib; +in { + configurations = + lib.mapAttrs + (dir: _: + let + inherit (import ./machines/${dir}/sysidentity.nix) sysidentity; + in lib.nixosSystem { + system = sysidentity.arch; + modules = [ + ./machines/${dir}/hardware-configuration.nix + ./configuration.nix + ]; + } + ) + (lib.filterAttrs (_: type: type == "directory") (builtins.readDir ./machines)); +} @@ -5,14 +5,11 @@ nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; }; - outputs = { self, nixpkgs, ... }: { + outputs = { self, nixpkgs, ... }@inputs: + let + autoconfig = import ./autoconfig.nix { inherit inputs; }; + in { # ThinkPad X270 - nixosConfigurations.juno = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ./machines/juno/hardware-configuration.nix - ./configuration.nix - ]; - }; + nixosConfigurations = autoconfig.configurations; }; } diff --git a/machines/juno/sysidentity.nix b/machines/juno/sysidentity.nix index 1bc6575..88a4e1c 100644 --- a/machines/juno/sysidentity.nix +++ b/machines/juno/sysidentity.nix @@ -2,5 +2,6 @@ sysidentity = { name = "juno"; type = "laptop"; + arch = "x86_64-linux"; }; } |
