2021-06-25 20:43:19 +02:00
|
|
|
{ config, inputs, lib, ... }:
|
2021-04-26 19:22:20 +02:00
|
|
|
let
|
2021-06-25 20:40:34 +02:00
|
|
|
actualPath = [ "home-manager" "users" config.my.user.name "my" "home" ];
|
2021-04-26 19:22:20 +02:00
|
|
|
aliasPath = [ "my" "home" ];
|
2021-06-25 20:43:19 +02:00
|
|
|
|
|
|
|
cfg = config.my.user.home;
|
2021-04-26 19:22:20 +02:00
|
|
|
in
|
|
|
|
{
|
|
|
|
imports = [
|
2023-03-11 21:43:39 +01:00
|
|
|
inputs.home-manager.nixosModules.home-manager # enable home-manager options
|
2021-06-25 20:43:19 +02:00
|
|
|
(lib.mkAliasOptionModule aliasPath actualPath) # simplify setting home options
|
2021-04-26 19:22:20 +02:00
|
|
|
];
|
2021-06-25 20:43:19 +02:00
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
home-manager = {
|
|
|
|
# Not a fan of out-of-directory imports, but this is a good exception
|
2021-09-25 15:10:20 +02:00
|
|
|
users.${config.my.user.name} = import ../../home;
|
2021-06-25 20:43:19 +02:00
|
|
|
|
|
|
|
# Nix Flakes compatibility
|
|
|
|
useGlobalPkgs = true;
|
|
|
|
useUserPackages = true;
|
2021-10-22 13:06:50 +02:00
|
|
|
|
|
|
|
# Forward inputs to home-manager configuration
|
|
|
|
extraSpecialArgs = {
|
|
|
|
inherit inputs;
|
|
|
|
};
|
2021-06-25 20:43:19 +02:00
|
|
|
};
|
|
|
|
};
|
2021-04-26 19:22:20 +02:00
|
|
|
}
|