diff --git a/pkgs/tools/package-management/lix/default.nix b/pkgs/tools/package-management/lix/default.nix index 57d697f7ea565..727ae28b0feb3 100644 --- a/pkgs/tools/package-management/lix/default.nix +++ b/pkgs/tools/package-management/lix/default.nix @@ -1,5 +1,6 @@ { lib, + config, stdenv, makeScopeWithSplicing', generateSplicesForMkScope, @@ -127,161 +128,92 @@ let }; }; }; -in -lib.makeExtensible (self: { - inherit makeLixScope; - - lix_2_91 = self.makeLixScope { - attrName = "lix_2_91"; - - lix-args = rec { - version = "2.91.3"; - - src = fetchFromGitHub { - owner = "lix-project"; - repo = "lix"; - rev = version; - hash = "sha256-b5d+HnPcyHz0ZJW1+LZl4qm4LGTB/TiaDFQVlVL2xpE="; - }; - - patches = [ - # Support for lowdown >= 1.4, https://gerrit.lix.systems/c/lix/+/3731 - (fetchpatch2 { - name = "lix-2.91-lowdown-1.4.0.patch"; - url = "https://git.lix.systems/lix-project/lix/commit/ecff59d77371b21fef229c33ebb629bc49a8fad5.patch"; - sha256 = "sha256-2M5oId5kObwzpw67rddAPI2RbWPEVlGBrMUXZWqqmEo="; - }) - ]; - - docCargoDeps = rustPlatform.fetchCargoVendor { - name = "lix-doc-${version}"; - inherit src; - sourceRoot = "${src.name or src}/lix-doc"; - hash = "sha256-U820gvcbQIBaFr2OWPidfFIDXycDFGgXX1NpWDDqENs="; - }; - }; - nix-eval-jobs-args = { - version = "2.91.0"; - src = fetchgit { - url = "https://git.lix.systems/lix-project/nix-eval-jobs.git"; - # https://git.lix.systems/lix-project/nix-eval-jobs/commits/branch/release-2.91 - rev = "1f98b0c016a6285f29ad278fa5cd82b8f470d66a"; - hash = "sha256-ZJKOC/iLuO8qjPi9/ql69Vgh3NIu0tU6CSI0vbiCrKA="; - }; - }; - }; - - lix_2_92 = self.makeLixScope { - attrName = "lix_2_92"; - - lix-args = rec { - version = "2.92.3"; - - src = fetchFromGitHub { - owner = "lix-project"; - repo = "lix"; - rev = version; - hash = "sha256-iP2iUDxA99RcgQyZROs7bQw8pqxa1vFudRqjAIHg9Iw="; - }; - - patches = [ - # Support for lowdown >= 1.4, https://gerrit.lix.systems/c/lix/+/3731 - (fetchpatch2 { - name = "lix-lowdown-1.4.0.patch"; - url = "https://git.lix.systems/lix-project/lix/commit/858de5f47a1bfd33835ec97794ece339a88490f1.patch"; - hash = "sha256-FfLO2dFSWV1qwcupIg8dYEhCHir2XX6/Hs89eLwd+SY="; - }) - ]; + removedMessage = version: '' + Lix ${version} is now removed from this revision of Nixpkgs. Consider upgrading to stable or the latest version. - cargoDeps = rustPlatform.fetchCargoVendor { - name = "lix-${version}"; - inherit src; - hash = "sha256-YMyNOXdlx0I30SkcmdW/6DU0BYc3ZOa2FMJSKMkr7I8="; - }; - }; + If you notice a problem while upgrading disrupting your workflows which did not occur in version ${version}, please reach out to the Lix team. + ''; +in +lib.makeExtensible ( + self: + { + inherit makeLixScope; + + lix_2_93 = self.makeLixScope { + attrName = "lix_2_93"; + + lix-args = rec { + version = "2.93.3"; + + src = fetchFromGitea { + domain = "git.lix.systems"; + owner = "lix-project"; + repo = "lix"; + rev = version; + hash = "sha256-Oqw04eboDM8rrUgAXiT7w5F2uGrQdt8sGX+Mk6mVXZQ="; + }; - nix-eval-jobs-args = rec { - version = "2.92.0"; - src = fetchgit { - url = "https://git.lix.systems/lix-project/nix-eval-jobs.git"; - rev = version; - hash = "sha256-tPr61X9v/OMVt7VXOs1RRStciwN8gDGxEKx+h0/Fg48="; + cargoDeps = rustPlatform.fetchCargoVendor { + name = "lix-${version}"; + inherit src; + hash = "sha256-YMyNOXdlx0I30SkcmdW/6DU0BYc3ZOa2FMJSKMkr7I8="; + }; }; }; - }; - lix_2_93 = self.makeLixScope { - attrName = "lix_2_93"; + git = self.makeLixScope { + attrName = "git"; - lix-args = rec { - version = "2.93.3"; - - src = fetchFromGitea { - domain = "git.lix.systems"; - owner = "lix-project"; - repo = "lix"; - rev = version; - hash = "sha256-Oqw04eboDM8rrUgAXiT7w5F2uGrQdt8sGX+Mk6mVXZQ="; - }; + lix-args = rec { + version = "2.94.0-pre-20250807_${builtins.substring 0 12 src.rev}"; - patches = [ - # Support for lowdown >= 1.4, https://gerrit.lix.systems/c/lix/+/3731 - (fetchpatch2 { - name = "lix-lowdown-1.4.0.patch"; - url = "https://git.lix.systems/lix-project/lix/commit/858de5f47a1bfd33835ec97794ece339a88490f1.patch"; - hash = "sha256-FfLO2dFSWV1qwcupIg8dYEhCHir2XX6/Hs89eLwd+SY="; - }) - ]; + src = fetchFromGitea { + domain = "git.lix.systems"; + owner = "lix-project"; + repo = "lix"; + rev = "8bbd5e1d0df9c31b4d86ba07bc85beb952e42ccb"; + hash = "sha256-P+WiN95OjCqHhfygglS/VOFTSj7qNdL5XQDo2wxhQqg="; + }; - cargoDeps = rustPlatform.fetchCargoVendor { - name = "lix-${version}"; - inherit src; - hash = "sha256-YMyNOXdlx0I30SkcmdW/6DU0BYc3ZOa2FMJSKMkr7I8="; + cargoDeps = rustPlatform.fetchCargoVendor { + name = "lix-${version}"; + inherit src; + hash = "sha256-APm8m6SVEAO17BBCka13u85/87Bj+LePP7Y3zHA3Mpg="; + }; }; }; - }; - - git = self.makeLixScope { - attrName = "git"; - - lix-args = rec { - version = "2.94.0-pre-20250807_${builtins.substring 0 12 src.rev}"; - src = fetchFromGitea { - domain = "git.lix.systems"; - owner = "lix-project"; - repo = "lix"; - rev = "8bbd5e1d0df9c31b4d86ba07bc85beb952e42ccb"; - hash = "sha256-P+WiN95OjCqHhfygglS/VOFTSj7qNdL5XQDo2wxhQqg="; + latest = self.lix_2_93; + + stable = self.lix_2_93; + + # Previously, `nix-eval-jobs` was not packaged here, so we export an + # attribute with the previously-expected structure for compatibility. This + # is also available (for now) as `pkgs.lixVersions`. + renamedDeprecatedLixVersions = + let + mkAlias = + version: + lib.warnOnInstantiate "'lixVersions.${version}' has been renamed to 'lixPackageSets.${version}.lix'" + self.${version}.lix; + in + lib.dontRecurseIntoAttrs { + # NOTE: Do not add new versions of Lix here. + stable = mkAlias "stable"; + latest = mkAlias "latest"; + } + // lib.optionalAttrs config.allowAliases { + # Legacy removed versions. We keep their aliases until the lixPackageSets one is dropped. + lix_2_90 = mkAlias "lix_2_90"; + lix_2_91 = mkAlias "lix_2_91"; }; - - cargoDeps = rustPlatform.fetchCargoVendor { - name = "lix-${version}"; - inherit src; - hash = "sha256-APm8m6SVEAO17BBCka13u85/87Bj+LePP7Y3zHA3Mpg="; - }; - }; - }; - - latest = self.lix_2_93; - - stable = self.lix_2_93; - - # Previously, `nix-eval-jobs` was not packaged here, so we export an - # attribute with the previously-expected structure for compatibility. This - # is also available (for now) as `pkgs.lixVersions`. - renamedDeprecatedLixVersions = - let - mkAlias = - version: - lib.warnOnInstantiate "'lixVersions.${version}' has been renamed to 'lixPackageSets.${version}.lix'" - self.${version}.lix; - in - lib.dontRecurseIntoAttrs { - lix_2_91 = mkAlias "lix_2_91"; - # NOTE: Do not add new versions of Lix here. - stable = mkAlias "stable"; - latest = mkAlias "latest"; - }; -}) + } + // lib.optionalAttrs config.allowAliases { + # Removed versions. + # When removing a version, add an alias with a date attached to it so we can clean it up after a while. + lix_2_90 = throw (removedMessage "2.90"); # added in 2025-09-11 + lix_2_91 = throw (removedMessage "2.91"); # added in 2025-09-11 + lix_2_92 = throw (removedMessage "2.92"); # added in 2025-09-11 + } +)