From 7ed6a50917d69046c621c2b01c091f7ac5ed8a09 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Fri, 20 Dec 2019 17:16:21 +0100 Subject: [PATCH] ci: add the NIXPKGS_CHANNEL shortcut --- .gitlab-ci.yml | 8 +++----- .travis.sh | 8 +++++--- .travis.yml | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3699b77..04f66ea 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 diff --git a/.travis.sh b/.travis.sh index d07cb9c..4671926 100755 --- a/.travis.sh +++ b/.travis.sh @@ -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" diff --git a/.travis.yml b/.travis.yml index ec74e69..6d87bf7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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