-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
55 lines (49 loc) · 2.27 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
language: nix
nix: 2.3.4
os: linux
dist: xenial
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=instantos
# 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=instantos
jobs:
include:
- env: NIX_CHANNEL=nixpkgs-unstable NIXPKGS_ALLOW_UNFREE=1
- env: NIX_CHANNEL=nixos-unstable NIXPKGS_ALLOW_UNFREE=1
- env: NIX_CHANNEL=nixos-20.09 NIXPKGS_ALLOW_UNFREE=1
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
- 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 "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:
- nix-build --arg pkgs "import <${NIX_CHANNEL}> {}" ci.nix -A buildOutputs
- nix eval --arg pkgs "import <${NIX_CHANNEL}> {}" -f default.nix 'lib'
- nix eval --arg pkgs "import <${NIX_CHANNEL}> {}" -f default.nix 'modules'
- nix eval --arg pkgs "import <${NIX_CHANNEL}> {}" -f default.nix 'overlays'
after_success:
- if [ -n "${CACHIX_CACHE}" ]; then nix-build --arg pkgs "import <${NIX_CHANNEL}> {}" ci.nix -A cacheOutputs | cachix push "${CACHIX_CACHE}"; fi
- 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