nixos-configs/devices/homie/modules/binary-cache.nix
matt1432 f4c78791ea
All checks were successful
Discord / discord commits (push) Has been skipped
feat: add binary cache at apartment
2024-12-11 12:29:24 -05:00

34 lines
635 B
Nix

{
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];
}