Bruno BELANYI
c856933803
Let's consolidate all modules under one path, so that NixOS, home-manager, and nix-darwin (if I ever end up using it down the line) would go under the same folder.
30 lines
775 B
Nix
30 lines
775 B
Nix
{ 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 = {
|
|
# Not a fan of out-of-directory imports, but this is a good exception
|
|
users.${config.my.user.name} = import "${inputs.self}/home";
|
|
|
|
# Nix Flakes compatibility
|
|
useGlobalPkgs = true;
|
|
useUserPackages = true;
|
|
|
|
# Forward inputs to home-manager configuration
|
|
extraSpecialArgs = {
|
|
inherit inputs;
|
|
};
|
|
};
|
|
};
|
|
}
|