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