wip: faulty first attempt at home-manager integration
This commit is contained in:
parent
b428b981b9
commit
17ef1c563d
8 changed files with 400 additions and 28 deletions
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));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue