ci: Explicitly cache hexchen's sources

This commit is contained in:
kat witch 2021-05-18 10:35:38 +01:00
parent 0f755f045e
commit b703ab4838
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72
2 changed files with 6 additions and 1 deletions

View file

@ -21,7 +21,9 @@ with lib; {
displayName = "niv update build";
nativeBuildInputs = [ nix cachix ];
environment = [ "OPENSSH_PRIVATE_KEY" ];
command = ''
command = let sources = (import ../.).sources;
sourceCache = (import ../.).sourceCache; in
''
mkdir ~/.ssh
echo "$OPENSSH_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 0600 ~/.ssh/id_rsa
@ -29,6 +31,7 @@ with lib; {
nix run -f . pkgs.niv -c niv update $source || true
echo $(nix eval --raw '(import ./.).sources.$source') | ${cachix}/bin/cachix push kittywitch
done
cachix push kittywitch $(nix eval --raw -f ../. sourceCache)
if git status --porcelain | grep -qF nix/sources.json ; then
if nix build -Lf . hosts.{athame,yule,samhain}.config.system.build.toplevel; then
git add nix/sources.json

View file

@ -19,6 +19,8 @@ rec {
runners = import ./runners.nix { inherit lib; inherit (deploy) target; };
sourceCache = toString (lib.mapAttrsToList(sourceName: value: "${value}") (removeAttrs (import sources.nix-hexchen {}).sources [ "__functor" ]));
deploy = import ./lib/deploy.nix {
inherit pkgs sources;
inherit hosts targets;