mirror of
https://github.com/mjallen18/snowfall-lib.git
synced 2026-04-18 09:05:58 -05:00
wip: home-manager support
This commit is contained in:
31
modules/darwin/home/default.nix
Normal file
31
modules/darwin/home/default.nix
Normal 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));
|
||||
}
|
||||
Reference in New Issue
Block a user