mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-18 23:19:46 +02:00
feat: use mainGateway for idols-ai, rename defaultGateway to proxyGateway
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{ myvars, ... }:
|
||||
{myvars, ...}:
|
||||
#############################################################
|
||||
#
|
||||
# Ai - my main computer, with NixOS + I5-13600KF + RTX 4090 GPU, for gaming & daily use.
|
||||
@@ -7,12 +7,11 @@
|
||||
let
|
||||
hostName = "ai"; # Define your hostname.
|
||||
|
||||
inherit (myvars.networking) defaultGateway defaultGateway6 nameservers;
|
||||
inherit (myvars.networking) mainGateway mainGateway6 nameservers;
|
||||
inherit (myvars.networking.hostsAddr.${hostName}) iface ipv4 ipv6;
|
||||
ipv4WithMask = "${ipv4}/24";
|
||||
ipv6WithMask = "${ipv6}/64";
|
||||
in
|
||||
{
|
||||
in {
|
||||
imports = [
|
||||
./netdev-mount.nix
|
||||
# Include the results of the hardware scan.
|
||||
@@ -36,7 +35,7 @@ in
|
||||
systemd.network.enable = true;
|
||||
|
||||
systemd.network.networks."10-${iface}" = {
|
||||
matchConfig.Name = [ iface ];
|
||||
matchConfig.Name = [iface];
|
||||
networkConfig = {
|
||||
Address = [
|
||||
ipv4WithMask
|
||||
@@ -50,11 +49,11 @@ in
|
||||
routes = [
|
||||
{
|
||||
Destination = "0.0.0.0/0";
|
||||
Gateway = defaultGateway;
|
||||
Gateway = mainGateway;
|
||||
}
|
||||
{
|
||||
Destination = "::/0";
|
||||
Gateway = defaultGateway6;
|
||||
Gateway = mainGateway6;
|
||||
GatewayOnLink = true; # it's a gateway on local link.
|
||||
}
|
||||
];
|
||||
|
||||
@@ -14,14 +14,15 @@
|
||||
let
|
||||
hostName = "aquamarine"; # Define your hostname.
|
||||
|
||||
inherit (myvars.networking) defaultGateway defaultGateway6 nameservers;
|
||||
inherit (myvars.networking) proxyGateway proxyGateway6 nameservers;
|
||||
inherit (myvars.networking.hostsAddr.${hostName}) iface ipv4;
|
||||
ipv4WithMask = "${ipv4}/24";
|
||||
in
|
||||
{
|
||||
imports = (mylib.scanPaths ./.) ++ [
|
||||
disko.nixosModules.default
|
||||
];
|
||||
in {
|
||||
imports =
|
||||
(mylib.scanPaths ./.)
|
||||
++ [
|
||||
disko.nixosModules.default
|
||||
];
|
||||
|
||||
# supported file systems, so we can mount any removable disks with these filesystems
|
||||
boot.supportedFilesystems = [
|
||||
@@ -41,7 +42,7 @@ in
|
||||
zramSwap.memoryPercent = lib.mkForce 100;
|
||||
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.kernelModules = ["kvm-amd"];
|
||||
boot.extraModprobeConfig = "options kvm_amd nested=1"; # for amd cpu
|
||||
|
||||
networking = {
|
||||
@@ -56,9 +57,9 @@ in
|
||||
systemd.network.enable = true;
|
||||
|
||||
systemd.network.networks."10-${iface}" = {
|
||||
matchConfig.Name = [ iface ];
|
||||
matchConfig.Name = [iface];
|
||||
networkConfig = {
|
||||
Address = [ ipv4WithMask ];
|
||||
Address = [ipv4WithMask];
|
||||
DNS = nameservers;
|
||||
DHCP = "ipv6"; # enable DHCPv6 only, so we can get a GUA.
|
||||
IPv6AcceptRA = true; # for Stateless IPv6 Autoconfiguraton (SLAAC)
|
||||
@@ -67,11 +68,11 @@ in
|
||||
routes = [
|
||||
{
|
||||
Destination = "0.0.0.0/0";
|
||||
Gateway = defaultGateway;
|
||||
Gateway = proxyGateway;
|
||||
}
|
||||
{
|
||||
Destination = "::/0";
|
||||
Gateway = defaultGateway6;
|
||||
Gateway = proxyGateway6;
|
||||
GatewayOnLink = true; # it's a gateway on local link.
|
||||
}
|
||||
];
|
||||
|
||||
@@ -11,11 +11,10 @@
|
||||
let
|
||||
hostName = "kana"; # Define your hostname.
|
||||
|
||||
inherit (myvars.networking) defaultGateway defaultGateway6 nameservers;
|
||||
inherit (myvars.networking) proxyGateway proxyGateway6 nameservers;
|
||||
inherit (myvars.networking.hostsAddr.${hostName}) iface ipv4;
|
||||
ipv4WithMask = "${ipv4}/24";
|
||||
in
|
||||
{
|
||||
in {
|
||||
imports = mylib.scanPaths ./.;
|
||||
|
||||
# supported file systems, so we can mount any removable disks with these filesystems
|
||||
@@ -30,7 +29,7 @@ in
|
||||
"exfat"
|
||||
];
|
||||
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.kernelModules = ["kvm-amd"];
|
||||
boot.extraModprobeConfig = "options kvm_amd nested=1"; # for amd cpu
|
||||
|
||||
networking = {
|
||||
@@ -45,9 +44,9 @@ in
|
||||
systemd.network.enable = true;
|
||||
|
||||
systemd.network.networks."10-${iface}" = {
|
||||
matchConfig.Name = [ iface ];
|
||||
matchConfig.Name = [iface];
|
||||
networkConfig = {
|
||||
Address = [ ipv4WithMask ];
|
||||
Address = [ipv4WithMask];
|
||||
DNS = nameservers;
|
||||
DHCP = "ipv6"; # enable DHCPv6 only, so we can get a GUA.
|
||||
IPv6AcceptRA = true; # for Stateless IPv6 Autoconfiguraton (SLAAC)
|
||||
@@ -56,11 +55,11 @@ in
|
||||
routes = [
|
||||
{
|
||||
Destination = "0.0.0.0/0";
|
||||
Gateway = defaultGateway;
|
||||
Gateway = proxyGateway;
|
||||
}
|
||||
{
|
||||
Destination = "::/0";
|
||||
Gateway = defaultGateway6;
|
||||
Gateway = proxyGateway6;
|
||||
GatewayOnLink = true; # it's a gateway on local link.
|
||||
}
|
||||
];
|
||||
|
||||
@@ -11,11 +11,10 @@
|
||||
let
|
||||
hostName = "ruby"; # Define your hostname.
|
||||
|
||||
inherit (myvars.networking) defaultGateway defaultGateway6 nameservers;
|
||||
inherit (myvars.networking) proxyGateway proxyGateway6 nameservers;
|
||||
inherit (myvars.networking.hostsAddr.${hostName}) iface ipv4;
|
||||
ipv4WithMask = "${ipv4}/24";
|
||||
in
|
||||
{
|
||||
in {
|
||||
imports = mylib.scanPaths ./.;
|
||||
|
||||
# Enable binfmt emulation of aarch64-linux, this is required for cross compilation.
|
||||
@@ -35,7 +34,7 @@ in
|
||||
"exfat"
|
||||
];
|
||||
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.kernelModules = ["kvm-amd"];
|
||||
boot.extraModprobeConfig = "options kvm_amd nested=1"; # for amd cpu
|
||||
|
||||
networking = {
|
||||
@@ -50,9 +49,9 @@ in
|
||||
systemd.network.enable = true;
|
||||
|
||||
systemd.network.networks."10-${iface}" = {
|
||||
matchConfig.Name = [ iface ];
|
||||
matchConfig.Name = [iface];
|
||||
networkConfig = {
|
||||
Address = [ ipv4WithMask ];
|
||||
Address = [ipv4WithMask];
|
||||
DNS = nameservers;
|
||||
DHCP = "ipv6"; # enable DHCPv6 only, so we can get a GUA.
|
||||
IPv6AcceptRA = true; # for Stateless IPv6 Autoconfiguraton (SLAAC)
|
||||
@@ -61,11 +60,11 @@ in
|
||||
routes = [
|
||||
{
|
||||
Destination = "0.0.0.0/0";
|
||||
Gateway = defaultGateway;
|
||||
Gateway = proxyGateway;
|
||||
}
|
||||
{
|
||||
Destination = "::/0";
|
||||
Gateway = defaultGateway6;
|
||||
Gateway = proxyGateway6;
|
||||
GatewayOnLink = true; # it's a gateway on local link.
|
||||
}
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user