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 {
|
||||
inherit system;
|
||||
modules = [ self.nixosModule ];
|
||||
extraModules = [ ({ ... }: {
|
||||
networking.hostName = name;
|
||||
}) ];
|
||||
specialArgs.hostName = name;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
{ config, lib, ... }:
|
||||
{ hostName, config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (config.networking) hostName;
|
||||
inherit (lib) optional;
|
||||
inherit (lib) optionals;
|
||||
|
||||
hostConfig = lib.config.site.hosts.${hostName};
|
||||
in {
|
||||
site = lib.config.site;
|
||||
|
||||
imports = [
|
||||
{ config = self.lib.config; }
|
||||
./defaults.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 = {
|
||||
|
@ -9,4 +9,6 @@
|
|||
environment.systemPackages = with pkgs; [
|
||||
vim tcpdump iputils mtr traceroute
|
||||
];
|
||||
|
||||
networking.hostName = hostName;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue