Skip to content

Commit db84814

Browse files
committed
lix: add "removal messages" and restore old aliases
This ensures that evaluation doesn't suddenly break with cryptic messages and add a nice message for users. Change-Id: I1959ae7421c8a46ed93476bb014b84cfb26a4322 Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
1 parent 5d4210b commit db84814

File tree

1 file changed

+61
-41
lines changed

1 file changed

+61
-41
lines changed

pkgs/tools/package-management/lix/default.nix

Lines changed: 61 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
lib,
3+
config,
34
stdenv,
45
makeScopeWithSplicing',
56
generateSplicesForMkScope,
@@ -127,6 +128,12 @@ let
127128
};
128129
};
129130
};
131+
132+
removedMessage = version: ''
133+
Lix ${version} is now removed from this revision of Nixpkgs. Consider upgrading to stable or the latest version.
134+
135+
If you notice a problem while upgrading disrupting your workflows which did not occur in version ${version}, please reach out to the Lix team.
136+
'';
130137
in
131138
lib.makeExtensible (
132139
self:
@@ -147,53 +154,66 @@ lib.makeExtensible (
147154
hash = "sha256-Oqw04eboDM8rrUgAXiT7w5F2uGrQdt8sGX+Mk6mVXZQ=";
148155
};
149156

150-
cargoDeps = rustPlatform.fetchCargoVendor {
151-
name = "lix-${version}";
152-
inherit src;
153-
hash = "sha256-YMyNOXdlx0I30SkcmdW/6DU0BYc3ZOa2FMJSKMkr7I8=";
157+
cargoDeps = rustPlatform.fetchCargoVendor {
158+
name = "lix-${version}";
159+
inherit src;
160+
hash = "sha256-YMyNOXdlx0I30SkcmdW/6DU0BYc3ZOa2FMJSKMkr7I8=";
161+
};
154162
};
155163
};
156-
};
157164

158-
git = self.makeLixScope {
159-
attrName = "git";
165+
git = self.makeLixScope {
166+
attrName = "git";
160167

161-
lix-args = rec {
162-
version = "2.94.0-pre-20250807_${builtins.substring 0 12 src.rev}";
168+
lix-args = rec {
169+
version = "2.94.0-pre-20250807_${builtins.substring 0 12 src.rev}";
163170

164-
src = fetchFromGitea {
165-
domain = "git.lix.systems";
166-
owner = "lix-project";
167-
repo = "lix";
168-
rev = "8bbd5e1d0df9c31b4d86ba07bc85beb952e42ccb";
169-
hash = "sha256-P+WiN95OjCqHhfygglS/VOFTSj7qNdL5XQDo2wxhQqg=";
170-
};
171+
src = fetchFromGitea {
172+
domain = "git.lix.systems";
173+
owner = "lix-project";
174+
repo = "lix";
175+
rev = "8bbd5e1d0df9c31b4d86ba07bc85beb952e42ccb";
176+
hash = "sha256-P+WiN95OjCqHhfygglS/VOFTSj7qNdL5XQDo2wxhQqg=";
177+
};
171178

172-
cargoDeps = rustPlatform.fetchCargoVendor {
173-
name = "lix-${version}";
174-
inherit src;
175-
hash = "sha256-APm8m6SVEAO17BBCka13u85/87Bj+LePP7Y3zHA3Mpg=";
179+
cargoDeps = rustPlatform.fetchCargoVendor {
180+
name = "lix-${version}";
181+
inherit src;
182+
hash = "sha256-APm8m6SVEAO17BBCka13u85/87Bj+LePP7Y3zHA3Mpg=";
183+
};
176184
};
177185
};
178-
};
179-
180-
latest = self.lix_2_93;
181-
182-
stable = self.lix_2_93;
183186

184-
# Previously, `nix-eval-jobs` was not packaged here, so we export an
185-
# attribute with the previously-expected structure for compatibility. This
186-
# is also available (for now) as `pkgs.lixVersions`.
187-
renamedDeprecatedLixVersions =
188-
let
189-
mkAlias =
190-
version:
191-
lib.warnOnInstantiate "'lixVersions.${version}' has been renamed to 'lixPackageSets.${version}.lix'"
192-
self.${version}.lix;
193-
in
194-
lib.dontRecurseIntoAttrs {
195-
# NOTE: Do not add new versions of Lix here.
196-
stable = mkAlias "stable";
197-
latest = mkAlias "latest";
198-
};
199-
})
187+
latest = self.lix_2_93;
188+
189+
stable = self.lix_2_93;
190+
191+
# Previously, `nix-eval-jobs` was not packaged here, so we export an
192+
# attribute with the previously-expected structure for compatibility. This
193+
# is also available (for now) as `pkgs.lixVersions`.
194+
renamedDeprecatedLixVersions =
195+
let
196+
mkAlias =
197+
version:
198+
lib.warnOnInstantiate "'lixVersions.${version}' has been renamed to 'lixPackageSets.${version}.lix'"
199+
self.${version}.lix;
200+
in
201+
lib.dontRecurseIntoAttrs {
202+
# NOTE: Do not add new versions of Lix here.
203+
stable = mkAlias "stable";
204+
latest = mkAlias "latest";
205+
}
206+
// lib.optionalAttrs config.allowAliases {
207+
# Legacy removed versions. We keep their aliases until the lixPackageSets one is dropped.
208+
lix_2_90 = mkAlias "lix_2_90";
209+
lix_2_91 = mkAlias "lix_2_91";
210+
};
211+
}
212+
// lib.optionalAttrs config.allowAliases {
213+
# Removed versions.
214+
# When removing a version, add an alias with a date attached to it so we can clean it up after a while.
215+
lix_2_90 = throw (removedMessage "2.90"); # added in 2025-09-11
216+
lix_2_91 = throw (removedMessage "2.91"); # added in 2025-09-11
217+
lix_2_92 = throw (removedMessage "2.92"); # added in 2025-09-11
218+
}
219+
)

0 commit comments

Comments
 (0)