nixos/modules/home/default.nix
2024-05-27 19:45:14 +02:00

43 lines
946 B
Nix

inputs@{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.modules.home;
userOpts = { name, userconfig, ... }: {
options = {};
config = {
# home = {
# username = name;
# homeDirectory = "/home/${name}";
# stateVersion = "24.05";
# };
};
};
in
{
options.modules.home = {
users = mkOption {
default = {};
type = with types; attrsOf (submodule userOpts);
example = {
alice = {
shell.atuin.enable = true;
shell.direnv.enable = true;
shell.git.enable = true;
shell.zsh.enable = true;
};
};
description = ''
Additional user home configuration
'';
};
};
config = {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = inputs;
home-manager.users = mapAttrs (name: userconfig: import ./home.nix) cfg.users;
};
}