Skip to content

qq: fix update.sh#436230

Closed
lonerOrz wants to merge 1 commit intoNixOS:masterfrom
lonerOrz:update/qq
Closed

qq: fix update.sh#436230
lonerOrz wants to merge 1 commit intoNixOS:masterfrom
lonerOrz:update/qq

Conversation

@lonerOrz
Copy link
Member

Reduce script dependencies and improve compatibility

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

Reduce script dependencies and improve compatibility
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Aug 23, 2025
Copy link
Contributor

@philiptaron philiptaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR doesn't actually do anything other than add you as a maintainer.


# use friendlier hashes
darwin_hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 "$darwin_hash")
darwin_hash="sha256-$(nix hash to-base64 "sha256:$darwin_hash")"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reverts (kind of) #421823

This change looks wrong to me.

Copy link
Member

@Frontear Frontear Aug 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Also out of curiosity why aren't we using nix-hash --type sha256 --to-sri <hash> instead of the nix3 CLI? I know it's not really a big difference but tacking on the experimental features feels excessive when a simpler command will do.

@lonerOrz
Copy link
Member Author

This PR doesn't actually do anything other than add you as a maintainer.

I got the error: 'convert' is not a recognized command when running the script

@Frontear
Copy link
Member

Frontear commented Aug 23, 2025

This PR doesn't actually do anything other than add you as a maintainer.

I got the error: 'convert' is not a recognized command when running the script

The nix hash convert subcommand has been available for a long time. Also, the to-base64 subcommand has been considered deprecated for just as long. What version of Nix are you on (what's the output of nix --version)?

@lonerOrz
Copy link
Member Author

The nix hash convert subcommand has been available for a long time. What version of Nix are you on (what's the output of nix --version)?

It might be that I used lix which caused the error, but I think the script should minimize dependencies as much as possible, since both methods achieve the same result

@lonerOrz lonerOrz closed this Aug 23, 2025
@lonerOrz lonerOrz deleted the update/qq branch August 23, 2025 17:23
@Frontear
Copy link
Member

I think the script should minimize dependencies as much as possible, since both methods achieve the same result

Honestly I agree with you. I think these scripts should be using nix-hash instead of the new nix hash, since the former wouldn't need the nix-command experimental feature and provides the same feature set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants