Skip to content

Commit

Permalink
feat(build): Add wrapper script & container image setup
Browse files Browse the repository at this point in the history
Introduces a wrapper script which automatically sets the paths to the
required runtime data dependencies.

Additionally configures a container image derivation which will output
a derivation with Nixery, Nix and other dependencies.
tazjin committed Jul 23, 2019
1 parent 4b35363 commit ca9fd98
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion default.nix
Original file line number Diff line number Diff line change
@@ -38,6 +38,31 @@ rec {
# for the demo instance running at nixery.appspot.com and provides
# some background information for what Nixery is.
nixery-static = runCommand "nixery-static" {} ''
cp -r ${./static} $out
mkdir $out
cp ${./static}/* $out
'';

# Wrapper script running the Nixery server with the above two data
# dependencies configured.
#
# In most cases, this will be the derivation a user wants if they
# are installing Nixery directly.
nixery-bin = writeShellScriptBin "nixery" ''
export NIX_BUILDER="${nixery-builder}"
export WEB_DIR="${nixery-static}"
exec ${nixery-server}/bin/nixery
'';

# Container image containing Nixery and Nix itself. This image can
# be run on Kubernetes, published on AppEngine or whatever else is
# desired.
nixery-image = dockerTools.buildLayeredImage {
name = "nixery";
contents = [
bashInteractive
coreutils
nix
nixery-bin
];
};
}

0 comments on commit ca9fd98

Please sign in to comment.