jtojnar / nixpkgs-hammering

Beat your package expressions into a shape
MIT License
241 stars 15 forks source link

Overwriting nixpkgs inputs does not work #130

Closed SuperSandro2000 closed 1 year ago

SuperSandro2000 commented 1 year ago

I am doing the following in my flake:

    nixpkgs-hammering = {
      url = "github:jtojnar/nixpkgs-hammering";
      inputs = {
        flake-compat.follows = "flake-compat";
        naersk.follows = "naersk";
        nixpkgs.follows = "nixpkgs";
        utils.follows = "flake-utils";
      };
    };

and I have a patch for nix which only applies to 2.9.0+. Since the nixpkgs in nixpkgs-hammering is following my nixpkgs I would expect it to use nix 2.9.1 from nixpkgs but nixpkgs-hammering still tries to use nix 2.8.0 from its lockfile which fails to build.

jtojnar commented 1 year ago

It uses nixVersions.stable attribute:

https://github.com/jtojnar/nixpkgs-hammering/blob/80be399db1dce330d4b56e67dc99502cd6bbc22c/flake.nix#L60

Maybe apply the patch conditionally on Nix version, or update to Nix revision where the attribute points to a newer Nix version?

jtojnar commented 1 year ago

Nevermind, just switched to nix attribute.

SuperSandro2000 commented 1 year ago

Maybe apply the patch conditionally on Nix version

I would have done that right now if you didn't push a fix.

update to Nix revision where the attribute points to a newer Nix version?

My nixpkgs points to nixos-unstable, so that should be new enough.