home-manager: modularize home configurations

This commit is contained in:
xinyangli 2023-12-24 18:53:47 +08:00
parent ac9918c759
commit 552cc4f144
16 changed files with 261 additions and 227 deletions

View file

@ -6,7 +6,7 @@ let
cfg = config.custom-hm.fish;
in
{
options = {
options.custom-hm.fish = {
enable = mkEnableOption "fish";
plugins = mkOption {
type = types.listOf types.str;
@ -30,9 +30,9 @@ in
programs.fish = mkIf cfg.enable {
enable = true;
plugins = with pkgs; filter (
e: hasAttr e.name builtins.listToAttrs # { "xxx" = true; }
e: hasAttr e.name (builtins.listToAttrs # { "xxx" = true; }
(map (p: { name = p; value = true; }) cfg.plugins) # { name = "xxx"; value = true; }
) [
)) [
{
name = "pisces";
src = fishPlugins.pisces.src;