mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-18 06:59:43 +02:00
refactor(vars,hosts): networking & k3s clusters
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
#############################################################
|
||||
let
|
||||
hostName = "ruby"; # Define your hostname.
|
||||
hostAddress = myvars.networking.hostAddress.${hostName};
|
||||
in {
|
||||
imports = mylib.scanPaths ./.;
|
||||
|
||||
@@ -35,12 +34,8 @@ in {
|
||||
networking = {
|
||||
inherit hostName;
|
||||
inherit (myvars.networking) defaultGateway nameservers;
|
||||
|
||||
inherit (myvars.networking.hostsInterface.${hostName}) interfaces;
|
||||
networkmanager.enable = false;
|
||||
interfaces.ens18 = {
|
||||
useDHCP = false;
|
||||
ipv4.addresses = [hostAddress];
|
||||
};
|
||||
};
|
||||
|
||||
# This value determines the NixOS release from which the default
|
||||
|
||||
@@ -55,8 +55,8 @@
|
||||
{
|
||||
# All my NixOS hosts.
|
||||
targets =
|
||||
map (host: "${host.address}:9100")
|
||||
(builtins.attrValues myvars.networking.hostAddress);
|
||||
map (addr: "${addr.ipv4}:9100")
|
||||
(builtins.attrValues myvars.networking.hostsAddr);
|
||||
labels.type = "node";
|
||||
}
|
||||
];
|
||||
@@ -70,7 +70,7 @@
|
||||
metrics_path = "/metrics";
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["${myvars.networking.hostAddress.aquamarine.address}:9153"];
|
||||
targets = ["${myvars.networking.hostsAddr.aquamarine.ipv4}:9153"];
|
||||
labels.type = "app";
|
||||
labels.app = "dnsmasq";
|
||||
}
|
||||
@@ -83,7 +83,7 @@
|
||||
metrics_path = "/metrics";
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["${myvars.networking.hostAddress.kana.address}:9153"];
|
||||
targets = ["${myvars.networking.hostsAddr.kana.ipv4}:9153"];
|
||||
labels.type = "app";
|
||||
labels.app = "v2ray";
|
||||
}
|
||||
@@ -96,7 +96,7 @@
|
||||
metrics_path = "/metrics";
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["${myvars.networking.hostAddress.kana.address}:10000"];
|
||||
targets = ["${myvars.networking.hostsAddr.kana.ipv4}:10000"];
|
||||
labels.type = "app";
|
||||
labels.app = "v2ray";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user