Allow creation of system-specific config files

This commit is contained in:
Manuel Thalmann 2023-12-01 12:51:55 +01:00
parent 1154275b70
commit 3d3da6a405
2 changed files with 21 additions and 13 deletions

View file

@ -7,7 +7,9 @@
outputs = { self, nixpkgs }: outputs = { self, nixpkgs }:
let let
system = import ./system.nix; system = import ./lib/system.nix {
inherit nixpkgs;
};
in { in {
nixosConfigurations.manu-surface = system "manu-surface" {}; nixosConfigurations.manu-surface = system "manu-surface" {};
}; };

View file

@ -1,12 +1,18 @@
{ nixpkgs }:
name : name :
{ dualBoot ? false } : { dualBoot ? false } :
nixpkgs.lib.nixosSystem { let
lib = nixpkgs.lib;
in
lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
(lib.optional (builtins.pathExists ../machines/${name}.nix) ../machines/${name}.nix)
(
{ config, pkgs, ... }: { { config, pkgs, ... }: {
imports = [ imports = [
../hardware-configuration.nix ../hardware-configuration.nix
]; ];
} })
]; ];
} }