Grant machine configs access to the pkgs attribute

This commit is contained in:
Manuel Thalmann 2024-05-07 21:59:58 +02:00
parent a4cedd467f
commit bdea1aa785

View file

@ -44,32 +44,34 @@
) // { ) // {
nixosConfigurations = nixosConfigurations =
let let
default = { default = { pkgs, ... }: {
dualBoot = false; dualBoot = false;
timeZone = null; timeZone = null;
keyMap = "us"; keyMap = "us";
keyboardLayout = "us"; keyboardLayout = "us";
localeSettings = { }; localeSettings = { };
}; };
systems = [ systems = {
{ nixos.config = { ... }: {
name = "nixos"; };
} };
];
in in
builtins.listToAttrs ( builtins.mapAttrs (
builtins.map ( name: { system ? "x86_64-linux", config }: nixpkgs.lib.nixosSystem {
{ name, system ? "x86_64-linux", ... }@config: {
inherit name;
value = nixpkgs.lib.nixosSystem {
inherit system; inherit system;
modules = [ modules = [
({ ... }: { config._module.args = { machineConfig = default // config; }; }) (
{ pkgs, ... }@args: {
config._module.args = {
machineConfig = (default args) //
(config args) // {
inherit name;
};
};
})
sops-nix.nixosModules.sops sops-nix.nixosModules.sops
./lib/configuration.nix ./lib/configuration.nix
( (
let let
configCandidate = ./lib/machines/${name}.nix; configCandidate = ./lib/machines/${name}.nix;
@ -83,8 +85,7 @@
in in
machineConfigPath) machineConfigPath)
]; ];
};
}) })
systems); systems;
}); });
} }