Add source filtering

This resolves #4 by excluding the git subdirectory when building as a
flake.

Test builds with `nix build path:.` before and after the change.
This commit is contained in:
Bryan Bennett 2023-12-30 14:26:12 -05:00
parent 4013e8fca6
commit 8119738ddc
No known key found for this signature in database
GPG key ID: EE149E4215408DE9
3 changed files with 36 additions and 4 deletions

View file

@ -1,8 +1,9 @@
{ buildDunePackage
, lib
, core
, core_unix
, findlib
, lib
, nix-filter
, ocaml
, ppx_yojson_conv
, ppx_yojson_conv_lib
@ -13,7 +14,19 @@
buildDunePackage {
pname = "flake_env";
version = "0.1";
src = ./.;
src = nix-filter {
root = ./.;
include = [
"bin"
"lib"
./dune-project
./flake.nix
./default.nix
./flake.lock
./flake_env.opam
./direnvrc
];
};
duneVersion = "3";
postPatch = ''
substituteInPlace direnvrc --replace "@flake_env@" "$out/bin/flake_env"