diff --git a/flake/default.nix b/flake/default.nix index f0978e97..c77db1b1 100644 --- a/flake/default.nix +++ b/flake/default.nix @@ -1,5 +1,6 @@ { imports = [ + ./deprecated.nix ./dev-shell.nix ./modules.nix ./packages.nix diff --git a/flake/deprecated.nix b/flake/deprecated.nix new file mode 100644 index 00000000..5fbeb5c7 --- /dev/null +++ b/flake/deprecated.nix @@ -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; + }; +} diff --git a/flake/modules.nix b/flake/modules.nix index 15f14c2b..f1f16d72 100644 --- a/flake/modules.nix +++ b/flake/modules.nix @@ -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: {