From f39a48c425550a4c2e4d2825b2e0e198a2682660 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 16 Jul 2024 14:06:08 +0200 Subject: [PATCH] treewide: depot.reflection -> config.reflection --- cluster/services/c-f32aebf5/host.nix | 4 ++-- cluster/services/consul/remote-api.nix | 4 ++-- cluster/services/dns/authoritative.nix | 2 +- cluster/services/dns/coredns.nix | 2 +- cluster/services/ipfs/default.nix | 6 +++--- cluster/services/meet/host.nix | 2 +- cluster/services/ways/host.nix | 4 ++-- cluster/services/websites/default.nix | 2 +- hosts/VEGAS/services/backbone-routing/default.nix | 4 ++-- hosts/VEGAS/services/mail/postfix.nix | 2 +- hosts/VEGAS/system.nix | 2 +- hosts/grail/system.nix | 4 ++-- modules/enterprise/default.nix | 2 +- modules/fail2ban/default.nix | 4 ++-- modules/hyprspace/default.nix | 2 +- modules/networking/default.nix | 4 ++-- secrets.nix | 2 +- 17 files changed, 26 insertions(+), 26 deletions(-) diff --git a/cluster/services/c-f32aebf5/host.nix b/cluster/services/c-f32aebf5/host.nix index 8b0c649..c1856e6 100644 --- a/cluster/services/c-f32aebf5/host.nix +++ b/cluster/services/c-f32aebf5/host.nix @@ -1,4 +1,4 @@ -{ config, depot, lib, pkgs, ... }: +{ config, lib, pkgs, ... }: let cid = "c-f32aebf5"; @@ -28,7 +28,7 @@ in { links.${cid} = { protocol = "http"; - ipv4 = depot.reflection.interfaces.primary.addrPublic; + ipv4 = config.reflection.interfaces.primary.addrPublic; }; users.users.${cid} = { diff --git a/cluster/services/consul/remote-api.nix b/cluster/services/consul/remote-api.nix index 301d357..a230e6c 100644 --- a/cluster/services/consul/remote-api.nix +++ b/cluster/services/consul/remote-api.nix @@ -1,10 +1,10 @@ -{ depot, lib, ... }: +{ config, depot, lib, ... }: let inherit (depot.lib.meta) domain; frontendDomain = "consul-remote.internal.${domain}"; - inherit (depot.reflection.interfaces.vstub) addr; + inherit (config.reflection.interfaces.vstub) addr; in { diff --git a/cluster/services/dns/authoritative.nix b/cluster/services/dns/authoritative.nix index 3113e50..5082224 100644 --- a/cluster/services/dns/authoritative.nix +++ b/cluster/services/dns/authoritative.nix @@ -1,7 +1,7 @@ { cluster, config, depot, lib, pkgs, ... }: let - inherit (depot.reflection) interfaces; + inherit (config.reflection) interfaces; inherit (depot.lib.meta) domain; inherit (config.networking) hostName; diff --git a/cluster/services/dns/coredns.nix b/cluster/services/dns/coredns.nix index d52cd8c..1b3e439 100644 --- a/cluster/services/dns/coredns.nix +++ b/cluster/services/dns/coredns.nix @@ -1,7 +1,7 @@ { cluster, config, depot, lib, ... }: let - inherit (depot.reflection) interfaces hyprspace; + inherit (config.reflection) interfaces; inherit (depot.lib.meta) domain; inherit (config.networking) hostName; diff --git a/cluster/services/ipfs/default.nix b/cluster/services/ipfs/default.nix index c58243f..1d7679a 100644 --- a/cluster/services/ipfs/default.nix +++ b/cluster/services/ipfs/default.nix @@ -1,8 +1,8 @@ { config, depot, lib, ... }: { - hostLinks = lib.genAttrs config.services.ipfs.nodes.node (name: depot.lib.summon name ({ depot, ... }: let - host = depot.reflection; + hostLinks = lib.genAttrs config.services.ipfs.nodes.node (name: let + host = depot.hours.${name}; intf = host.interfaces.primary; self = config.hostLinks.${name}.ipfs; in { @@ -20,7 +20,7 @@ ]; }; }; - })); + }); services.ipfs = { nodes = { node = [ "VEGAS" "prophet" ]; diff --git a/cluster/services/meet/host.nix b/cluster/services/meet/host.nix index d885531..43b95e9 100644 --- a/cluster/services/meet/host.nix +++ b/cluster/services/meet/host.nix @@ -2,7 +2,7 @@ let inherit (config) links; - inherit (depot.reflection) interfaces; + inherit (config.reflection) interfaces; in { links = { diff --git a/cluster/services/ways/host.nix b/cluster/services/ways/host.nix index 040f552..136b71f 100644 --- a/cluster/services/ways/host.nix +++ b/cluster/services/ways/host.nix @@ -1,4 +1,4 @@ -{ cluster, config, depot, lib, pkgs, ... }: +{ cluster, config, lib, pkgs, ... }: let externalWays = lib.filterAttrs (_: cfg: !cfg.internal) cluster.config.ways; @@ -91,7 +91,7 @@ in mode = "external"; definition = { name = "ways-proxy"; - address = depot.reflection.interfaces.primary.addrPublic; + address = config.reflection.interfaces.primary.addrPublic; port = 443; checks = lib.singleton { interval = "60s"; diff --git a/cluster/services/websites/default.nix b/cluster/services/websites/default.nix index 25fd33d..e93a1ee 100644 --- a/cluster/services/websites/default.nix +++ b/cluster/services/websites/default.nix @@ -33,7 +33,7 @@ in mode = "external"; definition = { name = "static-lb"; - address = depot.reflection.interfaces.primary.addrPublic; + address = config.reflection.interfaces.primary.addrPublic; port = 443; checks = lib.singleton { interval = "60s"; diff --git a/hosts/VEGAS/services/backbone-routing/default.nix b/hosts/VEGAS/services/backbone-routing/default.nix index 25bad4c..08b8ee2 100644 --- a/hosts/VEGAS/services/backbone-routing/default.nix +++ b/hosts/VEGAS/services/backbone-routing/default.nix @@ -1,6 +1,6 @@ -{ depot, ... }: +{ config, ... }: let - inherit (depot.reflection) interfaces; + inherit (config.reflection) interfaces; in { imports = [ diff --git a/hosts/VEGAS/services/mail/postfix.nix b/hosts/VEGAS/services/mail/postfix.nix index 077fe94..c605657 100644 --- a/hosts/VEGAS/services/mail/postfix.nix +++ b/hosts/VEGAS/services/mail/postfix.nix @@ -10,7 +10,7 @@ let lmtpSocket = "lmtp:unix:/run/dovecot2/lmtp"; postfixLdapMailboxes = "ldap:${config.age.secrets."postfix-ldap-mailboxes.cf".path}"; - inherit (depot.reflection) interfaces; + inherit (config.reflection) interfaces; in { age.secrets."postfix-ldap-mailboxes.cf" = { diff --git a/hosts/VEGAS/system.nix b/hosts/VEGAS/system.nix index acad720..487755c 100644 --- a/hosts/VEGAS/system.nix +++ b/hosts/VEGAS/system.nix @@ -77,7 +77,7 @@ "fe80::/10" ]; - mkRules = ipt: ranges: map (x: "${ipt} -I nixos-fw 1 -d ${x} -o ${depot.reflection.interfaces.primary.link} -j DROP") ranges; + mkRules = ipt: ranges: map (x: "${ipt} -I nixos-fw 1 -d ${x} -o ${config.reflection.interfaces.primary.link} -j DROP") ranges; rules4 = mkRules "iptables" privateIp4Ranges; diff --git a/hosts/grail/system.nix b/hosts/grail/system.nix index 16e40db..c40a3e2 100644 --- a/hosts/grail/system.nix +++ b/hosts/grail/system.nix @@ -1,7 +1,7 @@ -{ depot, ... }: +{ config, depot, ... }: let - inherit (depot.reflection.interfaces) primary; + inherit (config.reflection.interfaces) primary; in { diff --git a/modules/enterprise/default.nix b/modules/enterprise/default.nix index 52ff844..3ee149f 100644 --- a/modules/enterprise/default.nix +++ b/modules/enterprise/default.nix @@ -1,7 +1,7 @@ { config, depot, lib, ... }: let orgDomain = depot.lib.meta.domain; - host = depot.reflection; + host = config.reflection; in { networking.domain = lib.mkDefault "${host.enterprise.subdomain or "services"}.${orgDomain}"; networking.search = [ config.networking.domain "search.${orgDomain}" ]; diff --git a/modules/fail2ban/default.nix b/modules/fail2ban/default.nix index 22a3eaa..f554aae 100644 --- a/modules/fail2ban/default.nix +++ b/modules/fail2ban/default.nix @@ -1,4 +1,4 @@ -{ config, depot, ... }: +{ config, ... }: { services.fail2ban = { enable = true; @@ -6,7 +6,7 @@ jails.sshd.settings.mode = "aggressive"; ignoreIP = [ "10.0.0.0/8" - depot.reflection.interfaces.primary.addr + config.reflection.interfaces.primary.addr ]; bantime-increment = { enable = true; diff --git a/modules/hyprspace/default.nix b/modules/hyprspace/default.nix index 5869349..16556a5 100644 --- a/modules/hyprspace/default.nix +++ b/modules/hyprspace/default.nix @@ -9,7 +9,7 @@ let }) hyprspaceCapableNodes; peersFiltered = lib.filterAttrs (name: _: name != hostName) peersFormatted; peerList = builtins.attrValues peersFiltered; - myNode = depot.reflection; + myNode = config.reflection; listenPort = myNode.hyprspace.listenPort or 8001; privateKeyFile = config.age.secrets.hyprspace-key.path; diff --git a/modules/networking/default.nix b/modules/networking/default.nix index 0ae500f..e1f66e0 100644 --- a/modules/networking/default.nix +++ b/modules/networking/default.nix @@ -1,6 +1,6 @@ -{ depot, lib, ... }: +{ config, lib, ... }: let - inherit (depot.reflection) interfaces; + inherit (config.reflection) interfaces; in { networking.interfaces = lib.mkIf (interfaces ? vstub) { diff --git a/secrets.nix b/secrets.nix index 380b3a3..8dc3e9f 100644 --- a/secrets.nix +++ b/secrets.nix @@ -1,6 +1,6 @@ let max = (import ./users/max/userinfo.nix null).sshKeys; - hosts = builtins.mapAttrs (_: v: v._module.specialArgs.depot.reflection) + hosts = builtins.mapAttrs (_: v: v.config.reflection) (builtins.getFlake "git+file://${builtins.getEnv "PWD"}").nixosConfigurations; systemKeys = x: x.ssh.id.publicKey or null; in with hosts;