dotfiles/modules/nixos/home/default.nix

58 lines
1.4 KiB
Nix
Raw Permalink Normal View History

2023-03-12 03:59:11 +00:00
{
options,
config,
lib,
inputs,
namespace,
2023-03-12 03:59:11 +00:00
...
}: let
inherit (lib) mkAliasDefinitions mkOption;
inherit (lib.types) attrs;
2023-03-12 03:59:11 +00:00
in {
imports = with inputs; [
home-manager.nixosModules.home-manager
];
options.${namespace}.home = {
2023-03-12 03:59:11 +00:00
file = mkOption {
type = attrs;
default = {};
description = "A set of files to be manged by home-manager's <option>home.file</option> option.";
};
configFile = mkOption {
type = attrs;
default = {};
2023-03-19 15:16:10 +00:00
description = "A set of files to be managed by home-manager's <option>xdg.configFile</option>.";
2023-03-12 03:59:11 +00:00
};
2023-03-30 02:56:27 +00:00
dataFile = mkOption {
type = attrs;
default = {};
description = "A set of files to be managed by home-manager's <option>xdg.dataFile</option>.";
};
2023-03-12 03:59:11 +00:00
extraOptions = mkOption {
type = attrs;
default = {};
description = "Options to pass directly to home-manager.";
};
};
config = {
${namespace}.home.extraOptions = {
2023-03-12 03:59:11 +00:00
home.stateVersion = config.system.stateVersion;
home.file = mkAliasDefinitions options.aa.home.file;
2023-12-07 03:27:47 +00:00
xdg = {
enable = true;
configFile = mkAliasDefinitions options.aa.home.configFile;
dataFile = mkAliasDefinitions options.aa.home.dataFile;
};
2023-03-12 03:59:11 +00:00
};
home-manager = {
useUserPackages = true;
users.${config.aa.user.name} =
mkAliasDefinitions options.aa.home.extraOptions;
};
};
}