puyak.r: separate config in net.nix

This commit is contained in:
makefu 2020-11-24 22:11:59 +01:00
parent 3417a4f890
commit 41865fe25f
No known key found for this signature in database
GPG Key ID: 36F7711F3FC0F225
2 changed files with 24 additions and 5 deletions

View File

@ -2,6 +2,7 @@
{ {
imports = [ imports = [
./net.nix
<stockholm/krebs> <stockholm/krebs>
<stockholm/krebs/2configs> <stockholm/krebs/2configs>
<stockholm/krebs/2configs/secret-passwords.nix> <stockholm/krebs/2configs/secret-passwords.nix>
@ -163,10 +164,6 @@
services.logind.lidSwitchExternalPower = "ignore"; services.logind.lidSwitchExternalPower = "ignore";
services.udev.extraRules = ''
SUBSYSTEM=="net", ATTR{address}=="8c:70:5a:b2:84:58", NAME="wl0"
SUBSYSTEM=="net", ATTR{address}=="3c:97:0e:07:b9:14", NAME="et0"
'';
environment.systemPackages = [ pkgs.zsh ]; environment.systemPackages = [ pkgs.zsh ];
@ -179,5 +176,4 @@
isNormalUser = true; isNormalUser = true;
shell = "/run/current-system/sw/bin/zsh"; shell = "/run/current-system/sw/bin/zsh";
}; };
networking.firewall.allowedTCPPorts = [ 5901 ];
} }

View File

@ -0,0 +1,23 @@
let
ext-if = "enp0s25";
shack-ip = "10.42.22.184";
shack-gw = "10.42.20.1";
in {
services.udev.extraRules = ''
SUBSYSTEM=="net", ATTR{address}=="8c:70:5a:b2:84:58", NAME="wl0"
SUBSYSTEM=="net", ATTR{address}=="3c:97:0e:07:b9:14", NAME="et0"
'';
networking = {
firewall.enable = false;
firewall.allowedTCPPorts = [ 8088 8086 8083 5901 ];
interfaces."${ext-if}".ipv4.addresses = [
{
address = shack-ip;
prefixLength = 20;
}
];
defaultGateway = shack-gw;
nameservers = [ "10.42.0.100" "10.42.0.200" ];
};
}