mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-24 09:48:30 +02:00
feat: use mainGateway for idols-ai, rename defaultGateway to proxyGateway
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
{ lib }:
|
||||
rec {
|
||||
{lib}: rec {
|
||||
mainGateway = "192.168.5.1"; # main router
|
||||
mainGateway6 = "fe80::5"; # main router's link-local address
|
||||
# use suzi as the default gateway
|
||||
# it's a subrouter with a transparent proxy
|
||||
defaultGateway = "192.168.5.178";
|
||||
defaultGateway6 = "fe80::8";
|
||||
proxyGateway = "192.168.5.178";
|
||||
proxyGateway6 = "fe80::8";
|
||||
nameservers = [
|
||||
# IPv4
|
||||
"119.29.29.29" # DNSPod
|
||||
@@ -152,17 +151,19 @@ rec {
|
||||
};
|
||||
};
|
||||
|
||||
hostsInterface = lib.attrsets.mapAttrs (key: val: {
|
||||
interfaces."${val.iface}" = {
|
||||
useDHCP = false;
|
||||
ipv4.addresses = [
|
||||
{
|
||||
inherit prefixLength;
|
||||
address = val.ipv4;
|
||||
}
|
||||
];
|
||||
};
|
||||
}) hostsAddr;
|
||||
hostsInterface =
|
||||
lib.attrsets.mapAttrs (key: val: {
|
||||
interfaces."${val.iface}" = {
|
||||
useDHCP = false;
|
||||
ipv4.addresses = [
|
||||
{
|
||||
inherit prefixLength;
|
||||
address = val.ipv4;
|
||||
}
|
||||
];
|
||||
};
|
||||
})
|
||||
hostsAddr;
|
||||
|
||||
ssh = {
|
||||
# define the host alias for remote builders
|
||||
@@ -177,13 +178,14 @@ rec {
|
||||
extraConfig = (
|
||||
lib.attrsets.foldlAttrs (
|
||||
acc: host: val:
|
||||
acc
|
||||
+ ''
|
||||
Host ${host}
|
||||
HostName ${val.ipv4}
|
||||
Port 22
|
||||
''
|
||||
) "" hostsAddr
|
||||
acc
|
||||
+ ''
|
||||
Host ${host}
|
||||
HostName ${val.ipv4}
|
||||
Port 22
|
||||
''
|
||||
) ""
|
||||
hostsAddr
|
||||
);
|
||||
|
||||
# this config will be written to /etc/ssh/ssh_known_hosts
|
||||
@@ -195,22 +197,21 @@ rec {
|
||||
# { x = "a"; y = "b"; }
|
||||
# => { x = "bar-a"; y = "bar-b"; }
|
||||
lib.attrsets.mapAttrs
|
||||
(host: value: {
|
||||
hostNames = [ host ] ++ (lib.optional (hostsAddr ? host) hostsAddr.${host}.ipv4);
|
||||
publicKey = value.publicKey;
|
||||
})
|
||||
{
|
||||
# Define the root user's host key for remote builders, so that nix can verify all the remote builders
|
||||
(host: value: {
|
||||
hostNames = [host] ++ (lib.optional (hostsAddr ? host) hostsAddr.${host}.ipv4);
|
||||
publicKey = value.publicKey;
|
||||
})
|
||||
{
|
||||
# Define the root user's host key for remote builders, so that nix can verify all the remote builders
|
||||
|
||||
aquamarine.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEOXFhFu9Duzp6ZBE288gDZ6VLrNaeWL4kDrFUh9Neic root@aquamarine";
|
||||
# ruby.publicKey = "";
|
||||
# kana.publicKey = "";
|
||||
aquamarine.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEOXFhFu9Duzp6ZBE288gDZ6VLrNaeWL4kDrFUh9Neic root@aquamarine";
|
||||
# ruby.publicKey = "";
|
||||
# kana.publicKey = "";
|
||||
|
||||
# ==================================== Other SSH Service's Public Key =======================================
|
||||
# ==================================== Other SSH Service's Public Key =======================================
|
||||
|
||||
# https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/githubs-ssh-key-fingerprints
|
||||
"github.com".publicKey =
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl";
|
||||
};
|
||||
# https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/githubs-ssh-key-fingerprints
|
||||
"github.com".publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user