2022-12-09 01:31:56 +01:00
|
|
|
{ config, lib, pkgs, ... }: with import ./lib;
|
2016-02-27 15:13:10 +01:00
|
|
|
{
|
2016-11-24 23:07:48 +01:00
|
|
|
environment.etc."binary-cache.pubkey".text =
|
|
|
|
config.krebs.build.host.binary-cache.pubkey;
|
|
|
|
|
2022-09-15 20:35:43 +02:00
|
|
|
nixpkgs.overlays = [
|
|
|
|
(self: super: {
|
|
|
|
nix-serve = self.haskellPackages.nix-serve-ng;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2016-11-24 23:07:48 +01:00
|
|
|
services.nix-serve = {
|
2016-02-27 15:13:10 +01:00
|
|
|
enable = true;
|
2022-09-15 20:51:27 +02:00
|
|
|
secretKeyFile = toString <secrets> + "/nix-serve.key";
|
2016-02-27 15:13:10 +01:00
|
|
|
};
|
2016-11-24 23:07:48 +01:00
|
|
|
|
2016-12-23 09:46:32 +01:00
|
|
|
services.nginx = {
|
2016-02-27 15:13:10 +01:00
|
|
|
enable = true;
|
2016-12-23 09:46:32 +01:00
|
|
|
virtualHosts.nix-serve = {
|
|
|
|
serverAliases = [
|
2020-08-19 02:30:51 +02:00
|
|
|
"cache.${config.krebs.build.host.name}.hkw"
|
2022-09-15 20:52:00 +02:00
|
|
|
"cache.${config.krebs.build.host.name}.r"
|
2016-11-24 23:07:48 +01:00
|
|
|
];
|
2016-12-23 09:46:32 +01:00
|
|
|
locations."/".extraConfig = ''
|
2016-02-27 15:13:10 +01:00
|
|
|
proxy_pass http://localhost:${toString config.services.nix-serve.port};
|
2016-12-23 09:46:32 +01:00
|
|
|
'';
|
2016-02-27 15:13:10 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|