hakyll-skeleton/outputs.nix

75 lines
1.8 KiB
Nix
Raw Permalink Normal View History

2024-08-13 09:23:43 +00:00
{
self,
nixpkgs,
utils,
haskellNix,
} @ inputs:
utils.lib.eachDefaultSystem (
system: let
2024-10-28 12:03:05 +00:00
overlays = [
haskellNix.overlay
(final: prev: {
hakyllProject = final.haskell-nix.project' {
src = ./.;
compiler-nix-name = "ghc910";
shell.buildInputs = [
skeleton-web
];
shell.tools = {
cabal = "latest";
hlint = "latest";
haskell-language-server = "latest";
};
};
})
];
2024-08-13 09:23:43 +00:00
pkgs = import nixpkgs {
2024-10-28 12:03:05 +00:00
inherit overlays system;
inherit (haskellNix) config;
};
flake = pkgs.hakyllProject.flake {};
skeleton-web = flake.packages."skeleton-web:exe:site";
hakyll-skeleton = pkgs.stdenv.mkDerivation {
name = "hakyll-skeleton";
buildInputs = [];
src =
pkgs.nix-gitignore.gitignoreSourcePure [
./.gitignore
".git"
".github"
]
./.;
# LANG and LOCALE_ARCHIVE are fixes pulled from the community:
LANG = "en_AU.UTF-8";
LOCALE_ARCHIVE =
pkgs.lib.optionalString
(pkgs.buildPlatform.libc == "glibc")
"${pkgs.glibcLocales}/lib/locale/locale-archive";
buildPhase = ''
${skeleton-web}/bin/site build --verbose
'';
installPhase = ''
2024-10-28 14:15:23 +00:00
cp -a _site/. "$out/"
2024-10-28 12:03:05 +00:00
'';
2024-08-13 09:23:43 +00:00
};
in {
2024-10-28 12:03:05 +00:00
packages = {
inherit skeleton-web hakyll-skeleton;
default = hakyll-skeleton;
};
apps = {
default = utils.lib.mkApp {
drv = skeleton-web;
exePath = "/bin/skeleton-web";
};
2024-08-13 09:23:43 +00:00
};
# Overwrite devShells being inported from haskell-nix
devShells.default = pkgs.callPackage ./shell.nix {
inherit (haskellNix.legacyPackages."${pkgs.system}") stylish-haskell;
};
}
)