feat: add binary cache at apartment
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-12-11 12:29:24 -05:00
parent 1fd44269a2
commit f4c78791ea
6 changed files with 41 additions and 3 deletions

View file

@ -86,6 +86,7 @@ in {
"Immich" = mkPublicReverseProxy "photos" "${nosIP}:2283" {};
"Binary Cache" = mkPublicReverseProxy "cache" "${serviviIP}:5000" {};
"Apt Binary Cache" = mkPublicReverseProxy "cache-apt" "${homieIP}:5000" {};
# Private
"nelim.org" = {

View file

@ -0,0 +1,34 @@
{
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.${pkgs.system}.aptDevices "$@"
'';
};
in {
services.nix-serve = {
enable = true;
secretKeyFile = secrets.apt-binary-cache-key.path;
};
environment.systemPackages = [pkgs.nix-fast-build nixFastBuild];
}

View file

@ -1,5 +1,6 @@
{...}: {
imports = [
./binary-cache.nix
./home-assistant
./music
];

View file

@ -4,7 +4,6 @@
pkgs,
...
}: let
# FIXME: add binary cache at apartment
inherit (builtins) attrValues;
inherit (config.sops) secrets;

Binary file not shown.

View file

@ -4,7 +4,7 @@
pkgs,
...
}: let
inherit (lib) foldl isList mergeAttrsWithFunc mkIf optionals unique;
inherit (lib) elem foldl isList mergeAttrsWithFunc mkIf optionals unique;
cfg = config.roles.base;
@ -42,8 +42,11 @@ in
(mkSubstituterConf "https://viperml.cachix.org" "viperml.cachix.org-1:qZhKBMTfmcLL+OG6fj/hzsMEedgKvZVFRRAhq7j8Vh8=")
(mkSubstituterConf "https://cuda-maintainers.cachix.org" "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=")
]
++ optionals (!config.services.nix-serve.enable) [
++ optionals (config.networking.hostName != "servivi") [
(mkSubstituterConf "https://cache.nelim.org" "cache.nelim.org:JmFqkUdH11EA9EZOFAGVHuRYp7EbsdJDHvTQzG2pPyY=")
]
++ optionals (elem config.networking.hostName ["bbsteamie" "binto" "wim"]) [
(mkSubstituterConf "https://cache-apt.nelim.org" "cache-apt.nelim.org:NLAsWxa2Qbm4b+hHimjCpZfm48a4oN4O/GPZY9qpjNw=")
]);
};
}