EmergentMind / nix-config

A continually evolving multi-user, multi-host NixOS configuration.
MIT License
162 stars 16 forks source link

lib.scanPaths not picking up files in hosts/common/core/services/ #6

Closed DrymarchonShaun closed 1 week ago

DrymarchonShaun commented 2 weeks ago

It seems configLib.scanPaths isn't detecting files in hosts/common/core/services. I've added the file hosts/common/core/services/polkit.nix in my fork and its contents aren't taking effect unless I add the file directly to my device config. I suspect it isn't pulling in anything from that directory.

EmergentMind commented 2 weeks ago

Looks like I misinterpreted scanPaths as pulling in files recursively from child directories but in fact it simply adds the path to those directories. So nix will automatically look to the child directory's default.nix file for additional import declarations.

configLib.scanPaths could be modified to be recursive but for the time being I'll likely just modify hosts/common/core/services/default.nix to be:

{ input, outputs, configLib, ... }: {
  imports = (configLib.scanPaths ./.);
}

This could make debugging even blurrier though due to sort of doubling up scanPaths calls.

No time to make the change and test just yet though.

EmergentMind commented 1 week ago

Should be resolved with: https://github.com/EmergentMind/nix-config/commit/98f0994ccb6d9b35ad32d9505a0543f9b4e166ea

Apologies that commit history is a mess today. I'm trying to get caught up with too many things at once and sort of have myself painted into a corner.