NixOS / nix

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

nix flake {update,metadata,...}: shows input's narHash #10249

Open Kranzes opened 8 months ago

Kranzes commented 8 months ago

Describe the bug

In a recent release the format of the input displayed in nix flake {update,metadata,...} was changed to include the input's narHash, I think that's a bit too verbose for something like the metadata/update commands. I'd like to have the previous format back.

[kranzes@pongo ~/devel/pastebin]$ (master) nix flake metadata
Resolved URL:  git+file:///home/kranzes/devel/pastebin
Locked URL:    git+file:///home/kranzes/devel/pastebin?ref=refs/heads/master&rev=ebca230487b48c895c9ee2a88689a9112e869648
Path:          /nix/store/xnvrrcs1g61gbxvj7jxfrq3453s3clz9-source
Revision:      ebca230487b48c895c9ee2a88689a9112e869648
Revisions:     5
Last modified: 2024-03-07 17:02:08
Inputs:
├───flake-parts: github:hercules-ci/flake-parts/b253292d9c0a5ead9bc98c4e9a26c6312e27d69f?narHash=sha256-a0NYyp%2Bh9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg%3D (2024-02-01 23:40:56)
│   └───nixpkgs-lib follows input 'nixpkgs'
├───nixpkgs: github:NixOS/nixpkgs/d53c2037394da6fe98decca417fc8fda64bf2443?narHash=sha256-TsySgcWm/GlbYdL3AEva49ceeI2BdPQ7muwfYNr1fwo%3D (2024-02-28 06:32:26)
└───treefmt-nix: github:numtide/treefmt-nix/e497a9ddecff769c2a7cbab51e1ed7a8501e7a3a?narHash=sha256-QECZB%2BHgz/2F/8lWvHNk05N6NU/rD9bWzuNn6Cv8oUk%3D (2024-02-25 21:40:13)
    └───nixpkgs follows input 'nixpkgs'
[kranzes@pongo ~/devel/pastebin]$ (master) nix shell nixpkgs\#nixVersions.nix_2_20
[kranzes@pongo ~/devel/pastebin]$ (master) nix flake metadata
Resolved URL:  git+file:///home/kranzes/devel/pastebin
Locked URL:    git+file:///home/kranzes/devel/pastebin?ref=refs/heads/master&rev=ebca230487b48c895c9ee2a88689a9112e869648
Path:          /nix/store/xnvrrcs1g61gbxvj7jxfrq3453s3clz9-source
Revision:      ebca230487b48c895c9ee2a88689a9112e869648
Revisions:     5
Last modified: 2024-03-07 17:02:08
Inputs:
├───flake-parts: github:hercules-ci/flake-parts/b253292d9c0a5ead9bc98c4e9a26c6312e27d69f (2024-02-01 23:40:56)
│   └───nixpkgs-lib follows input 'nixpkgs'
├───nixpkgs: github:NixOS/nixpkgs/d53c2037394da6fe98decca417fc8fda64bf2443 (2024-02-28 06:32:26)
└───treefmt-nix: github:numtide/treefmt-nix/e497a9ddecff769c2a7cbab51e1ed7a8501e7a3a (2024-02-25 21:40:13)
    └───nixpkgs follows input 'nixpkgs'

Priorities

Add :+1: to issues you find important.

roberth commented 7 months ago

NAR hashes for inputs are on their way out with #10252 or #6530, so sgtm.

edolstra commented 7 months ago

NAR hashes for inputs are on their way out with https://github.com/NixOS/nix/pull/10252 or https://github.com/NixOS/nix/pull/6530, so sgtm.

To properly lock a GitHub input, we either need the narHash or treeHash, so those PRs won't solve the verbosity problem unfortunately.