Pass machine info in a new variable
This commit is contained in:
parent
8cd848dcf5
commit
54807aa9e2
1 changed files with 11 additions and 1 deletions
12
flake.nix
12
flake.nix
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue