From 63317618dfb30f07aa36a45e83f09331e2c87c03 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Tue, 21 Jan 2025 14:42:56 -0500 Subject: [PATCH] docs: add generated homeManagerModules readme --- apps/gen-docs/script.sh | 3 +- apps/gen-docs/templates/homeManagerModules.md | 11 +++++ homeManagerModules/README.md | 11 +++++ homeManagerModules/default.nix | 40 +++++++++++++++++-- 4 files changed, 60 insertions(+), 5 deletions(-) create mode 100644 apps/gen-docs/templates/homeManagerModules.md create mode 100644 homeManagerModules/README.md diff --git a/apps/gen-docs/script.sh b/apps/gen-docs/script.sh index 286aa50c..3ae5510f 100755 --- a/apps/gen-docs/script.sh +++ b/apps/gen-docs/script.sh @@ -20,9 +20,10 @@ substituteModule() { ) -t markdown --template "$FLAKE/apps/gen-docs/templates/$1.md" -o "$FLAKE/$1/README.md" } -# TODO: add homeManagerModules, lib, modules, nixFastChecks, overlays, scopedPackages +# TODO: add lib, nixFastChecks, overlays, scopedPackages substitute "appsPackages" "apps" "getPackageMeta" substitute "nixosConfigurations" "configurations" "getConfigMeta" substitute "devShells" "devShells" "getPackageMeta" substitute "packages" "packages" "getPackageMeta" substituteModule "modules" +substituteModule "homeManagerModules" diff --git a/apps/gen-docs/templates/homeManagerModules.md b/apps/gen-docs/templates/homeManagerModules.md new file mode 100644 index 00000000..35b85652 --- /dev/null +++ b/apps/gen-docs/templates/homeManagerModules.md @@ -0,0 +1,11 @@ +# homeManagerModules + +This directory contains every home-manager modules exposed by this flake. + +## List of my home-manager modules found in `self.homeManagerModules` + +| Name | Description | +| ---- | ----------- | +$for(attrs/pairs)$ +| `$it.key$` | $it.value.desc/nowrap$ | +$endfor$ diff --git a/homeManagerModules/README.md b/homeManagerModules/README.md new file mode 100644 index 00000000..bc6276f6 --- /dev/null +++ b/homeManagerModules/README.md @@ -0,0 +1,11 @@ +# homeManagerModules + +This directory contains every home-manager modules exposed by this flake. + +## List of my home-manager modules found in `self.homeManagerModules` + +| Name | Description | +| ---- | ----------- | +| `firefox` | Uses the home-manager firefox module to declare my custom configuration which includes my list of extensions, my adapted [firefox-gx](https://github.com/Godiesc/firefox-gx) theme and other settings. | +| `neovim` | Uses the home-manager neovim module to declare my custom configuration and expands it with toggles for certain LSPs. This configuration loads corresponding devShells of the current language from `self.devShells` dynamically to support various LSPs. | +| `shell` | Extends the bash home-manager options to set some bash options, aliases themes that follow Dracula Theme and settings for CLI programs, such as starship, trash-d, nix-comma, nix-direnv, git, etc. | diff --git a/homeManagerModules/default.nix b/homeManagerModules/default.nix index 3a1ccb94..e938c018 100644 --- a/homeManagerModules/default.nix +++ b/homeManagerModules/default.nix @@ -1,5 +1,37 @@ -self: { - firefox = import ./firefox self; - neovim = import ./neovim self; - shell = import ./shell self; +{ + self ? {}, + description ? false, +}: let + module = mod: desc: + if description + then desc + else mod; +in { + firefox = + module + (import ./firefox self) + '' + Uses the home-manager firefox module to declare my custom configuration + which includes my list of extensions, my adapted [firefox-gx](https://github.com/Godiesc/firefox-gx) + theme and other settings. + ''; + + neovim = + module + (import ./neovim self) + '' + Uses the home-manager neovim module to declare my custom configuration + and expands it with toggles for certain LSPs. This configuration loads + corresponding devShells of the current language from `self.devShells` + dynamically to support various LSPs. + ''; + + shell = + module + (import ./shell self) + '' + Extends the bash home-manager options to set some bash options, aliases + themes that follow Dracula Theme and settings for CLI programs, such as + starship, trash-d, nix-comma, nix-direnv, git, etc. + ''; }