release.nix -> default.nix

the default should be to build all the images
This commit is contained in:
zimbatm 2019-12-17 23:29:41 +01:00
parent 987c5c9460
commit f90912f967
No known key found for this signature in database
GPG key ID: 71BAF6D40C1D63D7
9 changed files with 19 additions and 19 deletions

View file

@ -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/<image-name>` with a default.nix that returns the docker image.
Then run `nix-build release.nix -A <image-name>` to test that it builds, and
Then run `nix-build -A <image-name>` to test that it builds, and
then use
`docker load -i /nix/store/...<image-name>.tar.gz` to load and test the image.

2
build
View file

@ -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 \
"$@"

View file

@ -1,8 +1,4 @@
import <nixpkgs> {
# docker images run on Linux
system = "x86_64-linux";
config = {};
overlays = [
(import ./overlay.nix)
];
}
let
pkgs = import ./pkgs.nix;
in
pkgs.docker-nixpkgs

View file

@ -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 "| --- | --- | --- | --- |"

View file

@ -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")

8
pkgs.nix Normal file
View file

@ -0,0 +1,8 @@
import <nixpkgs> {
# docker images run on Linux
system = "x86_64-linux";
config = {};
overlays = [
(import ./overlay.nix)
];
}

View file

@ -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"

View file

@ -1,4 +0,0 @@
let
pkgs = import ./.;
in
pkgs.docker-nixpkgs

View file

@ -1,4 +1,4 @@
with import ./.;
with import ./pkgs.nix;
mkShell {
buildInputs = [
jq