Skip to content

removing a flake.nix follows did not correctly update lock file #6105

@colemickens

Description

@colemickens

Describe the bug

Just now, I removed helix's "follow" so that it would use its own nixpkgs.

But I noticed that when nix auto updated my lock file, the output looked suspicious:

❯ cd code/nixcfg
cd: no such file or directory: code/nixcfg
direnv: loading ~/code/nixcfg/.envrc
direnv: using flake
warning: Git tree '/home/cole/code/nixcfg' is dirty
warning: updating lock file '/home/cole/code/nixcfg/flake.lock':
• Updated input 'helix/nixpkgs':
    follows 'nixpkgs'
  → 'github:nixos/nixpkgs/48d63e924a2666baf37f4f14a18f19347fbd54a2' (2022-02-10)
warning: Git tree '/home/cole/code/nixcfg' is dirty
warning: Git tree '/home/cole/code/nixcfg' is dirty

so I decided to git commit everything and then recreate the lock file:

❯ nix flake lock --recreate-lock-file --commit-lock-file
warning: updating lock file '/home/cole/code/nixcfg/flake.lock':
• Updated input 'helix/nixpkgs':
    'github:nixos/nixpkgs/48d63e924a2666baf37f4f14a18f19347fbd54a2' (2022-02-10)
  → 'github:nixos/nixpkgs/b2737d4980a17cc2b7d600d7d0b32fd7333aca88' (2022-01-11)
warning: committed new revision 'a7fab21d8144e74db1cf9304637feea4ed26ac4b'

It seems that this finally caused it to undo the follow properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions