2024-02-14 15:29:00 +01:00
|
|
|
{
|
|
|
|
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;
|
2024-02-14 15:29:00 +01:00
|
|
|
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-02-14 15:29:00 +01:00
|
|
|
};
|
|
|
|
|
2024-07-15 21:30:03 +02:00
|
|
|
imports = [ inputs.home-manager.nixosModules.home-manager ];
|
|
|
|
|
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";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|