2024-11-19 10:31:29 +01:00
|
|
|
{
|
|
|
|
options,
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
inputs,
|
|
|
|
...
|
|
|
|
}:
|
2024-03-21 15:00:36 +01:00
|
|
|
|
|
|
|
with lib;
|
|
|
|
with lib.metacfg;
|
2024-11-19 10:31:29 +01:00
|
|
|
let
|
|
|
|
cfg = config.metacfg.home;
|
2024-03-21 15:00:36 +01:00
|
|
|
in
|
|
|
|
{
|
|
|
|
options.metacfg.home = with types; {
|
2024-11-19 10:31:29 +01:00
|
|
|
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;
|
|
|
|
|
2024-11-19 10:31:29 +01:00
|
|
|
users.${config.metacfg.user.name} = mkAliasDefinitions options.metacfg.home.extraOptions;
|
2024-03-21 15:00:36 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|