Code Monkey home page Code Monkey logo

purs-nix's Introduction

purs-nix

purs-nix is a tool for Nix-based PureScript development. It comes with both a Nix API, as well as a CLI you can use for development.

This project is currently unstable. That being said, most of the current API has been stable for some time, and we try to maintain backwards compatibility when introducing new APIs if possible.

Gettings Started

  • Setup nix.
  • Run nix flake init -t github:purs-nix/purs-nix in a new directory to initialize a new project.
  • Run nix develop to enter a Nix shell with the purs-nix command added to your PATH.
  • Run purs-nix run to see the output of the default project.

Getting Started (non-flakes)

  • Install Nix
  • Copy the template from templates/default, and then replace flake.nix with templates/shell.nix.
  • Run nix-shell to enter a Nix shell with the purs-nix command added to your PATH.
  • Run purs-nix run to see the output of the default project.

Learn

Package Set

purs-nix has its own package set, which is an extension of the the official package set with the following differences:

  • Package namespaces: We have package namespaces.

  • No global module namespace: All packages are not required to compile with each other.

  • Single source of truth for package info: You can define the version and dependencies of your package in its home repository and import it here. Nix is lazy so you will only ever download the information for the packages you need.

  • Packaging Foreign Dependencies: purs-nix allows you to bundle Node.js (or arbitrary JavaScript code) in with your package so it'll work for people without them having to manage external dependencies.

  • Easy modification: Using a modified version of the package set is as easy as forking it and changing the input of your flake ("github:purs-nix/purs-nix" -> "github:<your-username>/purs-nix"). If you put in a PR to add your package, using your fork of the package set is just as easy as using the official one, so you don't have to wait for the PR to be accepted to use your normal workflow.

  • Get package info: Since package info can be imported from a foreign repository, we need a way to view the info of a package easily.

    • To view the info of a package, use nix run github:purs-nix/purs-nix#package-info.<package-name>. (a namespaced package will need to have quotes around its name, as it contains a .. You can do that like this: .#package-info.'"<namespace>.<name>"'.)

Updating

To update the purs-nix package set:

$ cd official-package-set
$ ./generate.sh

Migrating from spago

There is a difference in the default esbuild format used by purs-nix and spago. The default used by purs-nix is ESM format. The default used by spago bundle-app is IIFE format. To match spago, specify bundle.esbuild.format = "iife", i.e.:

...
bundle =
  { ...
    esbuild = { format = "iife"; };
  }
...

Contributing / Mirrors

Bug reports and patches are always welcome. Feature requests and new features are also welcome, but please consider discussing them with the maintainer first.

You can contribute through GitHub or Codeberg.

To set up these mirrors as push remotes for origin

$ git remote set-url --add --push origin [email protected]:purs-nix/purs-nix.git
$ git remote set-url --add --push origin [email protected]:purs-nix/purs-nix.git

And pull

$ git fetch --all

Actively Maintained

This project is actively maintained by Platonic.Systems

purs-nix's People

Contributors

amesgen avatar fresheyeball avatar nc6 avatar oati avatar peterbecich avatar toastal avatar ursi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

purs-nix's Issues

purs-nix docs doesn't work properly

This is because there is currently no purescript-docs-search CLI that works with the current compiler. Spago forked the old version and updated it, but made it in a form that only works with Spago. So our docs will be broken on the latest compiler until that situation changes. The purescript teams seems open to reinstating the standalone CLI, so hopefully that will happen at some point. In the mean time, if you really need docs, there is a version of the 0.15 compiler that works with them. If someone ever comments here saying they want it, I can track down the latest commit that works. In the mean time, here's one that I know works from a project I have, it's on compiler version 0.15.4 5d0a08d

Unexpected different value for FFI deps

I have found a really weird bug when trying to use instanceof on class instances imported from shared FFI deps. This is package config:

{
   # ...
   info = {
      #...
      foreign =
        let
          ffi = [
            # ...
            "Ctl.Internal.Types.BigNum"
            "Ctl.Internal.Types.Int"
            # ...
          ];
        in
        pkgs.lib.attrsets.genAttrs ffi (_: { inherit node_modules; });
#...

node_modules is a derivation with installed dependencies.

Ctl.Internal.Types.BigNum imports a class from @emurgo/cardano-serialization-lib-nodejs, the same happens in Ctl.Internal.Types.Int. Internally the class (BigNum in my case, but there are more classes) asserts that the given instance is actually from the expected class, but it is not, throwing an error.

The issue is caused by a conflict in the module resolution algorithm used by node.js. When multiple versions of a module are installed in different directories, node.js will choose the version with the highest precedence in the search path. However, if a module is imported from one path, and then later the same module is imported from a different path, node.js may not recognize the two imports as referring to the same module, even if the module content is identical. As a result, classes defined in the module may not be recognized as constructors when called from other modules. (In my case a value instance of the shared lib BigNum, which is being passed from Int to BigNum).

I did some test manually going in the nix store file and changing the import to the same absolute path, and it fixed the error.

This is causing errors all the way in my application, I am trying to figure out how to deal with that. Any ideas?

`purs-nix run` fails, but `purs-nix bundle` then `node main.js` succeeds

It involves the purescript-fetch package and a simple one-liner:

module Main where

import Prelude

import Effect (Effect)
import Effect.Aff (launchAff_)
import Effect.Class (liftEffect)
import Effect.Console (log)
import Fetch (fetch)

main :: Effect Unit
main =
  fetch "https://httpbin.org/get" {} >>= _.text >>= (log >>> liftEffect) # launchAff_

Either run the line in purs-nix repl environment or purs-nix bundle then node main.js does the right thing. But if trying to purs-nix run, it throws a runtime error:

file:///home/name/ws/fetch/output/Fetch.Core.Headers/foreign.js:2
  return new Headers();
  ^

ReferenceError: Headers is not defined
    at Module.unsafeNew (file:///home/edward/ws/fetch/output/Fetch.Core.Headers/foreign.js:2:3)
    at __do (file:///home/edward/ws/fetch/output/Fetch.Core.Headers/index.js:25:33)
    at Module.unsafePerformEffect (file:///home/edward/ws/fetch/output/Effect.Unsafe/foreign.js:2:10)
    at file:///home/edward/ws/fetch/output/Fetch.Core.Headers/index.js:24:30
    at file:///home/edward/ws/fetch/output/Fetch.Core.Headers/index.js:37:70

The purescript-fetch document does mention that fetch is a node feature after version 17.5. But it should not have effect here since the default node version is now 18.*. This is most bizarre.

Allow for defining runtime dependencies to purs-nix

I would like to be able to define a list of runtime dependencies to my purescript project.
Use case:
Lets say my code makes a process call to hello. In my nix code I would like to define something like:

runtimeDependencies = [ pkgs.hello ];
dependencies = [ ... ];
test-dependencies = [ ... ];
ps =
  purs-nix.purs
    {
      inherit dependencies test-dependencies runtimeDependencies;
      dir = ./.;
    };
package =
  purs-nix.build
    {
      name = "hello-world";
      src.path = ./.;
      info = {
        inherit dependencies runtimeDependencies;
        version = "0.0.1";
      };
    };

purs-nix should be intelligent about the runtimeDependencies, meaning if down the line a user bundles the project for node and it has the hello-world package as a direct or transitive dependency, purs-nix should automatically wrap the node executable, such that pkgs.hello is available in the PATH.

Running `nix develop` fails

Hi,

When trying to run nix develop, I get the following error message:

       error: cannot call 'getFlake' on unlocked flake reference 'github:purs-nix/purescript-markdown-it/4b90edc070c9ede0ee045224e0c64f9c502c3bf7', at «none»:0 (use --impure to override)

This is with nix version 2.21.1.

Using nix-direnv, with use flake . in my .envrc, I don't get this error, I don't know why that works differently than nix develop...?

My flake.nix contents:

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
    ps-tools.follows = "purs-nix/ps-tools";
    purs-nix.url = "github:purs-nix/purs-nix/ps-0.15";
    utils.url = "github:numtide/flake-utils";
  };

  outputs =
    { nixpkgs, utils, ... }@inputs:
    utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" ]
      (system:
      let
        pkgs = nixpkgs.legacyPackages.${system};
        ps-tools = inputs.ps-tools.legacyPackages.${system};
        purs-nix = inputs.purs-nix { inherit system; };

        ps = purs-nix.purs {
          dependencies = [
            "console"
            "effect"
            "prelude"
          ];

          dir = ./.;
        };
      in
      {
        packages.default = ps.bundle { };

        devShells.default = pkgs.mkShell {
          packages = with pkgs; [
            entr
            nodejs
            (ps.command { })
            ps-tools.for-0_15.purescript-language-server
            purs-nix.esbuild
            purs-nix.purescript
          ];

          shellHook = ''
            alias watch="find src | entr -s 'echo bundling; purs-nix bundle'"
          '';
        };
      });
}

`generate.sh` appears to be broken

On the latest commit:

$ ./generate.sh
fatal: couldn't find remote ref refs/tags/v0.15.14
error:
       … while evaluating the file '/home/peterbecich/nix/purs-nix/official-package-set/generate.nix':

       … while calling the 'foldl'' builtin

         at /nix/store/1krpkgd8fngc2pasx2nxhdaaz78ibb6w-source/lib/trivial.nix:63:8:

           62|     let reverseApply = x: f: f x;
           63|     in builtins.foldl' reverseApply val functions;
             |        ^
           64|

       … while calling the 'foldl'' builtin

         at /nix/store/1krpkgd8fngc2pasx2nxhdaaz78ibb6w-source/lib/trivial.nix:62:30:

           61|   pipe = val: functions:
           62|     let reverseApply = x: f: f x;
             |                              ^
           63|     in builtins.foldl' reverseApply val functions;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: program 'git' failed with exit code 128

I think it is related to PureScript v0.15.14 released a few days ago: https://github.com/purescript/purescript/releases

Thank you

Print finish message after compile/bundle

After purs-nix compile or purs-nix bundle, print something like ✨ done ✨

Useful for e.g. running purs-nix bundle on file change: without a done message, when the console stops outputting messages, I don't know if it's completed compilation or if I just need to wait a moment longer before seeing my compiler warnings

Currently I just add this message myself, but I figure it could be nice to have in purs-nix

Happy to implement if you're on board

Added packages require extra attributes, not documented

I have a Nix Flake using purs-nix: https://github.com/peterbecich/halogen-chess/blob/master/flake.nix

The Purescript code is built with:

nix build .#purescriptBundle 

For this project there are two dependencies, argonaut-aeson-generic and foreign-generic, which are not in the default package set, so following these instructions https://github.com/purs-nix/purs-nix/blob/master/docs/adding-packages.md I have defined them manually here:
https://github.com/peterbecich/halogen-chess/blob/9ed15cfc2ca503077d6abbfaccfe03c7d9157829/flake.nix#L51-L111

These two objects argonaut-aeson-generic and foreign-generic each have two extra attributes which appear to be necessary:

  • purs-nix-info.name
  • purs-nix-info.dependencies: This is redundant to the documented required attribute info.dependencies

Without purs-nix-info.name I see:

error: attribute 'name' missing

       at /nix/store/l5zpai4gi760giiv5y7ixxdkya5ajrlj-source/purs-nix.nix:73:30:

           72|                 {}
           73|                 (sort (a: b: a.purs-nix-info.name < b.purs-nix-info.name) deps);
             |                              ^
           74|           in

and without purs-nix-info.dependencies I see:

error: attribute 'dependencies' missing

       at /nix/store/l5zpai4gi760giiv5y7ixxdkya5ajrlj-source/purs-nix.nix:65:24:

           64|                        (acc // { ${name} = dep; })
           65|                        dep.purs-nix-info.dependencies
             |                        ^
           66|                    else

Should the name attribute be mentioned in the Package Set: Git section of https://github.com/purs-nix/purs-nix/blob/master/docs/adding-packages.md ?

Can the redundant purs-nix-info.dependencies be made unnecessary?

git clone https://github.com/peterbecich/halogen-chess.git

There is a third error, off topic from this issue, which appears after name and dependencies are fixed. #35


Thanks

purescript-docs-search fails to build on Mac: `invalid regular expression` (parsec)

This error appears when using purs-nix on a M1 mac (but under rosetta).

Full log: https://gist.githubusercontent.com/srid/3a2c2a23cc6bcd4cf410e6c69a4af5e5/raw/55781c7154326718e0d5708ee177f276937dd588/gistfile1.txt

❯ nix --option system x86_64-darwin build github:purs-nix/purescript-docs-search
error: invalid regular expression '(([
       ]|--[^
       ]*
       |\{-([^-]|-[^}])*-})*((hiding)?([
       ]|--[^
       ]*
       |\{-([^-]|-[^}])*-})*\(([
       ]|--[^
       ]*
       |\{-([^-]|-[^}])*-})*(((([^
       ()=:{},.-]+)(([
       ]|--[^
       ]*
       |\{-([^-]|-[^}])*-})*\(([
       ]|--[^
       ]*
       |\{-([^-]|-[^}])*-})*((([^
       ()=:{},.-]+)?(([
       ]|--[^
       ]*
       |\{-([^-]|-[^}])*-})*,([
       ]|--[^
       ]*
       |\{-([^-]|-[^}])*-})*([^
       ()=:{},.-]+))*)|\.\.)([
       ]|--[^
       ]*
       |\{-([^-]|-[^}])*-})*\))?)|(\([^
       )]*?\))|(class([
       ]|--[^
       ]*
       |\{-([^-]|-[^}])*-})+([^
       ()=:{},.-]+))|(module([
       ]|--[^
       ]*
       |\{-([^-]|-[^}])*-})+([^
       ()=:{},-]+))|(type([
       ]|--[^
       ]*
       |\{-([^-]|-[^}])*-})*(\([^
       )]*?\)))|(kind([
       ]|--[^
       ]*
       |\{-([^-]|-[^}])*-})+([^
       ()=:{},.-]+)))?(([
       ]|--[^
       ]*
       |\{-([^-]|-[^}])*-})*,([
       ]|--[^
       ]*
       |\{-([^-]|-[^}])*-})*((([^
       ()=:{},.-]+)(([
       ]|--[^
       ]*
       |\{-([^-]|-[^}])*-})*\(([
       ]|--[^
       ]*
       |\{-([^-]|-[^}])*-})*((([^
       ()=:{},.-]+)?(([
       ]|--[^
       ]*
       |\{-([^-]|-[^}])*-})*,([
       ]|--[^
       ]*
       |\{-([^-]|-[^}])*-})*([^
       ()=:{},.-]+))*)|\.\.)([
       ]|--[^
       ]*
       |\{-([^-]|-[^}])*-})*\))?)|(\([^
       )]*?\))|(class([
       ]|--[^
       ]*
       |\{-([^-]|-[^}])*-})+([^
       ()=:{},.-]+))|(module([
       ]|--[^
       ]*
       |\{-([^-]|-[^}])*-})+([^
       ()=:{},-]+))|(type([
       ]|--[^
       ]*
       |\{-([^-]|-[^}])*-})*(\([^
       )]*?\)))|(kind([
       ]|--[^
       ]*
       |\{-([^-]|-[^}])*-})+([^
       ()=:{},.-]+))))*)([
       ]|--[^
       ]*
       |\{-([^-]|-[^}])*-})*\))?([
       ]|--[^
       ]*
       |\{-([^-]|-[^}])*-})*where([
       ]|--[^
       ]*
       |\{-([^-]|-[^}])*-})*).*'

       at /nix/store/nlawm43dvjgaz5q9bj45vwk6a3rfddbn-source/parsec.nix:648:16:

          647|       len = elemAt ps 2;
          648|       result = match ("(" + regex + ").*") (substring offset n str);
             |                ^
          649|     in if result == null
