mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-22 16:58:31 +02:00
feat: passby router - aqua
This commit is contained in:
@@ -6,11 +6,12 @@
|
||||
inherit (inputs.nixpkgs) lib;
|
||||
mylib = import ../lib {inherit lib;};
|
||||
vars = import ./vars.nix;
|
||||
vars_networking = import ./vars_networking.nix {inherit lib;};
|
||||
|
||||
specialArgsForSystem = system:
|
||||
{
|
||||
inherit (constants) username userfullname useremail;
|
||||
inherit mylib;
|
||||
inherit mylib vars_networking;
|
||||
# use unstable branch for some packages to get the latest updates
|
||||
pkgs-unstable = import inputs.nixpkgs-unstable {
|
||||
inherit system; # refer the `system` parameter form outer scope recursively
|
||||
|
||||
@@ -47,12 +47,9 @@ in {
|
||||
../modules/nixos/server/server.nix
|
||||
../modules/nixos/server/proxmox-hardware-configuration.nix
|
||||
];
|
||||
home-module.imports = [
|
||||
../hosts/idols_aquamarine/home.nix
|
||||
../home/linux/server.nix
|
||||
];
|
||||
# home-module.imports = [];
|
||||
};
|
||||
idol_aquamarine_tags = ["dist-build" "aqua"];
|
||||
idol_aquamarine_tags = ["aqua" "router"];
|
||||
|
||||
# 星野 瑠美衣, Hoshino Rubii
|
||||
idol_ruby_modules = {
|
||||
@@ -61,10 +58,7 @@ in {
|
||||
../modules/nixos/server/server.nix
|
||||
../modules/nixos/server/proxmox-hardware-configuration.nix
|
||||
];
|
||||
home-module.imports = [
|
||||
../hosts/idols_ruby/home.nix
|
||||
../home/linux/server.nix
|
||||
];
|
||||
# home-module.imports = [];
|
||||
};
|
||||
idol_ruby_tags = ["dist-build" "ruby"];
|
||||
|
||||
@@ -75,10 +69,7 @@ in {
|
||||
../modules/nixos/server/server.nix
|
||||
../modules/nixos/server/proxmox-hardware-configuration.nix
|
||||
];
|
||||
home-module.imports = [
|
||||
../hosts/idols_kana/home.nix
|
||||
../home/linux/server.nix
|
||||
];
|
||||
# home-module.imports = [];
|
||||
};
|
||||
idol_kana_tags = ["dist-build" "kana"];
|
||||
|
||||
@@ -90,7 +81,7 @@ in {
|
||||
];
|
||||
# home-module.imports = [];
|
||||
};
|
||||
homelab_tailscale_gw_tags = ["tailscale-gw"];
|
||||
homelab_tailscale_gw_tags = ["tailscale_gw"];
|
||||
|
||||
# 森友 望未, Moritomo Nozomi
|
||||
rolling_nozomi_modules = {
|
||||
|
||||
93
systems/vars_networking.nix
Normal file
93
systems/vars_networking.nix
Normal file
@@ -0,0 +1,93 @@
|
||||
{lib, ...}: rec {
|
||||
defaultGateway = "192.168.5.201";
|
||||
nameservers = [
|
||||
"119.29.29.29" # DNSPod
|
||||
"223.5.5.5" # AliDNS
|
||||
];
|
||||
prefixLength = 24;
|
||||
|
||||
hostAddress = {
|
||||
"ai" = {
|
||||
inherit prefixLength;
|
||||
address = "192.168.5.100";
|
||||
};
|
||||
"aquamarine" = {
|
||||
inherit prefixLength;
|
||||
address = "192.168.5.101";
|
||||
};
|
||||
"ruby" = {
|
||||
inherit prefixLength;
|
||||
address = "192.168.5.102";
|
||||
};
|
||||
"kana" = {
|
||||
inherit prefixLength;
|
||||
address = "192.168.5.103";
|
||||
};
|
||||
"nozomi" = {
|
||||
inherit prefixLength;
|
||||
address = "192.168.5.104";
|
||||
};
|
||||
"yukina" = {
|
||||
inherit prefixLength;
|
||||
address = "192.168.5.105";
|
||||
};
|
||||
"chiaya" = {
|
||||
inherit prefixLength;
|
||||
address = "192.168.5.106";
|
||||
};
|
||||
"suzu" = {
|
||||
inherit prefixLength;
|
||||
address = "192.168.5.107";
|
||||
};
|
||||
"tailscale_gw" = {
|
||||
inherit prefixLength;
|
||||
address = "192.168.5.192";
|
||||
};
|
||||
};
|
||||
|
||||
ssh = {
|
||||
# define the host alias for remote builders
|
||||
# this config will be written to /etc/ssh/ssh_config
|
||||
# ''
|
||||
# Host ruby
|
||||
# HostName 192.168.5.102
|
||||
# Port 22
|
||||
#
|
||||
# Host kana
|
||||
# HostName 192.168.5.103
|
||||
# Port 22
|
||||
# ...
|
||||
# '';
|
||||
extraConfig =
|
||||
lib.attrsets.foldlAttrs
|
||||
(acc: host: value:
|
||||
acc
|
||||
+ ''
|
||||
Host ${host}
|
||||
HostName ${value.address}
|
||||
Port 22
|
||||
'')
|
||||
""
|
||||
hostAddress;
|
||||
|
||||
# define the host key for remote builders so that nix can verify all the remote builders
|
||||
# this config will be written to /etc/ssh/ssh_known_hosts
|
||||
knownHosts =
|
||||
# Update only the values of the given attribute set.
|
||||
#
|
||||
# mapAttrs
|
||||
# (name: value: ("bar-" + value))
|
||||
# { x = "a"; y = "b"; }
|
||||
# => { x = "bar-a"; y = "bar-b"; }
|
||||
lib.attrsets.mapAttrs
|
||||
(host: value: {
|
||||
hostNames = [host hostAddress.${host}.address];
|
||||
publicKey = value.publicKey;
|
||||
})
|
||||
{
|
||||
aquamarine.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO0EzzjnuHBE9xEOZupLmaAj9xbYxkUDeLbMqFZ7YPjU";
|
||||
ruby.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHrDXNQXELnbevZ1rImfXwmQHkRcd3TDNLsQo33c2tUf";
|
||||
kana.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJMVX05DQD1XJ0AqFZzsRsqgeUOlZ4opAI+8tkVXyjq+";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user