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

Template issues for nix flake show #1337

Open
anntnzrb opened this issue Jul 21, 2024 · 4 comments
Open

Template issues for nix flake show #1337

anntnzrb opened this issue Jul 21, 2024 · 4 comments
Labels
bug Something isn't working flakes Related to running devenv using the flake integration

Comments

@anntnzrb
Copy link

Describe the bug
There is an issue with the simple and flake-parts templates in the repository. When running the nix flake show command, it results in an error related to the update (//) operator.

To reproduce
Steps to reproduce:

  1. Clone the Devenv repository from https://github.com/cachix/devenv.
  • Or simply nix flake new -t <...>
  1. Navigate to either the simple or flake-parts template directory.
  2. Run the nix flake show command.

Error Message:

error:
       … in the left operand of the update (//) operator
         at /nix/store/yyx6cfswkz9n0lf8wdj3zpy42xrznv7f-source/flake.nix:166:24:
          165|           in
          166|           config.shell // {
             |                        ^
          167|             ci = config.ciDerivation;

       … while evaluating the attribute 'value'
         at /nix/store/mnfbbcdbbwh3iif9m9xp8jnsgys65f2g-source/lib/modules.nix:809:9:
          808|     in warnDeprecation opt //
          809|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          810|         inherit (res.defsFinal') highestPrio;

       … while evaluating the option `shell':

       … while evaluating definitions from `/nix/store/yyx6cfswkz9n0lf8wdj3zpy42xrznv7f-source/src/modules/top-level.nix':

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

       error: Failed assertions:
       - devenv was not able to determine the current directory.

         See https://devenv.sh/guides/using-with-flakes/ how to use it with flakes.

Version

Tested on WSL, NixOS, and Nix-Darwin environments.

  • Using flakes: Yes
  • Nix version: 2.18.2
  • devenv: 1.0.7
@anntnzrb anntnzrb added the bug Something isn't working label Jul 21, 2024
@MaxDaten
Copy link

Hi had the same problem, just today. But this worked for me:

nix flake show . --impure # mark the dot

I think this is a quirk which requires to use . with --impure.

I'm using the flake-parts template

@Doosty
Copy link

Doosty commented Jul 25, 2024

Just needs --impure.

@anntnzrb
Copy link
Author

Hi had the same problem, just today. But this worked for me:

nix flake show . --impure # mark the dot

I think this is a quirk which requires to use . with --impure.

I'm using the flake-parts template

Just needs --impure.

This should theoretically solve this issue, however, what about #1018 ?

@sandydoo sandydoo added the flakes Related to running devenv using the flake integration label Aug 8, 2024
@brianmay
Copy link

My vague understanding with #1018 is that you have to modify your flake to add a new input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working flakes Related to running devenv using the flake integration
Projects
None yet
Development

No branches or pull requests

5 participants