Skip to content

Commit c497249

Browse files
committed
fix(home-manager): resolve infinite recursion in imports.nix
Move isDarwin evaluation from top-level let binding into the config section to avoid infinite recursion when evaluating standalone home-manager configurations. The issue occurred because: 1. isDarwin = pkgs.stdenv.hostPlatform.isDarwin was evaluated early 2. This required pkgs to be fully evaluated 3. pkgs evaluation required config evaluation 4. config evaluation required foreground.enable 5. foreground.enable tried to use isDarwin 6. Infinite loop Fix: Inline the pkgs.stdenv.hostPlatform.isDarwin check directly in the config section where it's used, allowing lazy evaluation. This fixes the GitHub Actions error: error: infinite recursion encountered while evaluating packages.x86_64-linux.static-home
1 parent 019bc1d commit c497249

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

modules/home-manager/imports.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
...
66
}@args:
77
let
8-
isDarwin = pkgs.stdenv.hostPlatform.isDarwin;
98
# Check if we're on NixOS (osConfig.system.tags exists)
109
isNixOS = args ? osConfig && osConfig ? system && osConfig.system ? tags;
1110
in
@@ -51,7 +50,7 @@ in
5150
# Darwin and NixOS common configuration
5251
(lib.mkIf (args ? osConfig) {
5352
foreground.enable = lib.mkDefault (
54-
if isDarwin then
53+
if pkgs.stdenv.hostPlatform.isDarwin then
5554
true # Always enable on Darwin
5655
else
5756
osConfig.programs.enable # Use NixOS custom option

0 commit comments

Comments
 (0)