Router has connectivity

This commit is contained in:
Daniel Flanagan 2024-07-16 10:48:32 -05:00
parent 27b94ccb51
commit 5dfbcbebd3
3 changed files with 172 additions and 148 deletions

View file

@ -329,7 +329,7 @@
router = nixpkgs.lib.nixosSystem { router = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = with nixosModules; [ modules = with nixosModules; [
# outputs.diskoConfigurations.unencrypted outputs.diskoConfigurations.unencrypted
common common
./nixos/router.nix ./nixos/router.nix
]; ];

View file

@ -753,6 +753,11 @@ sudo nix run nixpkgs#ipmitool -- raw 0x30 0x30 0x02 0xff 0x00
reverse_proxy :${toString config.services.gitea.settings.server.HTTP_PORT} reverse_proxy :${toString config.services.gitea.settings.server.HTTP_PORT}
''; '';
}; };
services.caddy.virtualHosts."git.beefcake" = {
extraConfig = ''
reverse_proxy :${toString config.services.gitea.settings.server.HTTP_PORT}
'';
};
} }
{ {
services.vaultwarden = { services.vaultwarden = {

View file

@ -29,10 +29,6 @@
}; };
}; };
in { in {
networking.hostName = "router";
networking.domain = "h.lyte.dev";
networking.useDHCP = false;
boot.initrd.availableKernelModules = ["xhci_pci"]; boot.initrd.availableKernelModules = ["xhci_pci"];
boot.initrd.kernelModules = []; boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"]; boot.kernelModules = ["kvm-intel"];
@ -178,7 +174,31 @@ in {
}; };
}; };
networking.extraHosts = '' networking = {
nat.enable = true; # TODO: maybe replace some of the nftables stuff with this?
firewall.enable = false;
hostName = "router";
domain = "h.lyte.dev";
# useDHCP = true;
interfaces = {
enp2s0 = {
# should be wan0
useDHCP = true;
};
enp3s0 = {
# should be lan0
useDHCP = false;
};
wan0 = {
useDHCP = true;
};
lan0 = {
useDHCP = false;
};
};
extraHosts = ''
127.0.0.1 localhost 127.0.0.1 localhost
${ip} router.h.lyte.dev router ${ip} router.h.lyte.dev router
@ -187,9 +207,7 @@ in {
ff02::2 ip6-allrouters ff02::2 ip6-allrouters
''; '';
networking.nat.enable = true; # TODO: maybe replace some of the nftables stuff with this? nftables = {
networking.firewall.enable = false;
networking.nftables = {
enable = true; enable = true;
flushRuleset = true; flushRuleset = true;
@ -285,7 +303,7 @@ in {
}; };
}; };
networking.dhcpcd = { dhcpcd = {
enable = true; enable = true;
extraConfig = '' extraConfig = ''
duid duid
@ -324,6 +342,9 @@ in {
static domain_name_servers=${ip} static domain_name_servers=${ip}
''; '';
}; };
};
systemd.services.systemd-networkd-wait-online.enable = lib.mkForce false;
systemd.network = { systemd.network = {
enable = true; enable = true;
@ -352,9 +373,7 @@ in {
services.avahi = { services.avahi = {
enable = true; enable = true;
reflector = true; reflector = true;
allowInterfaces = [ allowInterfaces = [lan_if];
lan_if
];
}; };
system.stateVersion = "24.05"; system.stateVersion = "24.05";