Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions nix/hpkgs.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
{ pkgs ? import ./pkgs.nix { }
,
}:
let
# Decision: use lib.fileset.toSource for fine grained source filtering.
# Alternatives considered: passing ../. directly (rebuilds on any nix/tooling
# change), cleanSource (still includes too much). fileset.unions makes the
# build inputs explicit so editing nix/, .github/, makefile, .hlint.yaml,
# etc. does not invalidate the haskell build cache.
src = pkgs.lib.fileset.toSource {
root = ../.;
fileset = pkgs.lib.fileset.unions [
../app
../src
../test
../template.cabal
../LICENSE
../Readme.md
../Changelog.md
];
};
in
# you can pin a specific ghc version with
# pkgs.haskell.packages.ghc984 for example.
# this allows you to create multiple compiler targets via nix.
pkgs.haskellPackages.override {
overrides = hnew: hold: {
# NB this is a bit silly because nix files are now considered for the build
# bigger projects should consider putting haskell stuff in a subfolder
template-project = hnew.callCabal2nix "template-project" ../. { };
template-project = hnew.callCabal2nix "template-project" src { };
};
}
Loading