flake: fix and refactor the homeManagerModules alias (#1287)

Fixes: 0e5b1613bd ("stylix: rename homeManagerModules to homeModules (#1267)")
Link: https://github.com/danth/stylix/pull/1287

Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
This commit is contained in:
Matt Sturgeon 2025-05-16 23:37:10 +01:00 committed by GitHub
parent 31fff1c533
commit 88e1c23df2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 5 deletions

View file

@ -1,5 +1,6 @@
{
imports = [
./deprecated.nix
./dev-shell.nix
./modules.nix
./packages.nix

19
flake/deprecated.nix Normal file
View file

@ -0,0 +1,19 @@
{
lib,
self,
...
}:
{
# NOTE: the `flake` submodule has a `lazyAttrsOf` freeform type.
#
# This means a `mkIf false` definition will not omit the attr, because
# `lazyAttrsOf` adds an "empty value" stub throwing "used but not defined".
#
# Therefore, instead of doing `flake.foo = mkIf` you should do `flake = mkIf (…) { foo = …; }`.
# If you need multiple definitions with different conditions, use `flake = mkMerge [ … ]`.
# 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;
};
}

View file

@ -23,11 +23,6 @@
];
};
# Drop this alias after 26.05
homeManagerModules = lib.mkIf (lib.oldestSupportedReleaseIsAtLeast 2511) (
builtins.warn "stylix: flake output `homeManagerModules` has been renamed to `homeModules`" self.homeModules
);
homeModules.stylix =
{ pkgs, ... }@args:
{