diff options
Diffstat (limited to 'Biz/Bild')
-rw-r--r-- | Biz/Bild/Rules.nix | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/Biz/Bild/Rules.nix b/Biz/Bild/Rules.nix index 51fcb14..17461ef 100644 --- a/Biz/Bild/Rules.nix +++ b/Biz/Bild/Rules.nix @@ -25,6 +25,10 @@ let haskellDeps = hpkgs: import ./Deps/Haskell.nix hpkgs; + mkGhcPackageSet = pkgs.haskell.packages.${ghcCompiler}.ghcWithHoogle; + mkGhcjsPackageSet = pkgs.haskell.packages.${ghcjsCompiler}.ghcWithPackages; + +in rec { # gather data needed for compiling by analyzing the main module analyze = main: rec { # path to the module relative to the git root @@ -35,23 +39,29 @@ let # file contents content = builtins.readFile main; # search for the ': out' declaration - out = builtins.head (lib.lists.flatten (removeNull - (map (builtins.match "^-- : out ([[:alnum:]._-]*)$") - (lines content)))); + out = lib.pipe content [ + lines + (map (builtins.match "^-- : out ([[:alnum:]._-]*)$")) + removeNull + lib.lists.flatten + builtins.head + ]; # collect all of the ': dep' declarations - deps = lib.lists.flatten (removeNull - (map (builtins.match "^-- : dep ([[:alnum:]._-]*)$") - (lines content))); - - sysdeps = lib.lists.flatten (removeNull - (map (builtins.match "^-- : sys ([[:alnum:]._-]*)$") - (lines content))); + deps = lib.pipe content [ + lines + (map (builtins.match "^-- : dep ([[:alnum:]._-]*)$")) + removeNull + lib.lists.flatten + ]; + # collect ': sys' declarations + sysdeps = lib.pipe content [ + lines + (map (builtins.match "^-- : sys ([[:alnum:]._-]*)$")) + removeNull + lib.lists.flatten + ]; }; - mkGhcPackageSet = pkgs.haskell.packages.${ghcCompiler}.ghcWithHoogle; - mkGhcjsPackageSet = pkgs.haskell.packages.${ghcjsCompiler}.ghcWithPackages; - -in rec { ghcPackageSetFull = mkGhcPackageSet haskellDeps; ghc = main: |