forked from nix-community/nur-packages-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
67 lines (59 loc) · 2.63 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
language: nix
nix: 2.3.4
dist: xenial
os: linux
env:
global:
# Set this to cache your build results in cachix for faster builds
# in travis and for everyone who uses your cache.
#
# Format: Your cachix cache host name without the ".cachix.org" suffix.
# 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=scott-hamilton
# 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=shamilton
# Certain packages are marked as broken to disable NUR from building them,
# we want them to build build anyways as they're still useful
- NIXPKGS_ALLOW_BROKEN=1
- NIXPKGS_ALLOW_UNFREE=1
branches:
only:
- master
matrix:
include:
- env: NIXOS_VERSION=master NIX_CHANNEL=nixos-21.05
- env: NIXOS_VERSION=nixos-unstable NIX_CHANNEL=nixos-unstable
- env: NIXOS_VERSION=nixpkgs-unstable NIX_CHANNEL=nixpkgs-unstable
install:
- nix --version
# for cachix we need travis to be a trusted nix user
- echo "trusted-users = $USER" | sudo tee -a /etc/nix/nix.conf
- sudo systemctl restart nix-daemon
- travis_retry nix-channel --update
- nix-env -iA cachix -f https://cachix.org/api/v1/install
- cachix authtoken "${CACHIX_AUTH_TOKEN}"
- cachix use "${CACHIX_CACHE}"
- nix-channel --add "https://nixos.org/channels/${NIX_CHANNEL}" "${NIX_CHANNEL}"
- travis_retry nix-channel --update
before_script:
- sudo mkdir -p /etc/nix && echo 'sandbox = true' | sudo tee /etc/nix/nix.conf
- ls -lh $HOME/.nix-defexpr/channels
- export NIX_PATH=$HOME/.nix-defexpr/channels:$NIX_PATH
script:
- echo "${NIX_PATH}"
- nix-channel --list
- nix-build --arg pkgs "import <${NIX_CHANNEL}> {}" --argstr nixosVersion "${NIXOS_VERSION}" all-unbroken.nix
- nix eval --arg pkgs "import <${NIX_CHANNEL}> {}" --argstr nixosVersion "${NIXOS_VERSION}" -f default.nix 'lib'
- nix eval --arg pkgs "import <${NIX_CHANNEL}> {}" --argstr nixosVersion "${NIXOS_VERSION}" -f default.nix 'modules'
- nix eval --arg pkgs "import <${NIX_CHANNEL}> {}" --argstr nixosVersion "${NIXOS_VERSION}" -f default.nix 'overlays'
after_success:
- nix-build --argstr nixosVersion "${{ matrix.channel-branch }}" all-unbroken.nix | cachix push "${CACHIX_CACHE}"
- 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