Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove usage of filterSource in gomod2nix import #153

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ifross89
Copy link

When running gomod2nix import, the calls to nix-instantiate fail with the following error:

error:
       … while calling the 'filterSource' builtin
         at «string»:2:1:
            1|
            2| builtins.filterSource (name: type: baseNameOf name != ".DS_Store") (
             | ^
            3|   builtins.path {

       … while adding path '/nix/store/aiskw3qix131gdmdjnsywqcqpn7jjr6a-aws-sdk-go_v1.50.27'

       error: path '/nix/store/aiskw3qix131gdmdjnsywqcqpn7jjr6a-aws-sdk-go_v1.50.27' is not valid
/nix/var/nix/profiles/default/bin/nix-instantiate --eval --expr
builtins.filterSource (name: type: baseNameOf name != ".DS_Store") (
  builtins.path {
    path = "/home/ianwork/go/pkg/mod/github.com/aws/[email protected]";
    name = "aws-sdk-go_v1.50.27";
  }
)

When looking at the docs, it appears the 'builtins.path' can take a 'filter', which also seems to be the preferred way: there are warnings about using 'filterSource' in the docs:

https://nixos.org/manual/nix/stable/language/builtins.html#builtins-filterSource

After making this change, I no longer get the previous error on my machine"

When running gomod2nix import, the calls to nix-instantiate fail with
the following error:

```
error:
       … while calling the 'filterSource' builtin
         at «string»:2:1:
            1|
            2| builtins.filterSource (name: type: baseNameOf name != ".DS_Store") (
             | ^
            3|   builtins.path {

       … while adding path '/nix/store/aiskw3qix131gdmdjnsywqcqpn7jjr6a-aws-sdk-go_v1.50.27'

       error: path '/nix/store/aiskw3qix131gdmdjnsywqcqpn7jjr6a-aws-sdk-go_v1.50.27' is not valid
/nix/var/nix/profiles/default/bin/nix-instantiate --eval --expr
builtins.filterSource (name: type: baseNameOf name != ".DS_Store") (
  builtins.path {
    path = "/home/ianwork/go/pkg/mod/github.com/aws/[email protected]";
    name = "aws-sdk-go_v1.50.27";
  }
)
```

When looking at the docs, it appears the 'builtins.path' can take a
'filter', which also seems to be the preferred way: there are warnings
about using 'filterSource' in the docs:

https://nixos.org/manual/nix/stable/language/builtins.html#builtins-filterSource

After making this change, I no longer get the previous error on my
machine"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant