1# Find the resolver in the stack.yaml file and fetch it if a sha256 value is provided
4, stackYaml ? "stack.yaml"
8 srcDir = src.origSrcSubDir or src;
10 # Using origSrcSubDir bypasses any cleanSourceWith so that it will work when
11 # access to the store is restricted. If origSrc was already in the store
12 # you can pass the project in as a string.
13 rawStackYaml = builtins.readFile (srcDir + "/${stackYaml}");
15 # Determine the resolver as it may point to another file we need
19 rs = pkgs.lib.lists.concatLists (
20 pkgs.lib.lists.filter (l: l != null)
21 (builtins.map (l: builtins.match "^resolver: *(.*)" l)
22 (pkgs.lib.splitString "\n" rawStackYaml)));
24 pkgs.lib.lists.head (rs ++ [ null ]);
26 # If we found a resolver and we have a resolverSha256 then we should download it.
28 if resolver != null && resolverSha256 != null
31 sha256 = resolverSha256;
33 else if resolver != null && __pathExists (srcDir + "/${resolver}")
34 then pkgs.copyPathToStore (srcDir + "/${resolver}")
37in { inherit resolver fetchedResolver; }
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list