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

error: expected a string but got a thunk when importing a flake input #6659

Closed
yajo opened this issue Jun 13, 2022 · 2 comments
Closed

error: expected a string but got a thunk when importing a flake input #6659

yajo opened this issue Jun 13, 2022 · 2 comments

Comments

@yajo
Copy link
Contributor

yajo commented Jun 13, 2022

Is your feature request related to a problem? Please describe.
While developing https://gitlab.com/moduon/devsecops/precommix, I wanted a way to force the flake to get a specific input version depending on how the Copier template is updated.

Describe the solution you'd like
I thought it would be pretty simple to add a .precommix.nix file, updated by the Copier template, and then just add to the flake:

inputs.precommix.url = import ./.precommix.nix;

However, if you put such import in a flake input, you get this error:

error: expected a string but got a thunk at /nix/store/jymd3dfmwvv0k7f2nbrqgf4pp9w6ax4s-source/flake.nix:10:3

Describe alternatives you've considered
Not sure... using builtins.getFlake?

Additional context
Precommix combines the best parts of pre-commit and nix.

To make sure we get full reproducibility, I want to share the same commit between the .pre-commit-config.yaml file and flake.lock when updating the template.

To manage template I use https://copier.readthedocs.io/ because it supports smart updates.

@dasJ
Copy link
Member

dasJ commented Jul 4, 2022

Seems like a duplicate of #4945

@yajo
Copy link
Contributor Author

yajo commented Jul 5, 2022

Indeed.

@yajo yajo closed this as not planned Won't fix, can't repro, duplicate, stale Jul 5, 2022
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

No branches or pull requests

2 participants