From b703ab483861f243e0df03a56371fed2e1303981 Mon Sep 17 00:00:00 2001 From: kat witch Date: Tue, 18 May 2021 10:35:38 +0100 Subject: [PATCH] ci: Explicitly cache hexchen's sources --- ci/niv-cron.nix | 5 ++++- default.nix | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ci/niv-cron.nix b/ci/niv-cron.nix index 3715a04a..dc83f622 100644 --- a/ci/niv-cron.nix +++ b/ci/niv-cron.nix @@ -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 diff --git a/default.nix b/default.nix index 94699c1e..09e56af7 100644 --- a/default.nix +++ b/default.nix @@ -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;