From ea84627e59b840c11de9d0b497bc70b98c354bfa Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Sat, 27 Jul 2024 21:12:24 +0200 Subject: [PATCH] feat: Use Attic as binary cache fix: Improve flake outputs yet again refactor: Delete dead code related to hamnet --- flake-parts/kubenix.nix | 12 ++++++----- flake.nix | 10 +++++++++ machines/bird.conf | 40 ----------------------------------- machines/warwick.nix | 46 ----------------------------------------- 4 files changed, 17 insertions(+), 91 deletions(-) delete mode 100644 machines/bird.conf diff --git a/flake-parts/kubenix.nix b/flake-parts/kubenix.nix index b2cb229..4c2d875 100644 --- a/flake-parts/kubenix.nix +++ b/flake-parts/kubenix.nix @@ -25,7 +25,10 @@ }; }).config.kubernetes; - mkManifest = name: { module, namespace }: (mkKubernetes name module namespace).result; + mkManifest = name: { module, namespace }: { + name = "${name}-manifest"; + value = (mkKubernetes name module namespace).result; + }; mkDeployApp = name: { module, namespace }: let @@ -52,8 +55,8 @@ }; in { - type = "app"; - program = "${pkgs.lib.getExe wrappedDeployScript}"; + name = "${name}-deploy"; + value = wrappedDeployScript; }; deployers = { @@ -179,6 +182,5 @@ }; in { - apps = builtins.mapAttrs mkDeployApp deployers; - packages = builtins.mapAttrs mkManifest deployers; + packages = pkgs.lib.mergeAttrs (pkgs.lib.mapAttrs' mkDeployApp deployers) (pkgs.lib.mapAttrs' mkManifest deployers); }) diff --git a/flake.nix b/flake.nix index f3add24..198e0d5 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,16 @@ { description = "NixOS definitions for our home servers"; + nixConfig = { + extra-substituters = [ + "https://attic.kun.is/nixos-servers" + ]; + + extra-trusted-public-keys = [ + "nixos-servers:JThtPjQjDu3b3qXLgeXSJGgKL4OKQ4uLgTtoo1rg6Vw=" + ]; + }; + inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; diff --git a/machines/bird.conf b/machines/bird.conf deleted file mode 100644 index 22c784c..0000000 --- a/machines/bird.conf +++ /dev/null @@ -1,40 +0,0 @@ -log syslog all; -debug protocols all; - -router id 44.137.17.110; - -protocol bgp hamgre { - local as 4220401706; - neighbor 44.137.61.33 as 4220406100; - source address 44.137.61.34; - multihop; - ipv4 { - import all; - export none; - }; -} - -protocol device { -} - -protocol direct { - interface "lo"; - ipv4 { - }; -} - -protocol kernel { - metric 0; - learn; - ipv4 { - import none; - export all; - }; -} - -protocol static { - route 44.137.17.96/28 via 44.137.61.33; - ipv4 { - }; -} - diff --git a/machines/warwick.nix b/machines/warwick.nix index f8c2af6..9859a28 100644 --- a/machines/warwick.nix +++ b/machines/warwick.nix @@ -8,52 +8,6 @@ monitoring.server.enable = true; tailscale.advertiseExitNode = true; }; - - services.bird2 = { - enable = false; - config = builtins.readFile ./bird.conf; - }; - - #systemd.network = { - # netdevs = { - # hamgre = { - # netdevConfig = { - # Name = "hamgre"; - # Kind = "gre"; - # MTUBytes = "1468"; - # }; - - # tunnelConfig = { - # Remote = "145.220.78.4"; - # #Local = "192.145.57.90"; - # }; - # }; - - # # hambr = { - # # netdevConfig = { - # # Name = "hambr"; - # # Kind = "bridge"; - # # }; - # # }; - # }; - - # networks = { - # "30-main-nic".networkConfig.Tunnel = "hamgre"; - - # "40-hamgre" = { - # matchConfig.Name = "hamgre"; - - # networkConfig = { - # Address = "44.137.61.34/30"; - # }; - # }; - - # # "40-hambr" = { - # # matchConfig.Name = "hambr"; - - # # }; - # }; - #}; }; }; }