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 (inputs // { name = name; userconfig = userconfig; }))) cfg.users; }; }