{ config, inputs, lib, ... }: let cfg = config.poz.other.home-manager; inherit (config.poz.other.system) username; inherit (lib.modules) mkIf; inherit (lib.options) mkEnableOption; in { options.poz.other.home-manager = { enable = mkEnableOption "home-manager"; enableDirenv = mkEnableOption "direnv"; }; imports = [ inputs.home-manager.nixosModules.home-manager ]; config = mkIf cfg.enable { home-manager = { useUserPackages = true; useGlobalPkgs = true; 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"; }; }; }; }; }