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 =
|
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
|
||||||
|
|
Loading…
Reference in a new issue