From 88e1c23df2d8c47e23f744389822e3c45f1bfc19 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Fri, 16 May 2025 23:37:10 +0100 Subject: [PATCH] flake: fix and refactor the `homeManagerModules` alias (#1287) Fixes: 0e5b1613bd92 ("stylix: rename homeManagerModules to homeModules (#1267)") Link: https://github.com/danth/stylix/pull/1287 Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com> --- flake/default.nix | 1 + flake/deprecated.nix | 19 +++++++++++++++++++ flake/modules.nix | 5 ----- 3 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 flake/deprecated.nix 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: {