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

37 lines
940 B
Nix
Raw Normal View History

{ config, inputs, lib, ... }:
let
actualPath = [ "home-manager" "users" config.my.user.name "my" "home" ];
aliasPath = [ "my" "home" ];
cfg = config.my.user.home;
in
{
imports = [
inputs.home-manager.nixosModules.home-manager # enable home-manager options
(lib.mkAliasOptionModule aliasPath actualPath) # simplify setting home options
];
config = lib.mkIf cfg.enable {
home-manager = {
2024-01-03 17:50:05 +01:00
users.${config.my.user.name} = {
# Not a fan of out-of-directory imports, but this is a good exception
imports = [
"${inputs.self}/modules/common"
"${inputs.self}/modules/home"
];
};
# Nix Flakes compatibility
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
2024-01-03 17:50:05 +01:00
# Forward inputs to home-manager configuration
inherit inputs;
2024-01-03 17:50:05 +01:00
# For consumption by common modules
type = "home";
};
};
};
}