nixcfg/modules/nixos/home/default.nix
Harald Hoyer 900f95169f nix fmt
Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2024-11-19 10:31:29 +01:00

40 lines
931 B
Nix

{
options,
config,
pkgs,
lib,
inputs,
...
}:
with lib;
with lib.metacfg;
let
cfg = config.metacfg.home;
in
{
options.metacfg.home = with types; {
file = mkOpt attrs { } (mdDoc "A set of files to be managed by home-manager's `home.file`.");
configFile = mkOpt attrs { } (
mdDoc "A set of files to be managed by home-manager's `xdg.configFile`."
);
extraOptions = mkOpt attrs { } "Options to pass directly to home-manager.";
};
config = {
metacfg.home.extraOptions = {
home.stateVersion = config.system.stateVersion;
home.file = mkAliasDefinitions options.metacfg.home.file;
xdg.enable = true;
xdg.configFile = mkAliasDefinitions options.metacfg.home.configFile;
};
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
users.${config.metacfg.user.name} = mkAliasDefinitions options.metacfg.home.extraOptions;
};
};
}