1
0
Fork 0

Move build script to Nix derivation

main
Bill Ewanick 2023-08-02 18:32:04 -04:00
parent 4d710afae3
commit 73235cf0ab
2 changed files with 12 additions and 6 deletions

3
.gitignore vendored
View File

@ -6,8 +6,9 @@
dist dist
generateSealPosts generateSealPosts
# Direnv lorri stuff # Nix related
.direnv .direnv
result
# Too many posts, hiding for now # Too many posts, hiding for now
posts posts

View File

@ -18,18 +18,23 @@
]); ]);
in in
{ {
packages.default = pkgs.runCommand "generateSealPosts" { } ''
echo Generating seal posts
mkdir -p $out/bin
${ghc'}/bin/ghc \
-O2 \
-static \
-o $out/bin/generateSealPosts \
${./generateSealPosts.hs}
'';
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
name = "seal-generator-shell"; name = "seal-generator-shell";
buildInputs = with pkgs.haskellPackages; buildInputs = with pkgs.haskellPackages;
[ [
ghc' ghc'
hlint hlint
haskell-language-server haskell-language-server
(pkgs.writeShellScriptBin "build-seal-generator" ''
${ghc'}/bin/ghc -outputdir dist -O2 -static generateSealPosts.hs
'')
]; ];
}; };
}); });