From f90912f967848ca260877535be2e27c7d0f26766 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Tue, 17 Dec 2019 23:29:41 +0100 Subject: [PATCH] release.nix -> default.nix the default should be to build all the images --- README.md | 2 +- build | 2 +- default.nix | 12 ++++-------- dockerhub-image-matrix | 2 +- dockerhub-metadata | 4 ++-- pkgs.nix | 8 ++++++++ push-all | 2 +- release.nix | 4 ---- shell.nix | 2 +- 9 files changed, 19 insertions(+), 19 deletions(-) create mode 100644 pkgs.nix delete mode 100644 release.nix diff --git a/README.md b/README.md index e228595..2d19e1b 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ All images are automatically built and pushed to Docker Hub. To add a new image to the project, create a new folder under `./images/` with a default.nix that returns the docker image. -Then run `nix-build release.nix -A ` to test that it builds, and +Then run `nix-build -A ` to test that it builds, and then use `docker load -i /nix/store/....tar.gz` to load and test the image. diff --git a/build b/build index a061aa0..9209c66 100755 --- a/build +++ b/build @@ -2,7 +2,7 @@ set -euo pipefail # build *all* the docker images -exec nix-build release.nix \ +exec nix-build \ --no-out-link \ --option sandbox true \ "$@" diff --git a/default.nix b/default.nix index f6a8f72..fa9be31 100644 --- a/default.nix +++ b/default.nix @@ -1,8 +1,4 @@ -import { - # docker images run on Linux - system = "x86_64-linux"; - config = {}; - overlays = [ - (import ./overlay.nix) - ]; -} +let + pkgs = import ./pkgs.nix; +in +pkgs.docker-nixpkgs diff --git a/dockerhub-image-matrix b/dockerhub-image-matrix index 83055f7..bf1b544 100755 --- a/dockerhub-image-matrix +++ b/dockerhub-image-matrix @@ -21,7 +21,7 @@ microbadge() { ## Main ## -releases_json=$(nix-instantiate ./release.nix --strict --eval --json) +releases_json=$(nix-instantiate --strict --eval --json) echo "| Image / Tag | latest | nixos-19.03 | nixos-19.09 |" echo "| --- | --- | --- | --- |" diff --git a/dockerhub-metadata b/dockerhub-metadata index c30ec3c..65fa228 100755 --- a/dockerhub-metadata +++ b/dockerhub-metadata @@ -15,7 +15,7 @@ nix_eval() { nix-instantiate --strict --eval --json "$@" } -releases_json=$(nix_eval release.nix) +releases_json=$(nix_eval) to_json() { local desc=$1 full_desc=$2 @@ -29,7 +29,7 @@ echo "=== Updating Docker Hub project descriptions" for attr in $(echo "$releases_json" | jq -r "keys[]") ; do echo "--- $attr" - desc=$(nix_eval ./release.nix -A "$attr.meta.description" | jq -r .) + desc=$(nix_eval -A "$attr.meta.description" | jq -r .) if [[ -f "$attr/README.md" ]]; then full_desc=$(< "$attr/README.md") diff --git a/pkgs.nix b/pkgs.nix new file mode 100644 index 0000000..f6a8f72 --- /dev/null +++ b/pkgs.nix @@ -0,0 +1,8 @@ +import { + # docker images run on Linux + system = "x86_64-linux"; + config = {}; + overlays = [ + (import ./overlay.nix) + ]; +} diff --git a/push-all b/push-all index 2d652dc..81bd296 100755 --- a/push-all +++ b/push-all @@ -7,7 +7,7 @@ registry=${1:-docker.io} image_prefix=${2:-nixpkgs} image_tag=${3:-latest} -releases_json=$(nix-instantiate ./release.nix --strict --eval --json) +releases_json=$(nix-instantiate --strict --eval --json) echo "=== Pushing images to $registry" diff --git a/release.nix b/release.nix deleted file mode 100644 index f1e77d7..0000000 --- a/release.nix +++ /dev/null @@ -1,4 +0,0 @@ -let - pkgs = import ./.; -in -pkgs.docker-nixpkgs diff --git a/shell.nix b/shell.nix index dd22871..6cf1ec6 100644 --- a/shell.nix +++ b/shell.nix @@ -1,4 +1,4 @@ -with import ./.; +with import ./pkgs.nix; mkShell { buildInputs = [ jq