nix/modules/home-manager.nix

35 lines
No EOL
924 B
Nix

{ lib, pkgs, config, inputs, self, ...}: let
inherit (lib) mkIf mkEnableOption mkOption;
cfg = config.chuj.home-manager;
user = config.chuj.system.user;
in {
options.chuj.home-manager = {
enable = mkEnableOption "home-manager";
};
# https://git.jacekpoz.pl/jacekpoz/niksos/src/branch/main/modules/other/home-manager.nix
# imports = [ inputs.home-manager.nixosModules.home-manager ];
config = mkIf cfg.enable {
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = { inherit inputs self; };
users.${user} = {
programs = {
home-manager.enable = true;
direnv = {
enable = true;
nix-direnv.enable = true;
};
};
home = {
username = user;
homeDirectory = "/home/${user}";
stateVersion = lib.mkDefault "23.11";
};
};
};
};
}