Add a post-build hook pushing to the nix-community Cachix

This commit is contained in:
adisbladis 2020-04-17 17:22:24 +01:00
parent 43e72bf2e5
commit 85e1d29b94
No known key found for this signature in database
GPG key ID: 110BFAD44C6249B7
3 changed files with 24 additions and 0 deletions

16
build01/cache.nix Normal file
View file

@ -0,0 +1,16 @@
{ config, pkgs, ... }:
let
postBuildHook = pkgs.writeScript "post-build-hook.sh" ''
#!${pkgs.runtimeShell}
exec ${pkgs.cachix}/bin/cachix -c /var/lib/post-build-hook/nix-community-cachix.dhall push nix-community $OUT_PATHS
'';
in {
nix.extraOptions = ''
post-build-hook = ${postBuildHook}
'';
}

View file

@ -11,6 +11,7 @@ in
./buildkite.nix
./gitlab.nix
./hydra.nix
./cache.nix
./nixpkgs-update.nix
../profiles/common.nix

View file

@ -72,6 +72,13 @@ in
permissions = "0600";
};
deployment.keys."nix-community-cachix.dhall" = {
text = secrets."nix-community-cachix.dhall";
destDir = "/var/lib/post-build-hook";
user = "root";
permissions = "0400";
};
deployment.keys.github-nixpkgs-swh-key = {
text = secrets.github-nixpkgs-swh-key;
user = "buildkite-agent";