Skip to content

nix develop fails when lockfile is ignored #8854

@viraptor

Description

@viraptor

Describe the bug

When I work with a repo where the flake lockfile is ignored, I get:

$ nix develop --show-trace          
warning: Git tree '/some/path' is dirty
warning: updating lock file '/some/path/flake.lock':
• Added input 'flake-utils':
...
evaluating derivation 'git+file:///some/path#devShells.aarch64-darwin.default'The following paths are ignored by one of your .gitignore files:
flake.lock
error:
       … while updating the lock file of flake 'git+file:///some/path'

       error: program 'git' failed with exit code 1

Steps To Reproduce

Use flake with flake.lock in gitignore file.

Expected behavior

Either:

  • nix develop doesn't try to commit the changes for ignored files, or
  • there's an option for "write updates, but don't commit"

nix-env --version output

nix-env (Nix) 2.13.3

Priorities

Add 👍 to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions