41 lines
1022 B
Nix
41 lines
1022 B
Nix
{ lib, config, pkgs, inputs, ... }:
|
|
|
|
let
|
|
# Default username fallback
|
|
username = config.defaultUser or "henrov";
|
|
|
|
# Asset folder for configs
|
|
assetPath = ../../../assets/<myModuleName>/conf;
|
|
|
|
# Main configuration file
|
|
mainConfig = "${assetPath}/<mainConfigFile>";
|
|
|
|
# Determine the package: prefer Nixpkgs, fallback to -git, fallback to flake input
|
|
myPkg =
|
|
pkgs.<myPackage> or
|
|
pkgs.<myPackage>-git or
|
|
inputs.<myPackage>.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/<myModuleName>/<mainConfigFile>".source = mainConfig;
|
|
|
|
# Optional module-specific settings
|
|
settings.general = {
|
|
# Example placeholder
|
|
"example.setting" = "value";
|
|
};
|
|
|
|
# Optional: you can add more files dynamically from assetPath if needed
|
|
};
|
|
};
|
|
}
|