flake: include 'until' in rename warning

This commit is contained in:
Matt Sturgeon 2025-06-04 15:39:14 +01:00
parent 47553c06fb
commit 3945a2d349
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
2 changed files with 9 additions and 3 deletions

View file

@ -18,7 +18,7 @@
# Drop this alias after 26.05
flake = lib.mkIf (!lib.oldestSupportedReleaseIsAtLeast 2605) {
homeManagerModules = builtins.warn "stylix: flake output `homeManagerModules` has been renamed to `homeModules`" self.homeModules;
homeManagerModules = builtins.warn "stylix: flake output `homeManagerModules` has been renamed to `homeModules` and will be removed after 26.05." self.homeModules;
};
perSystem.stylix.aliases = [

View file

@ -64,12 +64,18 @@
system
attr
]) { inherit old new; };
names = builtins.mapAttrs (_: lib.showAttrPath) paths;
names = builtins.mapAttrs (_: lib.showAttrPath) paths // {
until = lib.pipe until [
builtins.toString
(builtins.match "([[:digit:]]{2})([[:digit:]]{2})")
(lib.concatStringsSep ".")
];
};
in
lib.mkIf (!lib.oldestSupportedReleaseIsAtLeast until) (
lib.attrsets.setAttrByPath paths.old (
lib.warnIf (since != null -> lib.oldestSupportedReleaseIsAtLeast since)
"stylix: flake output `${names.old}` has been renamed to `${names.new}`."
"stylix: flake output `${names.old}` has been renamed to `${names.new}` and will be removed after ${names.until}."
(cfg.${output}.${new} or (throw "stylix: flake alias not found: ${names.new}"))
)
);