mirror of
https://github.com/mjallen18/snowfall-lib.git
synced 2026-04-18 09:05:58 -05:00
wip: faulty first attempt at home-manager integration
This commit is contained in:
33
modules/darwin/home/default.nix
Normal file
33
modules/darwin/home/default.nix
Normal 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));
|
||||
}
|
||||
28
modules/home/os/default.nix
Normal file
28
modules/home/os/default.nix
Normal file
@@ -0,0 +1,28 @@
|
||||
{ lib, osConfig ? { }, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) types mkOption;
|
||||
|
||||
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>`.";
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
options.snowfallorg = {
|
||||
home = mkOption {
|
||||
type = types.attrsOf (types.submodule home-submodule);
|
||||
default = { };
|
||||
description = "Options for configuring home environments.";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
# snowfallorg.home = osConfig.snowfallorg.home or { };
|
||||
};
|
||||
}
|
||||
33
modules/nixos/home/default.nix
Normal file
33
modules/nixos/home/default.nix
Normal 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));
|
||||
}
|
||||
Reference in New Issue
Block a user