wip: faulty first attempt at home-manager integration

This commit is contained in:
Jake Hamilton 2023-04-10 15:59:57 -07:00
parent b428b981b9
commit 17ef1c563d
No known key found for this signature in database
GPG key ID: 9762169A1B35EA68
8 changed files with 400 additions and 28 deletions

View file

@ -0,0 +1,33 @@
{ lib, config, ... }:
let
inherit (lib) types mkOption mkMerge mapAttrsToList;
home-submodule = { name, ... }: {
options = {
proxy = mkOption {
type = types.attrs;
default = { };
description = "Configuration to be proxied to the home-manager configuration for `home-manager.users.<name>`.";
};
};
};
cfg = config.snowfallorg;
in
{
options.snowfallorg = {
home = mkOption {
type = types.attrsOf (types.submodule home-submodule);
default = { };
description = "Options for configuring home environments.";
};
};
config = mkMerge
(mapAttrsToList
(name: value: {
home-manager.users.${name} = value.proxy;
})
(cfg.home));
}