niksos/modules/other/home-manager.nix

41 lines
1 KiB
Nix
Raw Normal View History

{
config,
inputs,
lib,
self,
...
2024-05-05 12:38:40 +02:00
}: let
cfg = config.myOptions.other.home-manager;
2024-04-14 18:49:29 +02:00
inherit (config.myOptions.other.system) username;
2024-05-05 12:38:40 +02:00
inherit (lib) mkEnableOption mkIf;
in {
options.myOptions.other.home-manager = {
2024-04-05 22:59:32 +02:00
enable = mkEnableOption "home-manager";
enableDirenv = mkEnableOption "direnv";
};
config = mkIf cfg.enable {
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = {inherit inputs self;};
users.${username} = {
programs = {
home-manager.enable = true;
direnv = mkIf cfg.enableDirenv {
enable = true;
nix-direnv.enable = true;
};
};
home = {
inherit username;
homeDirectory = "/home/${username}";
stateVersion = lib.mkDefault "23.11";
};
};
};
};
}