niksos/modules/other/home-manager.nix

44 lines
1.1 KiB
Nix
Raw Normal View History

{
config,
inputs,
lib,
self,
...
2024-05-05 12:38:40 +02:00
}: let
2024-07-15 23:18:25 +02:00
cfg = config.poz.other.home-manager;
inherit (config.poz.other.system) username;
2024-05-05 12:38:40 +02:00
2024-07-25 11:45:44 +02:00
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
in {
2024-07-15 23:18:25 +02:00
options.poz.other.home-manager = {
2024-04-05 22:59:32 +02:00
enable = mkEnableOption "home-manager";
enableDirenv = mkEnableOption "direnv";
};
2024-07-15 21:30:03 +02:00
imports = [ inputs.home-manager.nixosModules.home-manager ];
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";
};
};
};
};
}