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:
+1
-1
@@ -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).
|
||||
|
||||
**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.
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
in
|
||||
map (name: self.homeManagerModules.${name}) names;
|
||||
|
||||
flake.lib.wisdomSimpleSlice =
|
||||
flake.lib.wisdomSlice =
|
||||
{ path, default, description, packages }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
flake.homeManagerModules.wisdomAppsLocalsend = self.lib.wisdomSimpleSlice {
|
||||
flake.homeManagerModules.wisdomAppsLocalsend = self.lib.wisdomSlice {
|
||||
path = "apps.localsend";
|
||||
default = true;
|
||||
description = "LocalSend client; open the firewall on NixOS with `system.localsend` if you want inbound.";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ self, ... }: {
|
||||
flake.homeManagerModules.wisdomAppsPokeclicker = self.lib.wisdomSimpleSlice {
|
||||
flake.homeManagerModules.wisdomAppsPokeclicker = self.lib.wisdomSlice {
|
||||
path = "apps.pokeclicker";
|
||||
default = false;
|
||||
description = "PokéClicker desktop (Farigh fork .deb → nix).";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ self, ... }: {
|
||||
flake.homeManagerModules.wisdomBrowsersChrome = self.lib.wisdomSimpleSlice {
|
||||
flake.homeManagerModules.wisdomBrowsersChrome = self.lib.wisdomSlice {
|
||||
path = "browsers.chrome";
|
||||
default = false;
|
||||
description = "Chrome (unfree, needs `allowUnfree`); skipped if nixpkgs has no build for this platform.";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ self, ... }: {
|
||||
flake.homeManagerModules.wisdomBrowsersEdge = self.lib.wisdomSimpleSlice {
|
||||
flake.homeManagerModules.wisdomBrowsersEdge = self.lib.wisdomSlice {
|
||||
path = "browsers.edge";
|
||||
default = false;
|
||||
description = "Edge (unfree); skipped if unavailable on this platform.";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ self, ... }: {
|
||||
flake.homeManagerModules.wisdomBrowsersFlow = self.lib.wisdomSimpleSlice {
|
||||
flake.homeManagerModules.wisdomBrowsersFlow = self.lib.wisdomSlice {
|
||||
path = "browsers.flow";
|
||||
default = false;
|
||||
description = "[Flow](https://github.com/MultiboxLabs/flow-browser) — upstream AppImage wrapped for NixOS.";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ self, ... }: {
|
||||
flake.homeManagerModules.wisdomEditorsKate = self.lib.wisdomSimpleSlice {
|
||||
flake.homeManagerModules.wisdomEditorsKate = self.lib.wisdomSlice {
|
||||
path = "editors.kate";
|
||||
default = false;
|
||||
description = "Kate.";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ self, ... }: {
|
||||
flake.homeManagerModules.wisdomEditorsObsidian = self.lib.wisdomSimpleSlice {
|
||||
flake.homeManagerModules.wisdomEditorsObsidian = self.lib.wisdomSlice {
|
||||
path = "editors.obsidian";
|
||||
default = true;
|
||||
description = "Obsidian (unfree); skipped if unavailable here.";
|
||||
|
||||
Reference in New Issue
Block a user