treewide: depot.reflection -> config.reflection

This commit is contained in:
Max Headroom 2024-07-16 14:06:08 +02:00
parent 7422adb13a
commit f39a48c425
17 changed files with 26 additions and 26 deletions

View file

@ -1,4 +1,4 @@
{ config, depot, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
cid = "c-f32aebf5"; cid = "c-f32aebf5";
@ -28,7 +28,7 @@ in
{ {
links.${cid} = { links.${cid} = {
protocol = "http"; protocol = "http";
ipv4 = depot.reflection.interfaces.primary.addrPublic; ipv4 = config.reflection.interfaces.primary.addrPublic;
}; };
users.users.${cid} = { users.users.${cid} = {

View file

@ -1,10 +1,10 @@
{ depot, lib, ... }: { config, depot, lib, ... }:
let let
inherit (depot.lib.meta) domain; inherit (depot.lib.meta) domain;
frontendDomain = "consul-remote.internal.${domain}"; frontendDomain = "consul-remote.internal.${domain}";
inherit (depot.reflection.interfaces.vstub) addr; inherit (config.reflection.interfaces.vstub) addr;
in in
{ {

View file

@ -1,7 +1,7 @@
{ cluster, config, depot, lib, pkgs, ... }: { cluster, config, depot, lib, pkgs, ... }:
let let
inherit (depot.reflection) interfaces; inherit (config.reflection) interfaces;
inherit (depot.lib.meta) domain; inherit (depot.lib.meta) domain;
inherit (config.networking) hostName; inherit (config.networking) hostName;

View file

@ -1,7 +1,7 @@
{ cluster, config, depot, lib, ... }: { cluster, config, depot, lib, ... }:
let let
inherit (depot.reflection) interfaces hyprspace; inherit (config.reflection) interfaces;
inherit (depot.lib.meta) domain; inherit (depot.lib.meta) domain;
inherit (config.networking) hostName; inherit (config.networking) hostName;

View file

@ -1,8 +1,8 @@
{ config, depot, lib, ... }: { config, depot, lib, ... }:
{ {
hostLinks = lib.genAttrs config.services.ipfs.nodes.node (name: depot.lib.summon name ({ depot, ... }: let hostLinks = lib.genAttrs config.services.ipfs.nodes.node (name: let
host = depot.reflection; host = depot.hours.${name};
intf = host.interfaces.primary; intf = host.interfaces.primary;
self = config.hostLinks.${name}.ipfs; self = config.hostLinks.${name}.ipfs;
in { in {
@ -20,7 +20,7 @@
]; ];
}; };
}; };
})); });
services.ipfs = { services.ipfs = {
nodes = { nodes = {
node = [ "VEGAS" "prophet" ]; node = [ "VEGAS" "prophet" ];

View file

@ -2,7 +2,7 @@
let let
inherit (config) links; inherit (config) links;
inherit (depot.reflection) interfaces; inherit (config.reflection) interfaces;
in in
{ {
links = { links = {

View file

@ -1,4 +1,4 @@
{ cluster, config, depot, lib, pkgs, ... }: { cluster, config, lib, pkgs, ... }:
let let
externalWays = lib.filterAttrs (_: cfg: !cfg.internal) cluster.config.ways; externalWays = lib.filterAttrs (_: cfg: !cfg.internal) cluster.config.ways;
@ -91,7 +91,7 @@ in
mode = "external"; mode = "external";
definition = { definition = {
name = "ways-proxy"; name = "ways-proxy";
address = depot.reflection.interfaces.primary.addrPublic; address = config.reflection.interfaces.primary.addrPublic;
port = 443; port = 443;
checks = lib.singleton { checks = lib.singleton {
interval = "60s"; interval = "60s";

View file

@ -33,7 +33,7 @@ in
mode = "external"; mode = "external";
definition = { definition = {
name = "static-lb"; name = "static-lb";
address = depot.reflection.interfaces.primary.addrPublic; address = config.reflection.interfaces.primary.addrPublic;
port = 443; port = 443;
checks = lib.singleton { checks = lib.singleton {
interval = "60s"; interval = "60s";

View file

@ -1,6 +1,6 @@
{ depot, ... }: { config, ... }:
let let
inherit (depot.reflection) interfaces; inherit (config.reflection) interfaces;
in in
{ {
imports = [ imports = [

View file

@ -10,7 +10,7 @@ let
lmtpSocket = "lmtp:unix:/run/dovecot2/lmtp"; lmtpSocket = "lmtp:unix:/run/dovecot2/lmtp";
postfixLdapMailboxes = "ldap:${config.age.secrets."postfix-ldap-mailboxes.cf".path}"; postfixLdapMailboxes = "ldap:${config.age.secrets."postfix-ldap-mailboxes.cf".path}";
inherit (depot.reflection) interfaces; inherit (config.reflection) interfaces;
in in
{ {
age.secrets."postfix-ldap-mailboxes.cf" = { age.secrets."postfix-ldap-mailboxes.cf" = {

View file

@ -77,7 +77,7 @@
"fe80::/10" "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; rules4 = mkRules "iptables" privateIp4Ranges;

View file

@ -1,7 +1,7 @@
{ depot, ... }: { config, depot, ... }:
let let
inherit (depot.reflection.interfaces) primary; inherit (config.reflection.interfaces) primary;
in in
{ {

View file

@ -1,7 +1,7 @@
{ config, depot, lib, ... }: { config, depot, lib, ... }:
let let
orgDomain = depot.lib.meta.domain; orgDomain = depot.lib.meta.domain;
host = depot.reflection; host = config.reflection;
in { in {
networking.domain = lib.mkDefault "${host.enterprise.subdomain or "services"}.${orgDomain}"; networking.domain = lib.mkDefault "${host.enterprise.subdomain or "services"}.${orgDomain}";
networking.search = [ config.networking.domain "search.${orgDomain}" ]; networking.search = [ config.networking.domain "search.${orgDomain}" ];

View file

@ -1,4 +1,4 @@
{ config, depot, ... }: { config, ... }:
{ {
services.fail2ban = { services.fail2ban = {
enable = true; enable = true;
@ -6,7 +6,7 @@
jails.sshd.settings.mode = "aggressive"; jails.sshd.settings.mode = "aggressive";
ignoreIP = [ ignoreIP = [
"10.0.0.0/8" "10.0.0.0/8"
depot.reflection.interfaces.primary.addr config.reflection.interfaces.primary.addr
]; ];
bantime-increment = { bantime-increment = {
enable = true; enable = true;

View file

@ -9,7 +9,7 @@ let
}) hyprspaceCapableNodes; }) hyprspaceCapableNodes;
peersFiltered = lib.filterAttrs (name: _: name != hostName) peersFormatted; peersFiltered = lib.filterAttrs (name: _: name != hostName) peersFormatted;
peerList = builtins.attrValues peersFiltered; peerList = builtins.attrValues peersFiltered;
myNode = depot.reflection; myNode = config.reflection;
listenPort = myNode.hyprspace.listenPort or 8001; listenPort = myNode.hyprspace.listenPort or 8001;
privateKeyFile = config.age.secrets.hyprspace-key.path; privateKeyFile = config.age.secrets.hyprspace-key.path;

View file

@ -1,6 +1,6 @@
{ depot, lib, ... }: { config, lib, ... }:
let let
inherit (depot.reflection) interfaces; inherit (config.reflection) interfaces;
in in
{ {
networking.interfaces = lib.mkIf (interfaces ? vstub) { networking.interfaces = lib.mkIf (interfaces ? vstub) {

View file

@ -1,6 +1,6 @@
let let
max = (import ./users/max/userinfo.nix null).sshKeys; 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; (builtins.getFlake "git+file://${builtins.getEnv "PWD"}").nixosConfigurations;
systemKeys = x: x.ssh.id.publicKey or null; systemKeys = x: x.ssh.id.publicKey or null;
in with hosts; in with hosts;