{ lib, config, pkgs, inputs, ... }: let # Default username fallback username = config.defaultUser or "henrov"; # Asset folder for configs assetPath = ../../../assets//conf; # Main configuration file mainConfig = "${assetPath}/"; # Determine the package: prefer Nixpkgs, fallback to -git, fallback to flake input myPkg = pkgs. or pkgs.-git or inputs..packages.${pkgs.system}.default; in { # Install system-wide environment.systemPackages = [ myPkg ]; # Home Manager user settings _module.args.hmUsers = { ${username} = { home.packages = [ myPkg ]; # Copy main config into user's home home.file.".config//".source = mainConfig; # Optional module-specific settings settings.general = { # Example placeholder "example.setting" = "value"; }; # Optional: you can add more files dynamically from assetPath if needed }; }; }