devenv icon indicating copy to clipboard operation
devenv copied to clipboard

Template issues for `nix flake show`

Open anntnzrb opened this issue 7 months ago • 3 comments

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 avatar Jul 21 '24 17:07 anntnzrb