diff options
Diffstat (limited to 'Com/Simatime')
-rw-r--r-- | Com/Simatime/buildHaskellApp.nix | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/Com/Simatime/buildHaskellApp.nix b/Com/Simatime/buildHaskellApp.nix index 0d0aa74..c9011e0 100644 --- a/Com/Simatime/buildHaskellApp.nix +++ b/Com/Simatime/buildHaskellApp.nix @@ -1,25 +1,19 @@ nixpkgs: -{ - # the namespace. We can't figure this out with Nix code, but when we port to - # guix/scheme we should be able to - name -, nick # a short name, for the executable -, apex # compiled with ghc -, aero # compiled with ghcjs - # deps get passed to the compilers -, deps - +{ name # the namespace +, nick # a short name, for the executable +, deps # deps get passed to the compilers }: with nixpkgs; let nsToPath = ns: builtins.toString (builtins.replaceStrings ["."] ["/"] ns); - aeroPath = nsToPath aero; - apexPath = nsToPath apex; + pathToNs = p: builtins.replaceStrings ["/"] ["."] p; basePath = nsToPath name; + apexPath = basePath + "/Apex"; # compiled with ghc + aeroPath = basePath + "/Aero"; # compiled with ghcjs depsToPackageSet = packageSet: deps: map (s: builtins.getAttr s packageSet) deps; @@ -65,12 +59,12 @@ in { # # compile with ghc # - ${ghc}/bin/ghc -i. --make ${apexPath}.hs -main-is ${apex} \ + ${ghc}/bin/ghc -i. --make ${apexPath}.hs -main-is ${pathToNs apexPath} \ -o $out/bin/${nick} # # compile with ghcjs # - ${ghcjs}/bin/ghcjs -i. --make ${aeroPath}.hs -main-is ${aero} \ + ${ghcjs}/bin/ghcjs -i. --make ${aeroPath}.hs -main-is ${pathToNs aeroPath} \ -o ${aeroPath} # # optimize js output |