forked from zentralwerk/network
nix: fix infinite recursion by passing hostName as module arg
This commit is contained in:
parent
0a5ebd7f49
commit
c04ca49755
|
@ -16,9 +16,7 @@
|
||||||
nixpkgs.lib.nixosSystem {
|
nixpkgs.lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
modules = [ self.nixosModule ];
|
modules = [ self.nixosModule ];
|
||||||
extraModules = [ ({ ... }: {
|
specialArgs.hostName = name;
|
||||||
networking.hostName = name;
|
|
||||||
}) ];
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
{ config, lib, ... }:
|
{ hostName, config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (config.networking) hostName;
|
inherit (lib) optionals;
|
||||||
inherit (lib) optional;
|
|
||||||
|
|
||||||
hostConfig = lib.config.site.hosts.${hostName};
|
hostConfig = lib.config.site.hosts.${hostName};
|
||||||
in {
|
in {
|
||||||
|
site = lib.config.site;
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
{ config = self.lib.config; }
|
|
||||||
./defaults.nix
|
./defaults.nix
|
||||||
../lib/config/options.nix
|
../lib/config/options.nix
|
||||||
|
]
|
||||||
|
++ optionals (hostConfig.role == "server") [
|
||||||
|
#./lxc-containers.nix
|
||||||
|
]
|
||||||
|
++ optionals (hostConfig.role == "container") [
|
||||||
|
./container.nix
|
||||||
];
|
];
|
||||||
# ++ optional (hostConfig.role == "server") [
|
|
||||||
# #./lxc-containers.nix
|
|
||||||
# ]
|
|
||||||
# ++ optional (hostConfig.role == "container") [
|
|
||||||
# ./container.nix
|
|
||||||
# ];
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs, ... }:
|
{ hostName, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
nix = {
|
nix = {
|
||||||
|
@ -9,4 +9,6 @@
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
vim tcpdump iputils mtr traceroute
|
vim tcpdump iputils mtr traceroute
|
||||||
];
|
];
|
||||||
|
|
||||||
|
networking.hostName = hostName;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue