2023-04-10 19:42:25 -04:00
|
|
|
{
|
|
|
|
description = "A Nix flake for my long-running seal blog";
|
|
|
|
|
|
|
|
inputs = {
|
2023-08-02 17:02:43 -04:00
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
|
2023-08-02 20:22:52 -04:00
|
|
|
|
2023-04-10 19:42:25 -04:00
|
|
|
utils.url = "github:numtide/flake-utils";
|
2023-08-02 20:22:52 -04:00
|
|
|
|
|
|
|
spg.url = "git+https://git.ewanick.com/bill/sealPostGenerator.git";
|
|
|
|
spg.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
spg.inputs.utils.follows = "utils";
|
2023-04-10 19:42:25 -04:00
|
|
|
};
|
|
|
|
|
2023-08-02 20:22:52 -04:00
|
|
|
outputs = { self, nixpkgs, utils, ... }@inputs:
|
2023-04-10 19:42:25 -04:00
|
|
|
utils.lib.eachDefaultSystem (system:
|
|
|
|
let
|
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
|
|
|
|
ghc' = pkgs.haskellPackages.ghcWithHoogle (self: with self; [
|
2023-04-19 18:42:09 -04:00
|
|
|
dhall
|
2023-04-10 19:42:25 -04:00
|
|
|
hakyll
|
|
|
|
neat-interpolation
|
|
|
|
random
|
|
|
|
split
|
|
|
|
]);
|
|
|
|
in
|
2023-08-08 17:51:50 -04:00
|
|
|
rec {
|
2023-08-02 20:22:52 -04:00
|
|
|
apps.generateSealPosts = {
|
|
|
|
type = "app";
|
|
|
|
program = "${inputs.spg.packages.${system}.default}/bin/generateSealPosts";
|
|
|
|
};
|
|
|
|
|
2023-08-08 17:51:50 -04:00
|
|
|
apps.hakyll-site = {
|
|
|
|
type = "app";
|
|
|
|
program = "${packages.default}/bin/site";
|
|
|
|
};
|
|
|
|
|
|
|
|
apps.default = apps.hakyll-site;
|
|
|
|
|
|
|
|
packages.default = pkgs.stdenv.mkDerivation {
|
|
|
|
name = "site";
|
|
|
|
src = self;
|
|
|
|
buildPhase = ''
|
|
|
|
${ghc'}/bin/ghc \
|
|
|
|
-O2 \
|
|
|
|
-static \
|
|
|
|
-o site \
|
|
|
|
site.hs
|
|
|
|
'';
|
|
|
|
installPhase = "mkdir -p $out/bin; install -t $out/bin site";
|
|
|
|
};
|
|
|
|
|
2023-04-10 19:42:25 -04:00
|
|
|
devShells.default = pkgs.mkShell {
|
|
|
|
name = "hakyll-shell";
|
|
|
|
|
2023-08-02 20:22:52 -04:00
|
|
|
buildInputs = with pkgs.haskellPackages; [
|
|
|
|
ghc'
|
|
|
|
hlint
|
|
|
|
haskell-language-server
|
|
|
|
];
|
2023-04-10 19:42:25 -04:00
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|