Nyx config for multiple IPs

main
Ashelyn Rose 8 months ago
parent 3c1804514c
commit d3f3acfba7

@ -1,18 +0,0 @@
{ config, lib, pkgs, ... }:
let
cfg = config.ashe.network;
in {
networking.firewall.allowedTCPPorts = cfg.openPorts;
networking.interfaces.${cfg.interface}.ipv4.addresses = [ {
address = cfg.address;
prefixLength = cfg.prefix;
} ];
networking.defaultGateway = cfg.gateway;
networking.nameservers = cfg.nameservers;
networking.wireless.enable = cfg.wireless;
networking.networkmanager.enable = cfg.networkManager;
}

@ -18,16 +18,4 @@ with lib;
password = mkOption { type = types.str; };
packages = mkOption { type = types.listOf types.package; default = [ ]; };
};
options.ashe.network = {
interface = mkOption { type = types.str; };
address = mkOption { type = types.str; };
prefix = mkOption { type = types.int; };
gateway = mkOption { type = types.str; };
nameservers = mkOption { type = types.listOf types.str; };
openPorts = mkOption { type = types.listOf types.port; default = [ 22 80 443 ]; };
wireless = mkEnableOption "wireless";
networkManager = mkEnableOption "Network Manager";
};
}

@ -4,7 +4,6 @@
../../common/variables.nix
../../common/system.nix
../../common/grub.nix
../../common/network.nix
../../common/user.nix
../../common/tailscale.nix
../../common/secrets.nix
@ -44,12 +43,27 @@
psmisc
];
ashe.network.interface = "ens3";
ashe.network.address = "104.168.211.198";
ashe.network.prefix = 16;
ashe.network.gateway = "104.168.218.1";
ashe.network.nameservers = [ "8.8.8.8" ];
networking.firewall.allowedTCPPorts = [ 80 443 ];
networking.firewall.allowedTCPPorts = [ 22 80 443 ];
networking.interfaces.ens3 = {
ipv4.addresses = [ {
address = "104.168.211.198";
prefixLength = 16;
} {
address = "104.168.143.74";
prefixLength = 16;
}];
ipv6.addresses = [ {
address = "2607:5501:3000:1e21::2";
prefixLength = 16;
}];
};
networking.defaultGateway = "104.168.218.1";
networking.nameservers = [ "8.8.8.8" ];
networking.wireless.enable = false;
networking.networkmanager.enable = false;
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).

@ -1,5 +1,6 @@
{ config, pkgs, ...}: {
services.nginx.enable = true;
services.nginx.defaultListenAddresses = [ "104.168.211.198" ];
services.nginx.recommendedProxySettings = true;
services.nginx.appendHttpConfig = ''
types {

Loading…
Cancel
Save