mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-11 19:58:28 +01:00
Include runtime files in output
This commit is contained in:
parent
20951c584a
commit
7a26c17e32
16
flake.nix
16
flake.nix
@ -8,7 +8,21 @@
|
||||
(system:
|
||||
let pkgs = nixpkgs.legacyPackages.${system}; in
|
||||
{
|
||||
defaultPackage = pkgs.callPackage ./package.nix {};
|
||||
packages.default = pkgs.callPackage ./package.nix {};
|
||||
|
||||
checks = {
|
||||
# I used to put these into $out/lib, but justStaticExecutables
|
||||
# removes that directory. Now I feel like I'm just getting lucky. So
|
||||
# let's double check the files are there.
|
||||
file-check = pkgs.runCommand "check-runtime-files" {} ''
|
||||
if [ -e ${self.packages.${system}.default}/run/config/settings.yml ]; then
|
||||
touch $out
|
||||
else
|
||||
2>&1 echo "Runtime files are missing"
|
||||
exit 1
|
||||
fi
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@ -9,6 +9,12 @@ let
|
||||
preConfigure = ''
|
||||
${pkgs.hpack}/bin/hpack .
|
||||
'';
|
||||
# During build, static files are generated into the source tree's
|
||||
# static/ dir. Plus, config/ is needed at runtime.
|
||||
postInstall = ''
|
||||
mkdir -p $out/run
|
||||
cp -a {static,config} $out/run
|
||||
'';
|
||||
src = pkgs.lib.cleanSource old.src;
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user