refactor(wisdom): rename wisdomSimpleSlice to wisdomSlice

Rename the helper function `wisdomSimpleSlice` to `wisdomSlice` across
the codebase and update documentation to reflect the new naming
convention. This change simplifies the API for creating trivial
single-package slices.
This commit is contained in:
2026-07-17 11:44:56 -03:00
parent 0939766e3a
commit 548a438f6a
9 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -174,7 +174,7 @@ The integration block at the bottom of `modules/system/users.nix` turns the cata
**New HM slice:** add `modules/wisdom/.../foo.nix` exporting `flake.homeManagerModules.wisdomFoo` (import-tree picks it up; `wisdomCatalogExtraModules` includes every `wisdom*` export). Every `wisdom*` slice auto-catalogs — including the bash shell — so the root module no longer manually `imports` it. Gate packages on `chiasson.home.*.enable`, and set the slice's own `enable` default with `mkEnableOption "…" // { default = true/false }` in that same module — defaults live with the option that owns them, not in a shared defaults file. Hosts flip toggles in `home.nix`. Upstream HM deps stay imported unconditionally — use `mkIf` on `cfg.enable` for config (never `config`-dependent `imports`; that recurses). **New HM slice:** add `modules/wisdom/.../foo.nix` exporting `flake.homeManagerModules.wisdomFoo` (import-tree picks it up; `wisdomCatalogExtraModules` includes every `wisdom*` export). Every `wisdom*` slice auto-catalogs — including the bash shell — so the root module no longer manually `imports` it. Gate packages on `chiasson.home.*.enable`, and set the slice's own `enable` default with `mkEnableOption "…" // { default = true/false }` in that same module — defaults live with the option that owns them, not in a shared defaults file. Hosts flip toggles in `home.nix`. Upstream HM deps stay imported unconditionally — use `mkIf` on `cfg.enable` for config (never `config`-dependent `imports`; that recurses).
**Trivial single-package slice:** use `self.lib.wisdomSimpleSlice { path = "a.b"; default = true/false; description = "…"; packages = pkgs: [ … ]; }` instead of the `root`/`cfg` + `mkIf (root.enable && cfg.enable)` boilerplate. `packages` is a `pkgs -> [ drv ]` function responsible for its own `availableOn`/platform gating. Several such slices may share one `simple.nix` in their category dir (each still exporting its own `wisdom*` module), rather than one file per slice. **Trivial single-package slice:** use `self.lib.wisdomSlice { path = "a.b"; default = true/false; description = "…"; packages = pkgs: [ … ]; }` instead of the `root`/`cfg` + `mkIf (root.enable && cfg.enable)` boilerplate. `packages` is a `pkgs -> [ drv ]` function responsible for its own `availableOn`/platform gating. Several such slices may share one `simple.nix` in their category dir (each still exporting its own `wisdom*` module), rather than one file per slice.
**Derivations:** `let` inside a fragment, or `flake.packages` / `flake.lib` — not a bare `mkDerivation` file import-tree will try to load. **Derivations:** `let` inside a fragment, or `flake.packages` / `flake.lib` — not a bare `mkDerivation` file import-tree will try to load.
+1 -1
View File
@@ -11,7 +11,7 @@
in in
map (name: self.homeManagerModules.${name}) names; map (name: self.homeManagerModules.${name}) names;
flake.lib.wisdomSimpleSlice = flake.lib.wisdomSlice =
{ path, default, description, packages }: { path, default, description, packages }:
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
+1 -1
View File
@@ -19,7 +19,7 @@
}; };
}; };
flake.homeManagerModules.wisdomAppsLocalsend = self.lib.wisdomSimpleSlice { flake.homeManagerModules.wisdomAppsLocalsend = self.lib.wisdomSlice {
path = "apps.localsend"; path = "apps.localsend";
default = true; default = true;
description = "LocalSend client; open the firewall on NixOS with `system.localsend` if you want inbound."; description = "LocalSend client; open the firewall on NixOS with `system.localsend` if you want inbound.";
+1 -1
View File
@@ -1,5 +1,5 @@
{ self, ... }: { { self, ... }: {
flake.homeManagerModules.wisdomAppsPokeclicker = self.lib.wisdomSimpleSlice { flake.homeManagerModules.wisdomAppsPokeclicker = self.lib.wisdomSlice {
path = "apps.pokeclicker"; path = "apps.pokeclicker";
default = false; default = false;
description = "PokéClicker desktop (Farigh fork .deb nix)."; description = "PokéClicker desktop (Farigh fork .deb nix).";
+1 -1
View File
@@ -1,5 +1,5 @@
{ self, ... }: { { self, ... }: {
flake.homeManagerModules.wisdomBrowsersChrome = self.lib.wisdomSimpleSlice { flake.homeManagerModules.wisdomBrowsersChrome = self.lib.wisdomSlice {
path = "browsers.chrome"; path = "browsers.chrome";
default = false; default = false;
description = "Chrome (unfree, needs `allowUnfree`); skipped if nixpkgs has no build for this platform."; description = "Chrome (unfree, needs `allowUnfree`); skipped if nixpkgs has no build for this platform.";
+1 -1
View File
@@ -1,5 +1,5 @@
{ self, ... }: { { self, ... }: {
flake.homeManagerModules.wisdomBrowsersEdge = self.lib.wisdomSimpleSlice { flake.homeManagerModules.wisdomBrowsersEdge = self.lib.wisdomSlice {
path = "browsers.edge"; path = "browsers.edge";
default = false; default = false;
description = "Edge (unfree); skipped if unavailable on this platform."; description = "Edge (unfree); skipped if unavailable on this platform.";
+1 -1
View File
@@ -1,5 +1,5 @@
{ self, ... }: { { self, ... }: {
flake.homeManagerModules.wisdomBrowsersFlow = self.lib.wisdomSimpleSlice { flake.homeManagerModules.wisdomBrowsersFlow = self.lib.wisdomSlice {
path = "browsers.flow"; path = "browsers.flow";
default = false; default = false;
description = "[Flow](https://github.com/MultiboxLabs/flow-browser) upstream AppImage wrapped for NixOS."; description = "[Flow](https://github.com/MultiboxLabs/flow-browser) upstream AppImage wrapped for NixOS.";
+1 -1
View File
@@ -1,5 +1,5 @@
{ self, ... }: { { self, ... }: {
flake.homeManagerModules.wisdomEditorsKate = self.lib.wisdomSimpleSlice { flake.homeManagerModules.wisdomEditorsKate = self.lib.wisdomSlice {
path = "editors.kate"; path = "editors.kate";
default = false; default = false;
description = "Kate."; description = "Kate.";
+1 -1
View File
@@ -1,5 +1,5 @@
{ self, ... }: { { self, ... }: {
flake.homeManagerModules.wisdomEditorsObsidian = self.lib.wisdomSimpleSlice { flake.homeManagerModules.wisdomEditorsObsidian = self.lib.wisdomSlice {
path = "editors.obsidian"; path = "editors.obsidian";
default = true; default = true;
description = "Obsidian (unfree); skipped if unavailable here."; description = "Obsidian (unfree); skipped if unavailable here.";