Pass machine info in a new variable

This commit is contained in:
Manuel Thalmann 2024-05-11 19:40:01 +02:00
parent 8cd848dcf5
commit 54807aa9e2

View file

@ -81,7 +81,7 @@
) // { ) // {
nixosConfigurations = nixosConfigurations =
builtins.mapAttrs ( builtins.mapAttrs (
hostname: { system, config }: nixpkgs.lib.nixosSystem { hostname: { system, config }@machine: nixpkgs.lib.nixosSystem {
inherit system; inherit system;
modules = [ modules = [
@ -90,6 +90,11 @@
config._module.args = { config._module.args = {
inherit hostname; inherit hostname;
machineInfo = machine // {
name = hostname;
config = (pkgs.callPackage config { });
};
machineConfig = (pkgs.callPackage config { }) // { machineConfig = (pkgs.callPackage config { }) // {
inherit hostname; inherit hostname;
}; };
@ -127,6 +132,11 @@
( (
{ pkgs, ... }: { { pkgs, ... }: {
config._module.args = { config._module.args = {
machineInfo = machine // {
name = hostname;
config = machineConfig;
};
inherit inherit
machineConfig machineConfig
hostname hostname