mirror of
https://github.com/nix-community/dream2nix.git
synced 2025-01-03 20:06:15 +03:00
add documentation strings to stack-lock/utils.nix
This commit is contained in:
parent
b45c224383
commit
7bbfd8e940
@ -16,6 +16,7 @@ in rec {
|
||||
tar --strip-components 1 -xf ${pkgs.all-cabal-hashes}
|
||||
'';
|
||||
|
||||
# The cabal2json program
|
||||
cabal2json = let
|
||||
haskellLib = pkgs.haskell.lib.compose;
|
||||
haskellPackages = pkgs.haskell.packages.ghc8107.override {
|
||||
@ -45,6 +46,7 @@ in rec {
|
||||
in
|
||||
l.fromJSON (l.readFile jsonFile);
|
||||
|
||||
# fromYaml IFD implementation
|
||||
fromYaml = file: let
|
||||
file' = l.path {path = file;};
|
||||
jsonFile = pkgs.runCommand "yaml.json" {} ''
|
||||
@ -53,6 +55,7 @@ in rec {
|
||||
in
|
||||
l.fromJSON (l.readFile jsonFile);
|
||||
|
||||
# converts all cabal files for a given list of candidates to json files
|
||||
batchCabal2Json = candidates: let
|
||||
candidatesJsonStr = l.toJSON candidates;
|
||||
convertOne = name: version: ''
|
||||
@ -73,6 +76,10 @@ in rec {
|
||||
(l.concatStringsSep "\n"
|
||||
(l.map (c: convertOne c.name c.version) candidates));
|
||||
|
||||
/*
|
||||
Converts all cabal files for a given list of candiates to an attrset.
|
||||
access like: ${name}.${version}.${some_cabal_attr}
|
||||
*/
|
||||
batchCabalData = candidates: let
|
||||
batchJson = batchCabal2Json candidates;
|
||||
in
|
||||
|
Loading…
Reference in New Issue
Block a user