diff --git a/.travis.yml b/.travis.yml index ef6bb3289d8553e7a03adbd0ada799b786fa2bb4..8d0173216d91ed396d538500ea5909ffc83efda8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ -version: ~> 1.0 +language: nix -import: nix-community/nix-travis-ci:nix.yml@main +nix: 2.3.4 sudo: false @@ -13,21 +13,33 @@ # Example: mycache (for mycache.cachix.org) # # For this to work, you also need to set the CACHIX_SIGNING_KEY # in your repository settings in Travis. - # - CACHIX_CACHE= + - CACHIX_CACHE= # Set this to notify the global nur package registry that changes are # available. # # The repo name as used in # https://github.com/nix-community/NUR/blob/master/repos.json - - NUR_REPO="" + - NUR_REPO= matrix: include: - - env: NIX_PATH=nixpkgs=channel:nixpkgs-unstable + - env: NIX_CHANNEL=https://nixos.org/channels/nixpkgs-unstable -import: nix-community/nix-travis-ci:nix.yml@main + # + - env: NIX_CHANNEL=https://nixos.org/channels/nixos-20.03 + +install: +sudo: false import: nix-community/nix-travis-ci:nix.yml@main sudo: false + + - echo "trusted-users = $USER" | sudo tee -a /etc/nix/nix.conf + - sudo systemctl restart nix-daemon + - if [ -n "${CACHIX_CACHE}" ]; then travis_retry nix-channel --update; fi + - if [ -n "${CACHIX_CACHE}" ]; then nix-env -iA cachix -f https://cachix.org/api/v1/install; fi + - if [ -n "${CACHIX_CACHE}" ]; then cachix use "${CACHIX_CACHE}"; fi + - nix-channel --add "${NIX_CHANNEL}" nixpkgs + - travis_retry nix-channel --update script: - nix-build ci.nix -A buildOutputs @@ -37,6 +48,6 @@ - nix eval -f default.nix 'overlays' after_success: - if [ -n "${CACHIX_CACHE}" ]; then nix-build ci.nix -A cacheOutputs | cachix push "${CACHIX_CACHE}"; fi - - if [[ NUR_REPO != "" && "cron" != "${TRAVIS_EVENT_TYPE}" && "false" = "${TRAVIS_PULL_REQUEST}" && "master" = "${TRAVIS_BRANCH}" ]]; then + - if [ "cron" != "${TRAVIS_EVENT_TYPE}" -a "false" = "${TRAVIS_PULL_REQUEST}" -a "master" = "${TRAVIS_BRANCH}" ]; then curl -XPOST "https://nur-update.herokuapp.com/update?repo=${NUR_REPO}"; fi