(use '--show-trace' to show detailed location information)

Unable to refer `src.path` to a flake input

I tried to make just one dependency a flake input:

--- a/flake.nix
+++ b/flake.nix
@@ -15,6 +15,9 @@
     treefmt-flake.inputs.nixpkgs.follows = "nixpkgs";
     treefmt.inputs.nixpkgs.follows = "nixpkgs";
     treefmt.inputs.flake-parts.follows = "flake-parts";
+
+    html-parser-halogen.url = "github:rnons/purescript-html-parser-halogen";
+    html-parser-halogen.flake = false;
   };
 
   outputs = { self, flake-parts, nixpkgs, treefmt-flake, ... }:
diff --git a/more-pkgs.nix b/more-pkgs.nix
index 122edb051..1fa79475a 100644
--- a/more-pkgs.nix
+++ b/more-pkgs.nix
@@ -1,5 +1,5 @@
 let b = builtins; in
-{ npmlock2nix, ps-pkgs }:
+{ inputs, npmlock2nix, ps-pkgs }:
 self:
 with b.removeAttrs ps-pkgs (b.attrNames self);
 {
@@ -68,12 +68,14 @@ with b.removeAttrs ps-pkgs (b.attrNames self);
 
   html-parser-halogen =
     {
-      src.git =
+      src.path = inputs.html-parser-halogen;
+      /* src.git =
         {
           repo = "https://github.com/rnons/purescript-html-parser-halogen.git";
           rev = "b4bd43e6ce7b3426e6b78f89a150b31bf4c1d7be";
           ref = "refs/tags/v1.0.0-rc.2";
         };
+      */
 
       info =
         {

This lead to:

error: access to absolute path '/bower.json' is forbidden in pure eval mode (use '--impure' to override)

       … while evaluating the attribute 'purs-nix-info.bower-json'

       at /nix/store/kah0z0myj2bdzxsknjx8vs6y156idy2n-source/build-pkgs.nix:119:29:

          118|                  // (if (readDir src)?"bower.json"
          119|                      then { bower-json = src + /bower.json; }
             |                             ^
          120|                      else {}

image

Warn about non-explicit dependencies?

First, thanks for this cool project, it is so great to be able to fully nixify Purescript projects in such an easy way!

In contrast to e.g. spago, purs-nix does not display a warning if one is importing modules from packages that are not explicitly declared as a dependencies. Making those explicit helps e.g. when accidentally using an undeclared transitive dependency that might suddenly "vanish" when it is no longer used by one of the declared dependencies.

feature request: specify PureScript package in Flake input

I have read the section "Modifying the Package Set": https://github.com/purs-nix/purs-nix/blob/master/docs/modifying-package-set.md#modifying-the-package-set

That works perfectly; used in this project, for example: https://github.com/peterbecich/halogen-chess/blob/b9a634d2bfe53628a92dd23b5898dc51fa7c6296/flake.nix#L58-L77

My feature request is a way to specify src.git with a Flake input.

Can this be replaced

"my.prelude" =
   { src.git =
       { repo = "https://github.com/me/prelude.git";
         rev = "0000000000000000000000000000000000000000";
       };

     info = ./package.nix;
   };

with something like

inputs = {
  .
  .
  .
  my-prelude.url = "github:me/prelude/0000000000000000000000000";
  .
  }

?

I have made one attempt at feeding this Flake input into purs-nix.build, but it did not work.

Thank you

whitespace character included in `official-package-set` `dependencies` lists

When these dependencies are generated, an extra whitespace character is included at the end, i.e. after transformers:

        dependencies =
          [ "basic-auth" "bucketchain" "effect" "maybe" "prelude" "transformers" 
          ];

I think this extra character exists for every dependencies list in official-package-set/default.nix

indirect support for `psa`?

purescript-psa is a CLI tool that wraps around purs compile and augments error reporting capabilities, such as allowing suppression of purescript compiler warnings

as far as I can tell, currently purs-nix provides no way for one to use psa "directly". the closest I've gotten is calling psa $(purs-nix srcs) on my side. this is not so much "plugging psa into purs-nix", as would be ideal, and is more "plugging purs-nix into psa"

i believe that allowing for "direct" support of psa would be as simple as allowing the user to choose a command to run instead of purs-nix compile. the user would not provide psa itself but a wrapper derivation around psa containing their chosen CLI arguments

aside: psa can be obtained from easy-purescript-nix

Add an override system

Use makeExtensible and extends to allow overriding the official package set.

Eventually, consider specifying local packages in overrides as well.

Native M1 support

It would be good to support M1 natively without having to use rosetta.

The main blocker is that PureScript releases (used here) don't include a M1 build.

purs-nix does work under Rosetta, though (--option system x86_64-darwin), so that's a reasonable workaround in the interim.

Expose version number in flake

Suppose I reference purs-nix as the following flake input,

purs-nix.url = "github:purs-nix/purs-nix/ps-0.14";

Is there a way to dynamically refer to the version number, 0.14, by inspecting the output of the flake?

Why do I need this? So I can dynamically determine the "for-0_14" in inputs.purscript-tools.legacyPackages.for-0_14.purescript-language-server.

Multi-package dev shell

[This proposal is a summary of the recent discussion with @ursi, @marijanp, and @toastal]

We want the purs-nix command to support the multiple local packages scenario (see example). That is, we want to be able to tell the purs-nix command which of the N local packages (in a mono repo; foo and bar in the aforementioned example) it should select when running commands like compile, test, run, bundle.

To do this, we propose the notion of a package sentinel file called purs.nix, as well as have the user designate an unique file in the project (flake.nix by default) that can be used to determine the correct relative path to any local package.

purs.nix sentinel file

The purs.nix file will contain all the metadata required to build a PureScript package. It'll be roughly analogous to spago.yaml of spaghetto. Here's a provisional example:

{
  name = "array";
  root = ./.;
  dependencies = [
    "prelude"
    "halogen"
  ];
  test-module = "Test";
  test = "test";
  foreign = {
    "Foo.Bar" = {
      type = "npm";
      path = ./.;
    };
  };
}

Note in particular that dependencies is a list of strings (instead of being a list of derivations), which incidentally is done to decouple the metadata from Nix things. This will work in conjunction with the recently added overlay system.

There is a future consideration and possibility if ultimately subsuming purs.nix into spago.yaml of spaghetto (thus making purs-nix read spago.yaml directly for package metadata, just like the Nix Haskell infrastructure does with the foo.cabal file), but since spaghetto is not even in alpha release yet, this is not important for our proposal. However, it is useful to keep the purs.nix sentinel file as simple as possible to ensure this decoupled design if only for simplicity of overall purs-nix design.

Project root file

By default, flake.nix is the project root file. Assuming the project has no other flake.nix in subdirectories, we can also cd .. until we arrive at the project root directory. This, in conjunction with the relative path of the purs.nix file is what will allow the purs-nix command to determine the exactly relative path of any package whose name is passed to it in the command line arguments.

New CLI

Let's say we have lib/prelude as one of the local packages. Therefore, there will also be a lib/prelude/purs.nix containing the purs-nix metadata to build that package. Now we can run the following to run the tests for prelude:

purs-nix prelude compile

The first argument specifies the package, and the second argument specifies the subcommand to run. From here, the wrapper bash script will know how to cd into lib/prelude or build the proper relative paths to the lib/prelude sources.

The exact CLI spec is open to change. The above CLI, for example, could well be purs-nix -p prelude compile (with -p using the $PWD purs.nix package by default).

broken link in documentation (package override)

I am trying to figure out how to override the package purescript-web-workers, which seems to only be version 1.1.0 in the registry even though a later version 2.0.0 was released last year. I figured out how to override the dependency in a spago project, but I would prefer to use purs-nix.
I have read a bit around in the documentation and experimented a bit with my flake.nix, but still haven't figured out how to override the package. With everything I have tried, I am still at web-workers version 1.1.0.
This is where I came across a broken link: https://github.com/purs-nix/purs-nix/blob/master/docs/overriding-packages.md at

- `overlays`: A list of [overlays](overriding-packages.md) to modify `ps-pkgs`/`ps-pkgs-ns`.

`master` branch to contain multiple PureScript versions

Current approach

When adding a feature to purs-nix, create a PR to merge it to master and then create another PR to merge it to ps-0.14 and so on.

Proposed approach

Get rid of versioned branches, like ps-0.14, and keep all PureScript versions (0.15, 0.14) in the master branch of purs-nix ... because of the benefit of not needing to create >1 PRs like in the current approach above.

Extra package causes `make-dep-globs` error

I have defined an extra package foreign-generic here

foreign-generic = {
purs-nix-info = {
name = "bar";
dependencies =
with purs-nix.ps-pkgs;
[ effect
foreign
foreign-object
ordered-collections
exceptions
record
identity
];
};
src.git = {
repo = "https://github.com/jsparkes/purescript-foreign-generic.git";
rev = "844f2ababa2c7a0482bf871e1e6bf970b7e51313";
};
};

which is not in the package set.

This definition follows these instructions https://github.com/purs-nix/purs-nix/blob/master/docs/adding-packages.md with a couple of modifications due to this: #34

nix build shows this error:

error: cannot coerce a set to a string

       at /nix/store/pqw2sx1hf5cjhvlnbpxpbv6rxsmam5l8-source/purs-nix.nix:88:32:

           87|         make-dep-globs = deps:
           88|           toString (map (a: ''"${a}/**/*.purs"'') deps);
             |                                ^
           89|

which I think originates here:

purs-nix/purs-nix.nix

Lines 87 to 91 in 2c97069

make-dep-globs = deps:
toString (map (a: ''"${a}/**/*.purs"'') deps);
dep-globs = make-dep-globs dependencies;
all-dep-globs = make-dep-globs all-dependencies;

Am I adding the extra package incorrectly, causing this issue? Is it an error in make-dep-globs?

Thanks

Create examples showing a nix( |-)build

(I believe) The fact that there's only a shell.nix has led at least one person to believe the project is focused on setting up a development environment rather than incorporating PureScript into nix builds, which is not the case.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.