mirror of
https://github.com/srid/haskell-flake.git
synced 2024-10-26 06:58:36 +03:00
Add trivial source filter to avoid rebuilds
This commit is contained in:
parent
f995e244af
commit
cd5e16917d
@ -10,6 +10,7 @@
|
|||||||
- #92: Add `devShell.mkShellArgs` to pass custom arguments to `mkShell`
|
- #92: Add `devShell.mkShellArgs` to pass custom arguments to `mkShell`
|
||||||
- #111: Add `devShell.extraLibraries` to add custom Haskell libraries to the devshell.
|
- #111: Add `devShell.extraLibraries` to add custom Haskell libraries to the devshell.
|
||||||
- #100: `source-overrides` option now supports specifying Hackage versions.
|
- #100: `source-overrides` option now supports specifying Hackage versions.
|
||||||
|
- #114: Prevent Nix rebuilds of packages in sub-directories when parent contents change.
|
||||||
- API changes
|
- API changes
|
||||||
- #37: Group `buildTools` (renamed to `tools`), `hlsCheck` and `hlintCheck` under the `devShell` submodule option; and allow disabling them all using `devShell.enable = false;` (useful if you want haskell-flake to produce just the package outputs).
|
- #37: Group `buildTools` (renamed to `tools`), `hlsCheck` and `hlintCheck` under the `devShell` submodule option; and allow disabling them all using `devShell.enable = false;` (useful if you want haskell-flake to produce just the package outputs).
|
||||||
- #64: Remove hlintCheck (use [treefmt-nix](https://github.com/numtide/treefmt-nix#flake-parts) instead)
|
- #64: Remove hlintCheck (use [treefmt-nix](https://github.com/numtide/treefmt-nix#flake-parts) instead)
|
||||||
|
@ -58,14 +58,31 @@ in
|
|||||||
hpack
|
hpack
|
||||||
''
|
''
|
||||||
else root;
|
else root;
|
||||||
|
setSrc = name: root: pkg: hlib.overrideSrc {
|
||||||
|
src =
|
||||||
|
lib.cleanSourceWith {
|
||||||
|
name = "source-${name}-${pkg.version}";
|
||||||
|
src =
|
||||||
|
# NOTE: Even though cabal2nix does run hpack automatically,
|
||||||
|
# buildFromCabalSdist does not. So we must run hpack ourselves at
|
||||||
|
# the original source level.
|
||||||
|
realiseHpack name root;
|
||||||
|
};
|
||||||
|
} pkg;
|
||||||
in
|
in
|
||||||
lib.mapAttrs
|
lib.mapAttrs
|
||||||
(name: value:
|
(name: pkgCfg:
|
||||||
# NOTE: Even though cabal2nix does run hpack automatically,
|
lib.pipe pkgCfg
|
||||||
# buildFromCabalSdist does not. So we must run hpack ourselves at
|
[
|
||||||
# the original source level.
|
(pkgCfg: self.callCabal2nix name pkgCfg.root { })
|
||||||
let root = realiseHpack name value.root;
|
|
||||||
in fromSdist (self.callCabal2nix name root { })
|
# Avoid rebuilding because of changes in parent directories
|
||||||
|
(setSrc name pkgCfg.root)
|
||||||
|
|
||||||
|
# Make sure all files we use are included in the sdist, as a check
|
||||||
|
# for release-worthiness.
|
||||||
|
fromSdist
|
||||||
|
]
|
||||||
)
|
)
|
||||||
config.packages;
|
config.packages;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user