diff --git a/ci/niv-cron.nix b/ci/niv-cron.nix index c1bd3aab..940447b0 100644 --- a/ci/niv-cron.nix +++ b/ci/niv-cron.nix @@ -28,14 +28,13 @@ with lib; { echo "$OPENSSH_PRIVATE_KEY" > ~/.ssh/id_rsa chmod 0600 ~/.ssh/id_rsa for source in ${toString (attrNames sources)}; do - if nix run -f . pkgs.niv -c niv update $source; then - ${cachix}/bin/cachix push kittywitch $(nix eval --raw "(import ./.).sources.$source.outPath") - fi + nix run -f . pkgs.niv -c niv update $source || true done - nix build -f ../. sourceCache - ${cachix}/bin/cachix push kittywitch $(nix eval '(toString (import ../.).sourceCache)') if git status --porcelain | grep -qF nix/sources.json; then if nix build -Lf . hosts.{athame,yule,samhain}.config.system.build.toplevel; then + nix build -f ../. sourceCache + ${cachix}/bin/cachix push kittywitch $(nix eval '(toString (import ../.).sourceCache)') + nix-build $(echo "-A hosts."{athame,yule,samhain}.config.system.build.toplevel) | ${cachix}/bin/cachix push kittywitch git add nix/sources.json export GIT_{COMMITTER,AUTHOR}_EMAIL=kat@kittywit.ch export GIT_{COMMITTER,AUTHOR}_NAME=kat witch diff --git a/default.nix b/default.nix index 16a3efe1..1b4ae31a 100644 --- a/default.nix +++ b/default.nix @@ -19,7 +19,8 @@ rec { runners = import ./runners.nix { inherit lib; inherit (deploy) target; }; - sourceCache = lib.mapAttrsToList(sourceName: value: if lib.isDerivation value.outPath then value.outPath else value) (removeAttrs (import sources.nix-hexchen {}).sources [ "__functor" ]); + getSources = sources: lib.attrValues (lib.removeAttrs sources [ "__functor" ]); + sourceCache = map(value: if lib.isDerivation value.outPath then value.outPath else value) (getSources sources ++ getSources (import sources.nix-hexchen {}).sources); deploy = import ./lib/deploy.nix { inherit pkgs sources;