feat(build): Add wrapper script & container image setup
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.
This commit is contained in:
parent
8314568199
commit
5f471392cf
1 changed files with 26 additions and 1 deletions
|
@ -38,6 +38,31 @@ rec {
|
||||||
# for the demo instance running at nixery.appspot.com and provides
|
# for the demo instance running at nixery.appspot.com and provides
|
||||||
# some background information for what Nixery is.
|
# some background information for what Nixery is.
|
||||||
nixery-static = runCommand "nixery-static" {} ''
|
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
|
||||||
|
];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue