aboutsummaryrefslogtreecommitdiff
path: root/nixos/routers/switch.nix
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2024-02-20 21:34:43 +0100
committerKarel Kočí <cynerd@email.cz>2024-02-20 21:34:43 +0100
commitc014ef4360ebc9fe23d5abf253141f44a94160ca (patch)
tree19300ce3effeca6b435cb5c8c2891e5a0c7f8656 /nixos/routers/switch.nix
parentc9c4f84bd1303281d7520c2a519d7be7d678c83c (diff)
downloadnixos-personal-c014ef4360ebc9fe23d5abf253141f44a94160ca.tar.gz
nixos-personal-c014ef4360ebc9fe23d5abf253141f44a94160ca.tar.bz2
nixos-personal-c014ef4360ebc9fe23d5abf253141f44a94160ca.zip
nixos: merge router to normal modules
Diffstat (limited to 'nixos/routers/switch.nix')
-rw-r--r--nixos/routers/switch.nix65
1 files changed, 0 insertions, 65 deletions
diff --git a/nixos/routers/switch.nix b/nixos/routers/switch.nix
deleted file mode 100644
index 16d57bc..0000000
--- a/nixos/routers/switch.nix
+++ /dev/null
@@ -1,65 +0,0 @@
-{
- config,
- lib,
- ...
-}:
-with lib; let
- cnf = config.cynerd.switch;
-in {
- options = {
- cynerd.switch = {
- enable = mkEnableOption "Enable switch support";
- lanAddress = mkOption {
- type = types.str;
- description = "LAN IP address";
- };
- lanGateway = mkOption {
- type = types.str;
- description = "LAN IP address of the gateway";
- };
- };
- };
-
- config = mkIf cnf.enable {
- networking = {
- useNetworkd = true;
- nftables.enable = true;
- };
-
- systemd.network = {
- netdevs = {
- "brlan" = {
- netdevConfig = {
- Kind = "bridge";
- Name = "brlan";
- };
- extraConfig = ''
- [Bridge]
- DefaultPVID=none
- VLANFiltering=yes
- '';
- };
- };
- networks = {
- "brlan" = {
- matchConfig.Name = "brlan";
- bridgeVLANs = [
- {
- bridgeVLANConfig = {
- PVID = 1;
- EgressUntagged = 1;
- };
- }
- ];
- networkConfig = {
- Address = cnf.lanAddress;
- Gateway = cnf.lanGateway;
- DNS = "1.1.1.1";
- IPv6AcceptRA = "yes";
- };
- };
- };
- wait-online.anyInterface = true;
- };
- };
-}