ci: add the NIXPKGS_CHANNEL shortcut

This commit is contained in:
zimbatm 2019-12-20 17:16:21 +01:00
parent 9f61ec7d27
commit 7ed6a50917
No known key found for this signature in database
GPG key ID: 71BAF6D40C1D63D7
3 changed files with 11 additions and 11 deletions

View file

@ -7,19 +7,17 @@ nixos-unstable:
stage: build
script: nix-shell --run ./.gitlab-ci.sh
variables:
NIX_PATH: nixpkgs=channel:nixos-unstable
NIXPKGS_CHANNEL: nixos-unstable
IMAGE_TAG: latest
nixos-19.03:
stage: build
script: nix-shell --run ./.gitlab-ci.sh
variables:
NIX_PATH: nixpkgs=channel:nixos-19.03
IMAGE_TAG: nixos-19.03
NIXPKGS_CHANNEL: nixos-19.03
nixos-19.09:
stage: build
script: nix-shell --run ./.gitlab-ci.sh
variables:
NIX_PATH: nixpkgs=channel:nixos-19.09
IMAGE_TAG: nixos-19.09
NIXPKGS_CHANNEL: nixos-19.09

View file

@ -7,12 +7,14 @@ set -euo pipefail
./build
# default to Docker Hub
# the user has to set REGISTRY_USER and REGISTRY_PASSWORD
: "${REGISTRY:=docker.io}"
: "${IMAGE_PREFIX:=nixpkgs}"
# IMAGE_TAG is provided by .travis.yml
# the user has to set REGISTRY_USER and REGISTRY_PASSWORD
# either pass those two or set the NIXPKGS_CHANNEL
: "${IMAGE_TAG:=$NIXPKGS_CHANNEL}"
: "${NIX_PATH:=nixpkgs=channel:$NIXPKGS_CHANNEL}"
export NIX_PATH
if [[ "$TRAVIS_BRANCH" = master && -z "$TRAVIS_PULL_REQUEST_BRANCH" ]]; then
./docker-login "$REGISTRY_USER" "$REGISTRY_PASSWORD" "$REGISTRY"

View file

@ -5,11 +5,11 @@ nix: 2.2.1
matrix:
include:
- name: nixos-unstable
env: NIX_PATH=nixpkgs=channel:nixos-unstable IMAGE_TAG=latest
env: NIXPKGS_CHANNEL=nixos-unstable IMAGE_TAG=latest
- name: nixos-19.03
env: NIX_PATH=nixpkgs=channel:nixos-19.03 IMAGE_TAG=nixos-19.03
env: NIXPKGS_CHANNEL=nixos-19.03
- name: nixos-19.09
env: NIX_PATH=nixpkgs=channel:nixos-19.09 IMAGE_TAG=nixos-19.09
env: NIXPKGS_CHANNEL=nixos-19.09
script:
- nix-shell --run ./.travis.sh