nixos-config/modules/nixos/home/default.nix

39 lines
973 B
Nix

{
config,
lib,
namespace,
options,
...
}:
with lib;
with lib.${namespace};
let
cfg = config.${namespace}.home;
in
{
options.${namespace}.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 = {
${namespace}.home.extraOptions = {
home.stateVersion = config.system.stateVersion;
home.file = mkAliasDefinitions options.${namespace}.home.file;
xdg.enable = true;
xdg.configFile = mkAliasDefinitions options.${namespace}.home.configFile;
};
snowfallorg.users.${config.${namespace}.user.name}.home.config =
config.${namespace}.home.extraOptions;
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
};
};
}