2023-04-15 23:30:38 -04:00
|
|
|
{
|
|
|
|
description = "A Nix flake for a blog-post generating script, written in Haskell, with a seal bent.";
|
|
|
|
|
|
|
|
inputs = {
|
2023-08-02 18:26:08 -04:00
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
|
2023-04-15 23:30:38 -04:00
|
|
|
utils.url = "github:numtide/flake-utils";
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs, utils }:
|
|
|
|
utils.lib.eachDefaultSystem (system:
|
|
|
|
let
|
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
|
|
|
|
ghc' = pkgs.haskellPackages.ghcWithHoogle (self: with self; [
|
|
|
|
dhall
|
|
|
|
neat-interpolation
|
|
|
|
random
|
|
|
|
]);
|
|
|
|
in
|
|
|
|
{
|
2023-08-02 18:32:04 -04:00
|
|
|
packages.default = pkgs.runCommand "generateSealPosts" { } ''
|
|
|
|
echo Generating seal posts
|
|
|
|
mkdir -p $out/bin
|
|
|
|
${ghc'}/bin/ghc \
|
|
|
|
-O2 \
|
|
|
|
-static \
|
|
|
|
-o $out/bin/generateSealPosts \
|
|
|
|
${./generateSealPosts.hs}
|
|
|
|
'';
|
|
|
|
|
2023-04-15 23:30:38 -04:00
|
|
|
devShells.default = pkgs.mkShell {
|
2023-08-02 17:18:20 -04:00
|
|
|
name = "seal-generator-shell";
|
2023-04-15 23:30:38 -04:00
|
|
|
buildInputs = with pkgs.haskellPackages;
|
|
|
|
[
|
|
|
|
ghc'
|
|
|
|
hlint
|
|
|
|
haskell-language-server
|
2024-01-15 18:16:16 -05:00
|
|
|
|
|
|
|
dhall-lsp-server
|
2023-04-15 23:30:38 -04:00
|
|
|
];
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|