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