nixcfg/modules/nixos/home/default.nix

40 lines
931 B
Nix
Raw Normal View History

{
options,
config,
pkgs,
lib,
inputs,
...
}:
2024-03-21 15:00:36 +01:00
with lib;
with lib.metacfg;
let
cfg = config.metacfg.home;
2024-03-21 15:00:36 +01:00
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`."
);
2024-03-21 15:00:36 +01:00
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;
2024-03-21 15:00:36 +01:00
};
};
}