From 2c00932803ae2091b8b869a66cdc5ac7204f5818 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Sat, 11 Jan 2025 17:08:38 -0500 Subject: [PATCH] feat: disable cache-apt because it causes lag --- .../cluster/modules/caddy/default.nix | 1 - configurations/cluster/modules/pcsd.nix | 1 - configurations/cluster/modules/unbound.nix | 2 +- configurations/homie/modules/binary-cache.nix | 34 ------------------- configurations/homie/modules/default.nix | 1 - modules/base/substituters/default.nix | 5 +-- nixFastChecks/default.nix | 10 +----- nixFastChecks/devices/default.nix | 14 +++----- 8 files changed, 8 insertions(+), 60 deletions(-) delete mode 100644 configurations/homie/modules/binary-cache.nix diff --git a/configurations/cluster/modules/caddy/default.nix b/configurations/cluster/modules/caddy/default.nix index 39ab0a9c..82bfe34d 100644 --- a/configurations/cluster/modules/caddy/default.nix +++ b/configurations/cluster/modules/caddy/default.nix @@ -87,7 +87,6 @@ in { "Immich" = mkPublicReverseProxy "photos" "${nosIP}:2283" {}; "Binary Cache" = mkPublicReverseProxy "cache" "${serviviIP}:5000" {}; - "Apt Binary Cache" = mkPublicReverseProxy "cache-apt" "${homieIP}:5000" {}; # Private "nelim.org" = { diff --git a/configurations/cluster/modules/pcsd.nix b/configurations/cluster/modules/pcsd.nix index e7508e8b..75619ddf 100644 --- a/configurations/cluster/modules/pcsd.nix +++ b/configurations/cluster/modules/pcsd.nix @@ -9,7 +9,6 @@ in { services.pcsd = { enable = true; - enableBinaryCache = true; enableWebUI = true; clusterName = "thingies"; diff --git a/configurations/cluster/modules/unbound.nix b/configurations/cluster/modules/unbound.nix index f8ceb08a..23114988 100644 --- a/configurations/cluster/modules/unbound.nix +++ b/configurations/cluster/modules/unbound.nix @@ -49,7 +49,7 @@ in { publicApps = remove "nelim.org" (mapAttrsToList (n: v: v.hostName) config.services.caddy.virtualHosts); in mergeAttrsList ( - [(mkLocalEntry "cache-apt.nelim.org" "100.64.0.10")] + [] ++ (map forceResolveEntry publicApps) ++ [ (mkMinecraftEntry "mc.nelim.org" 25569) diff --git a/configurations/homie/modules/binary-cache.nix b/configurations/homie/modules/binary-cache.nix deleted file mode 100644 index fa1ecde3..00000000 --- a/configurations/homie/modules/binary-cache.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ - config, - pkgs, - ... -}: let - inherit (builtins) attrValues; - inherit (config.sops) secrets; - - nixFastBuild = pkgs.writeShellApplication { - name = "nixFastBuild"; - - runtimeInputs = attrValues { - inherit - (pkgs) - gnugrep - nix-fast-build - nix-output-monitor - ; - }; - - text = '' - cd "$FLAKE/results" || return - - nix-fast-build -f ..#nixFastChecks.aptDevices "$@" - ''; - }; -in { - services.nix-serve = { - enable = true; - secretKeyFile = secrets.apt-binary-cache-key.path; - }; - - environment.systemPackages = [pkgs.nix-fast-build nixFastBuild]; -} diff --git a/configurations/homie/modules/default.nix b/configurations/homie/modules/default.nix index f01b1d7a..d8fa2972 100644 --- a/configurations/homie/modules/default.nix +++ b/configurations/homie/modules/default.nix @@ -1,6 +1,5 @@ {...}: { imports = [ - ./binary-cache.nix ./home-assistant ./music ]; diff --git a/modules/base/substituters/default.nix b/modules/base/substituters/default.nix index 13a234e9..630efc90 100644 --- a/modules/base/substituters/default.nix +++ b/modules/base/substituters/default.nix @@ -4,7 +4,7 @@ pkgs, ... }: let - inherit (lib) elem foldl isList mergeAttrsWithFunc mkIf optionals unique; + inherit (lib) foldl isList mergeAttrsWithFunc mkIf optionals unique; cfg = config.roles.base; @@ -45,9 +45,6 @@ in { ] ++ optionals (config.networking.hostName != "servivi") [ (mkSubstituterConf 100 "https://cache.nelim.org" "cache.nelim.org:JmFqkUdH11EA9EZOFAGVHuRYp7EbsdJDHvTQzG2pPyY=") - ] - ++ optionals (elem config.networking.hostName ["bbsteamie" "binto" "wim"]) [ - (mkSubstituterConf 10 "https://cache-apt.nelim.org" "cache-apt.nelim.org:NLAsWxa2Qbm4b+hHimjCpZfm48a4oN4O/GPZY9qpjNw=") ]); }; }; diff --git a/nixFastChecks/default.nix b/nixFastChecks/default.nix index 4de28e46..a9ee048d 100644 --- a/nixFastChecks/default.nix +++ b/nixFastChecks/default.nix @@ -7,20 +7,12 @@ }: let inherit (self.lib.attrs) recursiveUpdateList; - aptDevices = perSystem (pkgs: - import ./devices { - onlyApt = true; - inherit pkgs self; - }); - apps = perSystem (pkgs: import ./apps {inherit pkgs self;}); devices = perSystem (pkgs: import ./devices {inherit pkgs self;}); devShells = perSystem (pkgs: import ./devShells {inherit pkgs self;}); packages = perSystem (pkgs: import ./packages {inherit pkgs self;}); in { - # Allow homie to serve a binary cache for the devices away from servivi - aptDevices = recursiveUpdateList [aptDevices devShells]; + inherit apps devices devShells packages; all = recursiveUpdateList [apps devices devShells packages]; - inherit apps devices devShells packages; } diff --git a/nixFastChecks/devices/default.nix b/nixFastChecks/devices/default.nix index 5feb09e1..9f65666c 100644 --- a/nixFastChecks/devices/default.nix +++ b/nixFastChecks/devices/default.nix @@ -1,17 +1,13 @@ { pkgs, self, - onlyApt ? false, }: let - inherit (pkgs.lib) elem filterAttrs mapAttrs' nameValuePair; + inherit (pkgs.lib) filterAttrs mapAttrs' nameValuePair; - devices = filterAttrs (n: config: let - isSameSystem = config.pkgs.system == pkgs.system; - in - if onlyApt - then isSameSystem && elem n ["bbsteamie" "binto" "homie" "wim"] - else isSameSystem) - self.nixosConfigurations; + devices = + filterAttrs + (n: config: config.pkgs.system == pkgs.system) + self.nixosConfigurations; in mapAttrs' (name: config: