wip: home-manager support

This commit is contained in:
Jake Hamilton 2023-05-27 12:24:20 -07:00
parent 4d6fdba390
commit 9e4d359699
No known key found for this signature in database
GPG key ID: 9762169A1B35EA68
3 changed files with 48 additions and 8 deletions

View file

@ -0,0 +1,31 @@
{ lib, options, ... }:
let
inherit (lib) types mkOption mkIf mkMerge mkAliasDefinitions;
cfg = options.snowfallorg;
in
{
options.snowfallorg = {
home = mkOption {
description = "Configuration for home-manager.";
type = types.attrsOf (types.submodule ({ name, ... }: {
options.config = {
type = types.attrs;
default = { };
};
}));
};
resolvedHomes = mkOption {
type = types.attrs;
default = { };
};
};
config = mkMerge (builtins.map
(name: {
snowfallorg.resolvedHomes.${name} = mkAliasDefinitions options.snowfallorg.home.${name}.config;
})
(builtins.attrNames cfg.home));
}