Closed milahu closed 7 months ago
already solved by finalAttrs
nixpkgs/pkgs/by-name/he/hello/package.nix
{ callPackage
, lib
, stdenv
, fetchurl
, nixos
, testers
, hello
}:
stdenv.mkDerivation (finalAttrs: {
pname = "hello";
version = "2.12.1";
src = fetchurl {
url = "mirror://gnu/hello/hello-${finalAttrs.version}.tar.gz";
sha256 = "sha256-jZkUKv2SV28wsM18tCqNxoCZmLxdYH2Idh9RLibH2yA=";
};
test.nix
in practice, this mostly affects the
version
attributethis will build gitea version 1.21.6 but the gitea webinterface will still show the old version 1.21.4
because
gitea/default.nix
uses the nix variableversion
when it should use the bash variableversion
nixpkgs/pkgs/applications/version-management/gitea/default.nix
the build flag
main.Version
is used ingitea/main.go
see also
nixos discourse
How to override this derivation?
softmaker-office, freeoffice: make it easy to override versions nixpkgs#96163
→ pass
version
as function argument throughcallPackage
nixpkgs manual
https://ryantm.github.io/nixpkgs/using/overrides/#sec-pkg-overrideAttrs
note: "while all other attributes will be retained from the original hello package."
nixos reddit
Is overrideAttrs supposed to work like this?