feat(wisdom): introduce wisdomSimpleSlice helper for package modules

Implement a `wisdomSimpleSlice` helper in `desktop/options.nix` to reduce
boilerplate for simple Home Manager modules that only manage packages.
This helper handles the `enable` option creation, platform-gating via
`availableOn`, and conditional inclusion in `home.packages`.

Refactor several existing wisdom modules to use this new helper:
- `wisdomBrowsersChrome`
- `wisdomBrowsersEdge`
- `wisdomEditorsKate`
- `wisdomEditorsObsidian`

Additionally, clean up `wisdom/default.nix` by removing the explicit
import of `wisdomShellBash` (which is now handled via auto-wiring) and
improving code formatting.
This commit is contained in:
2026-07-16 19:46:23 -03:00
parent 13f35677be
commit 103a485bf8
7 changed files with 81 additions and 103 deletions
+29 -25
View File
@@ -1,24 +1,23 @@
# HM side of the flake; option tree is `chiasson.home.*` (docs/conventions.md).
{ self, inputs, ... }: {
# Root module: chiasson.home.enable + bash. Other `wisdom*` slices auto-wire via
# `lib.wisdomCatalogExtraModules`; hosts flip `chiasson.home.*.enable` rather than re-importing.
# Root module: chiasson.home.enable + git identity. Other `wisdom*` slices (including
# the bash shell) auto-wire via `lib.wisdomCatalogExtraModules`; hosts flip
# `chiasson.home.*.enable` rather than re-importing.
flake.homeManagerModules.wisdom =
{ config, lib, pkgs, ... }:
let
cfg = config.chiasson.home;
in
{
imports = [
self.homeManagerModules.wisdomShellBash
];
options.chiasson.home = {
enable = lib.mkEnableOption ''
HM profile root for this flake (bash on by default). Desktop hosts use
`lib.wisdomCatalogExtraModules` once per user and flip `chiasson.home.*.enable` on the host.
'' // {
default = true;
};
enable =
lib.mkEnableOption ''
HM profile root for this flake (bash on by default). Desktop hosts use
`lib.wisdomCatalogExtraModules` once per user and flip `chiasson.home.*.enable` on the host.
''
// {
default = true;
};
extraPackages = lib.mkOption {
type = lib.types.listOf lib.types.package;
@@ -29,20 +28,25 @@
};
};
config = lib.mkIf cfg.enable (lib.mkMerge [
{ home.packages = cfg.extraPackages; }
config = lib.mkIf cfg.enable (
lib.mkMerge [
{ home.packages = cfg.extraPackages; }
# Base git identity + encryption/player tools shared by every HM user.
{
programs.git = {
enable = true;
settings.user = {
name = "OlivierChiasson";
email = "olivierchiasson@hotmail.fr";
# Base git identity + encryption/player tools shared by every HM user.
{
programs.git = {
enable = true;
settings.user = {
name = "OlivierChiasson";
email = "olivierchiasson@hotmail.fr";
};
};
};
home.packages = [ pkgs.git-crypt pkgs.feishin ];
}
]);
home.packages = [
pkgs.git-crypt
pkgs.feishin
];
}
]
);
};
}