74 lines
2.0 KiB
Nix
74 lines
2.0 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
options,
|
|
namespace,
|
|
inputs,
|
|
system,
|
|
...
|
|
}:
|
|
let
|
|
isArm = ("aarch64-linux" == system) || ("aarch64-darwin" == system);
|
|
in
|
|
{
|
|
|
|
options.${namespace}.home = with lib.types; {
|
|
configFile = lib.mkOption {
|
|
type = attrs;
|
|
default = { };
|
|
description = "A set of files to be managed by home-manager's <option>xdg.configFile</option>.";
|
|
};
|
|
extraOptions = lib.mkOption {
|
|
type = attrs;
|
|
default = { };
|
|
description = "Options to pass directly to home-manager.";
|
|
};
|
|
file = lib.mkOption {
|
|
type = attrs;
|
|
default = { };
|
|
description = "A set of files to be managed by home-manager's <option>home.file</option>.";
|
|
};
|
|
};
|
|
|
|
config = {
|
|
# ${namespace}.home.extraOptions = {
|
|
# home.file = lib.mkAliasDefinitions options.${namespace}.home.file;
|
|
# home.stateVersion = lib.mkOptionDefault config.system.stateVersion;
|
|
# xdg.configFile = lib.mkAliasDefinitions options.${namespace}.home.configFile;
|
|
# xdg.enable = lib.mkOptionDefault true;
|
|
# };
|
|
|
|
home-manager = {
|
|
# enables backing up existing files instead of erroring if conflicts exist
|
|
backupFileExtension = "backup";
|
|
|
|
useGlobalPkgs = true;
|
|
useUserPackages = true;
|
|
|
|
# Pass inputs so external modules can access them
|
|
extraSpecialArgs = {
|
|
inherit inputs;
|
|
overlays = with inputs; [
|
|
nix-vscode-extensions.overlays.default
|
|
];
|
|
};
|
|
|
|
# Make ALL external HM modules available globally
|
|
sharedModules =
|
|
with inputs;
|
|
[
|
|
sops-nix.homeManagerModules.sops
|
|
# Add any other external HM modules here
|
|
]
|
|
++ (if (!isArm) then with inputs; [ steam-rom-manager.homeManagerModules.default ] else [ ]);
|
|
|
|
users.${config.${namespace}.user.name} =
|
|
lib.mkAliasDefinitions
|
|
options.${namespace}.home.extraOptions;
|
|
# users.admin = lib.mkAliasDefinitions options.${namespace}.home.extraOptions;
|
|
|
|
verbose = true;
|
|
};
|
|
};
|
|
}
|