From e8942db82626aeffc0f4a0629d2d95a47e68d084 Mon Sep 17 00:00:00 2001 From: Yuri Tatishchev Date: Fri, 6 Jun 2025 22:13:01 -0700 Subject: [PATCH] WIP: router: add configuration for second test router --- flake.nix | 37 +++++++++++++++---------------------- hosts/router-2/default.nix | 25 +++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 22 deletions(-) create mode 100644 hosts/router-2/default.nix diff --git a/flake.nix b/flake.nix index 7f79b5c..e1c22d0 100644 --- a/flake.nix +++ b/flake.nix @@ -37,6 +37,18 @@ # Optionally, use home-manager.extraSpecialArgs to pass # arguments to home.nix }; + + mkRouter = hostFile: nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + secrix.nixosModules.default + ./modules + ./hosts/common.nix + hostFile + ./users/cazzzer + (hmModule ./home/common.nix) + ]; + }; in { apps.x86_64-linux.secrix = secrix.secrix self; @@ -77,28 +89,9 @@ (hmModule ./home/cazzzer-pc.nix) ]; }; - router = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - secrix.nixosModules.default - ./modules - ./hosts/common.nix - ./hosts/router - ./users/cazzzer - (hmModule ./home/common.nix) - ]; - }; - router-1 = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - secrix.nixosModules.default - ./modules - ./hosts/common.nix - ./hosts/router-1 - ./users/cazzzer - (hmModule ./home/common.nix) - ]; - }; + router = mkRouter ./hosts/router; + router-1 = mkRouter ./hosts/router-1; + router-2 = mkRouter ./hosts/router-2; }; # https://github.com/nix-community/nixos-generators?tab=readme-ov-file#using-in-a-flake packages.x86_64-linux = { diff --git a/hosts/router-2/default.nix b/hosts/router-2/default.nix new file mode 100644 index 0000000..b2d76ca --- /dev/null +++ b/hosts/router-2/default.nix @@ -0,0 +1,25 @@ +{ + imports = [ + ../../modules/router + ../hw-vm.nix + ]; + + router = { + enableDesktop = false; + enableDhcpClient = false; + wanMAC = "bc:24:11:bc:db:c1"; + lanMAC = "bc:24:11:19:2a:96"; + wanLL = "fe80::be24:11ff:febc:dbc1"; + lanLL = "fe80::be24:11ff:fe19:2a96"; + defaultToken = 252; + + pdFromWan = "fd46:fbbe:ca55:100"; + wanAddr4 = "192.168.1.64"; + wanGw4 = "192.168.1.254"; + }; + + networking.hostName = "grouta"; + + # override hw-vm.nix default + networking.useDHCP = false; +}