Hello everyone,
I am trying to make my config more modular with nixos and home-manager
modules. but i got an infinate recursion on the config variable.
Its in the modules/home-manager/style/desktop.nix and the trace is as folows
… while calling the 'pathExists' builtin
at /nix/store/s2whbxg6alsh3g1ah412rijidmihpg7p-source/modules/home-manager/style/desktop.nix:14:9:
13| themeImage =
14| if (builtins.pathExists imagePath)
| ^
15| then imagePath
… from call site
at /nix/store/s2whbxg6alsh3g1ah412rijidmihpg7p-source/modules/home-manager/style/desktop.nix:10:14:
9|
10| themeCfg = config.strixos.style.theme;
| ^
11| themeFile = themeCfg.themeDir + "/theme.toml";
… while calling anonymous lambda
at /nix/store/708n1gvb7yizlay48z15cx51ciicvv2a-source/lib/modules.nix:652:15:
651| extraArgs = mapAttrs (
652| name: _: addErrorContext (context name) (args.${name} or config._module.args.${name})
| ^
653| ) (functionArgs f);
… while evaluating the module argument `config' in "/nix/store/s2whbxg6alsh3g1ah412rijidmihpg7p-source/modules/home-manager/style/desktop.nix":
… while evaluating the attribute 'config'
at /nix/store/708n1gvb7yizlay48z15cx51ciicvv2a-source/lib/modules.nix:257:21:
256| options
257| config
| ^
258| specialArgs
error: infinite recursion encountered
at /nix/store/708n1gvb7yizlay48z15cx51ciicvv2a-source/lib/modules.nix:257:21:
256| options
257| config
| ^
258| specialArgs
I dont understand why this happens.
I’d also like to import other modules like stylix in my module
but because stylix is branch specific i need something like
imports = [
inputs."stylix-${config.strixos.branch}".homeManagerModule.stylix
];
but this also creates a recursion loop.
the repository where my config lives: github - nix-config