Can't bump version in a package using overrideAttrs

Hello. I’d like to figure out how to bump a version in this package:

https://github.com/NixOS/nixpkgs/blob/5630cf13cceac06cefe9fc607e8dfa8fb342dde3/pkgs/development/tools/alloy/default.nix

Here’s my shell.nix:

{ pkgs ? import <nixpkgs> {} }:
let
  # trying to bump version in this package: https://github.com/NixOS/nixpkgs/blob/5630cf13cceac06cefe9fc607e8dfa8fb342dde3/pkgs/development/tools/alloy/default.nix
  alloy6 = pkgs.alloy6.overrideAttrs (old: {
    version = "6.2.0";
    src = pkgs.fetchurl {
      url = "https://github.com/AlloyTools/org.alloytools.alloy/releases/download/v6.2.0/org.alloytools.alloy.dist.jar";
      sha256 = "13dpxl0ri6ldcaaa60n75lj8ls3fmghw8d8lqv3xzglkpjsir33b";
    };
  });
in
pkgs.mkShell {
  buildInputs = [
    alloy6
  ];
  shellHook = ''
    echo "Alloy version reported by the jar:"
    alloy6 -q -v
    echo "6.1.x means it's the old version, we need 6.2.0."
  '';
}

I still get the old version in nix shell. How to debug this? Do I do something wrong here?

Or some packages just can’t be modified this way?

1 Like

Related: alloy: use bash variable to fix overriding by ch4og · Pull Request #401731 · NixOS/nixpkgs · GitHub

(It is possible to write a package in a way that is practically non-overridable; a package that is overridable is better, though)

3 Likes