Use filesets to improve caching
This commit is contained in:
parent
7a05b0f6cf
commit
a06fc7d27f
2 changed files with 25 additions and 4 deletions
|
|
@ -8,7 +8,10 @@
|
|||
pkgs = import nixpkgs { system = "x86_64-linux"; };
|
||||
lib = pkgs.lib;
|
||||
haskellPackages = pkgs.haskell.packages.ghc912;
|
||||
cabal2nix = haskellPackages.callCabal2nix "jail-nix-tests" ./. { };
|
||||
cabal2nix = haskellPackages.callCabal2nix "jail-nix-tests" (lib.fileset.toSource {
|
||||
root = ./.;
|
||||
fileset = ./jail-nix-tests.cabal;
|
||||
}) { };
|
||||
testDependencies = [
|
||||
(haskellPackages.ghc.withPackages (p: cabal2nix.buildInputs))
|
||||
pkgs.cabal-install
|
||||
|
|
@ -43,7 +46,18 @@
|
|||
${
|
||||
lib.pipe
|
||||
{
|
||||
jail-nix = ../.;
|
||||
jail-nix =
|
||||
with lib.fileset;
|
||||
toSource {
|
||||
root = ../.;
|
||||
fileset = difference ../. (unions [
|
||||
../.build.yml
|
||||
../LICENSE
|
||||
../README.md
|
||||
../tests
|
||||
../website
|
||||
]);
|
||||
};
|
||||
nixpkgs = nixpkgs;
|
||||
}
|
||||
[
|
||||
|
|
|
|||
|
|
@ -19,11 +19,18 @@
|
|||
};
|
||||
};
|
||||
|
||||
docsFileSet =
|
||||
with lib.fileset;
|
||||
toSource {
|
||||
root = ../.;
|
||||
fileset = ../lib;
|
||||
};
|
||||
|
||||
formatCombinatorDoc =
|
||||
name: combinatorObj:
|
||||
let
|
||||
attrPos = builtins.unsafeGetAttrPos "impl" combinatorObj;
|
||||
file = lib.removePrefix (toString ./..) attrPos.file;
|
||||
file = lib.removePrefix (toString docsFileSet) attrPos.file;
|
||||
in
|
||||
''
|
||||
### ${name}
|
||||
|
|
@ -37,7 +44,7 @@
|
|||
combinatorDocs =
|
||||
let
|
||||
allCombinators =
|
||||
(import ../lib/combinators.nix pkgs (throw "Docs must not depend on jail arg")).docs;
|
||||
(import (docsFileSet + /lib/combinators.nix) pkgs (throw "Docs must not depend on jail arg")).docs;
|
||||
|
||||
formatSection =
|
||||
filter:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue