callPackage Lix instead of overriding Nixpkgs' Nix #17

Merged
qyriad merged 1 commit from qyriad/nixos-module:call-package into main 2024-04-22 03:57:50 +00:00

View file

@ -15,8 +15,15 @@ let
})
);
# Internal nix-doc used by Lix.
lix-doc = final.callPackage (lix + "/lix-doc/package.nix") { };
lixPkg = (final.callPackage (lix + "/package.nix") {
build-release-notes = false;
versionSuffix = "-lix${versionSuffix}";
boehmgc-nix = boehmgc-patched;
}).overrideAttrs {
# Note: load-bearing version override. Nixpkgs does version detection to determine
# what commands and whatnot we support, so tell Nixpkgs that we're 2.18 (ish).
version = "2.18.3-lix${versionSuffix}";
jade marked this conversation as resolved
Review

are you sure you don't need VERSION_SUFFIX in here to make the thing actually do the right thing? i think the one here might not have correct nix --version output (in particular, would not have the date) without that.

are you sure you don't need VERSION_SUFFIX in here to make the thing actually do the right thing? i think the one here might not have correct nix --version output (in particular, would not have the date) without that.
Review

Sorry I wasn't paying close enough attention, you definitely have to override VERSION_SUFFIX still since it's set by the same thing that we're overriding for version here

Sorry I wasn't paying close enough attention, you definitely have to override `VERSION_SUFFIX` still since it's set by the same thing that we're overriding for `version` here
Review

VERSION_SUFFIX is set to versionSuffix in Lix:

VERSION_SUFFIX = versionSuffix;

On our system with this module, this is output of nix --version:

nix (Lix, like Nix) 2.90.0-lixpre20240418-7e79232
`VERSION_SUFFIX` is set to `versionSuffix` in Lix: https://git.lix.systems/lix-project/lix/src/commit/111db8b38fd8350d92d72fa17fd3d9e8ef5a0e09/package.nix#L169 On our system with this module, this is output of `nix --version`: ``` nix (Lix, like Nix) 2.90.0-lixpre20240418-7e79232 ```
};
in
{
# used for things that one wouldn't necessarily want to update, but we
@ -26,28 +33,7 @@ in
nixVersions = prev.nixVersions // rec {
# FIXME: do something less scuffed
nix_2_18 = (prev.nixVersions.nix_2_18.override { boehmgc = boehmgc-patched; }).overrideAttrs (old: {
src = lix;
# FIXME: fake version so that nixpkgs will not try to use nix config >_>
version = "2.18.3-lix${versionSuffix}";
VERSION_SUFFIX = "-lix${versionSuffix}";
# We only include CMake so that Meson can locate toml11, which only ships CMake dependency metadata.
dontUseCmakeConfigure = true;
patches = [ ];
buildInputs = old.buildInputs or [ ] ++ [
final.toml11
lix-doc
];
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [
final.buildPackages.cmake
# FIXME: we don't know why this was not being picked up properly when
# included in nativeCheckInputs.
final.buildPackages.git
final.buildPackages.python3
];
});
nix_2_18 = lixPkg;
stable = nix_2_18;
nix_2_18_upstream = prev.nixVersions.nix_2_18;
};