Skip to content

Instantly share code, notes, and snippets.

@LnL7
Last active February 16, 2019 13:22
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LnL7/fcd5c0bf772f2165a1ac40be6617d2f4 to your computer and use it in GitHub Desktop.
Save LnL7/fcd5c0bf772f2165a1ac40be6617d2f4 to your computer and use it in GitHub Desktop.
{ config, lib, pkgs, ...}:
with lib;
{
nix.package = pkgs.nixUnstable;
nix.trustedUsers = [ "hydra" ];
nix.binaryCaches = [ "http://cache.example.org" "https://cache.nixos.org" ];
nix.buildMachines = [
{ hostName = "localhost"; sshKey = "/var/run/keys/hydra_rsa"; system = "x86_64-linux,i686-linux"; maxJobs = 4; supportedFeatures = [ "builtin" "big-parallel" "kvm" ]; }
];
services.nginx.enable = true;
services.nginx.recommendedGzipSettings = true;
services.nginx.recommendedOptimisation = true;
services.nginx.recommendedProxySettings = true;
services.nginx.virtualHosts = {
"cache.example.org".locations."/".root = "/var/lib/nix-cache";
"hydra.example.org".locations."/".proxyPass = "http://127.0.0.1:60080";
};
services.hydra.enable = true;
services.hydra.hydraURL = "http://hydra.example.org";
services.hydra.notificationSender = "hydra@example.org";
services.hydra.port = 60080;
services.hydra.useSubstitutes = true;
# Look for nix-store --generate-binary-cache-key in the nix-store manpage
# for more information on how to generate a keypair for your cache.
services.hydra.extraConfig = ''
store_uri = file:///var/lib/nix-cache?secret-key=/run/keys/cache.example.org-1/sk
binary_cache_public_uri http://cache.example.org
'';
users.users.hydra.extraGroups = [ "keys" ];
users.users.hydra-queue-runner.extraGroups = [ "keys" ];
services.postgresql.enable = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment