NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.05k stars 1.47k forks source link

flakes: input is updated on upgrade if repo owner capitalization is changed #10726

Open nmattia opened 3 months ago

nmattia commented 3 months ago

Describe the bug

I made a change to a flake input that should have no incidence on the build:

-  inputs.nixpkgs.url = "github:nixos/nixpkgs";
+  inputs.nixpkgs.url = "github:NixOS/nixpkgs";

However when running a nix upgrade, the input was updated:

$ nix profile upgrade 0
warning: updating lock file 'foo/flake.lock':
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/977a49df312d89b7dfbb3579bf13b7dfe23e7878' (2024-05-16)
  → 'github:NixOS/nixpkgs/4ff362e7100ea0003ec1c7e683f7c6d863fb286b' (2024-05-16)

Expected behavior

I did not expect nix profile upgrade to update inputs

nix-env --version output

nix-env (Nix) 2.18.2
edolstra commented 3 months ago

The revision changed as well, right? So upgrading the lock file would be correct behaviour regardless of the change in capitalization.

However, even if there was no new revision, I'm not convinced the change in capitalization shouldn't be reflected in the lock file.

nmattia commented 3 months ago

The revision changed as well, right?

The latest revision on that branch had changed, yes; that being said, I did not manually change the revision anywhere.

In general, is it normal for nix profile upgrade to bump the revision?

fricklerhandwerk commented 3 months ago

Triaged in Nix maintainers meeting:

nixos-discourse commented 3 months ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2024-05-22-nix-team-meeting-minutes-147/45835/1