2021-09-30 17:54:04 -07:00
|
|
|
{ doom-emacs, niten-doom-config, ... }:
|
|
|
|
|
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
user-configs = {
|
|
|
|
niten = ./niten.nix;
|
|
|
|
root = ./niten.nix;
|
|
|
|
viator = ./niten.nix;
|
|
|
|
xiaoxuan = ./xiaoxuan.nix;
|
|
|
|
};
|
|
|
|
|
|
|
|
hostname = config.instance.hostname;
|
|
|
|
enable-gui = config.fudo.hosts.${hostname}.enable-gui;
|
|
|
|
|
2021-10-02 16:30:31 -07:00
|
|
|
user-config-map = {
|
|
|
|
niten = ./niten.nix;
|
|
|
|
# FIXME: Root shouldn't have all this stuff installed!
|
|
|
|
root = ./niten.nix;
|
|
|
|
viator = ./niten.nix;
|
|
|
|
xiaoxuan = ./xiaoxuan.nix;
|
|
|
|
};
|
|
|
|
|
|
|
|
local-users = let
|
|
|
|
local-usernames = attrNames config.instance.local-users;
|
|
|
|
in filterAttrs
|
|
|
|
(username: userOpts: elem username local-usernames)
|
|
|
|
user-config-map;
|
|
|
|
|
2021-09-30 17:54:04 -07:00
|
|
|
in {
|
|
|
|
config.home-manager = {
|
|
|
|
useGlobalPkgs = true;
|
|
|
|
|
|
|
|
users = let
|
|
|
|
generate-config = username: config-file: let
|
|
|
|
user-cfg = config.fudo.users.${username};
|
2021-10-03 10:19:12 -07:00
|
|
|
user-email = if (user-cfg.email != null) then
|
|
|
|
user-cfg.email else "${username}@${config.instance.local-domain}";
|
|
|
|
home-dir = config.users.users.${username}.home;
|
2023-11-06 15:45:46 -08:00
|
|
|
in ((import user-configs.${username} {
|
2021-10-02 16:30:31 -07:00
|
|
|
inherit
|
|
|
|
doom-emacs
|
|
|
|
niten-doom-config
|
|
|
|
username
|
|
|
|
user-email
|
|
|
|
home-dir
|
2023-11-06 15:34:48 -08:00
|
|
|
enable-gui
|
2023-11-06 15:45:46 -08:00
|
|
|
}) { inherit pkgs; });
|
2021-10-02 16:30:31 -07:00
|
|
|
in mapAttrs generate-config local-users;
|
2021-09-30 17:54:04 -07:00
|
|
|
};
|
|
|
|
}
|