refactor(wisdom): decentralize module defaults and update conventions

Move Home Manager module defaults from a centralized `desktop-home-defaults.nix`
file into their respective `wisdom` slices. This change aligns with the
updated documentation regarding module ownership, where defaults live
with the option that owns them rather than in a shared defaults file.

Additionally, update `docs/conventions.md` to reflect this new pattern for
defining `mkEnableOption` defaults and move base git/encryption
configurations into the core `wisdom` module.

- Delete `modules/hosts/desktop-home-defaults.nix`
- Update `modules/wisdom/default.nix` to include shared git and package defaults
- Add `default = ...` to `mkEnableOption` in various `wisdom` modules
- Update `docs/conventions.md` with new HM slice guidelines
This commit is contained in:
2026-07-16 13:51:48 -03:00
parent 579a120326
commit 13f35677be
24 changed files with 80 additions and 107 deletions
+3 -1
View File
@@ -12,7 +12,9 @@
options.chiasson.home.apps.discord.enable = lib.mkEnableOption ''
Vesktop (nixcord). Needs nixpkgs `discord` breaks on e.g. aarch64-linux.
'';
'' // {
default = false;
};
config = lib.mkIf root.enable (lib.mkMerge [
{
+3 -1
View File
@@ -29,7 +29,9 @@
options.chiasson.home.apps.localsend = {
enable = lib.mkEnableOption ''
LocalSend client; open the firewall on NixOS with `system.localsend` if you want inbound.
'';
'' // {
default = true;
};
package = lib.mkPackageOption pkgs "localsend" { };
};
+3 -1
View File
@@ -7,7 +7,9 @@
pokeclickerPkg = pkgs.callPackage ./package { };
in
{
options.chiasson.home.apps.pokeclicker.enable = lib.mkEnableOption "PokéClicker desktop (Farigh fork .deb nix).";
options.chiasson.home.apps.pokeclicker.enable = lib.mkEnableOption "PokéClicker desktop (Farigh fork .deb nix)." // {
default = false;
};
config = lib.mkIf (root.enable && cfg.enable) {
home.packages = [ pokeclickerPkg ];
+3 -1
View File
@@ -8,7 +8,9 @@
{
options.chiasson.home.browsers.chrome.enable = lib.mkEnableOption ''
Chrome (unfree, needs `allowUnfree`); skipped if nixpkgs has no build for this platform.
'';
'' // {
default = false;
};
config = lib.mkIf (root.enable && cfg.enable) {
home.packages = lib.optional (
+4 -2
View File
@@ -155,13 +155,15 @@
`failed Initialize()ing the frame pool` in Jellyfin.
Requires `chiasson.system.chromiumHevc.enable` on NixOS.
'';
'' // {
default = true;
};
packages = lib.mkOption {
type = lib.types.listOf (
lib.types.enum (lib.attrNames browserCatalog)
);
default = [ "google-chrome" ];
default = if pkgs.stdenv.hostPlatform.isAarch64 then [ "chromium" ] else [ "google-chrome" ];
description = "Chromium-based browsers to wrap.";
};
+3 -1
View File
@@ -6,7 +6,9 @@
cfg = config.chiasson.home.browsers.edge;
in
{
options.chiasson.home.browsers.edge.enable = lib.mkEnableOption "Edge (unfree); skipped if unavailable on this platform.";
options.chiasson.home.browsers.edge.enable = lib.mkEnableOption "Edge (unfree); skipped if unavailable on this platform." // {
default = false;
};
config = lib.mkIf (root.enable && cfg.enable) {
home.packages = lib.optional (
+3 -1
View File
@@ -56,7 +56,9 @@
{
options.chiasson.home.browsers.flow.enable = lib.mkEnableOption ''
[Flow](https://github.com/MultiboxLabs/flow-browser) upstream AppImage wrapped for NixOS.
'';
'' // {
default = false;
};
config = lib.mkIf (root.enable && cfg.enable) {
home.packages = lib.optional (
+3 -1
View File
@@ -31,7 +31,9 @@
{
options.chiasson.home.browsers.orion.enable = lib.mkEnableOption ''
[Orion](https://orionbrowser.com/) (Kagi) installs the upstream Flatpak bundle and provides `oriongtk`.
'';
'' // {
default = false;
};
config = lib.mkIf (root.enable && cfg.enable) {
home.packages = [ oriongtk ];
+3 -1
View File
@@ -8,7 +8,9 @@
{
imports = [ inputs.zen-browser.homeModules.beta ];
options.chiasson.home.browsers.zen.enable = lib.mkEnableOption "Zen Browser + locked-down policies / extensions.";
options.chiasson.home.browsers.zen.enable = lib.mkEnableOption "Zen Browser + locked-down policies / extensions." // {
default = false;
};
config = lib.mkIf (root.enable && cfg.enable) {
programs.zen-browser = {
+16 -2
View File
@@ -3,7 +3,7 @@
# Root module: chiasson.home.enable + bash. Other `wisdom*` slices auto-wire via
# `lib.wisdomCatalogExtraModules`; hosts flip `chiasson.home.*.enable` rather than re-importing.
flake.homeManagerModules.wisdom =
{ config, lib, ... }:
{ config, lib, pkgs, ... }:
let
cfg = config.chiasson.home;
in
@@ -29,6 +29,20 @@
};
};
config = lib.mkIf cfg.enable { 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";
};
};
home.packages = [ pkgs.git-crypt pkgs.feishin ];
}
]);
};
}
+3 -1
View File
@@ -12,7 +12,9 @@
enable = lib.mkEnableOption ''
WhiteSur GTK + icon themes, Phinger cursor, and Qt via qt6ct (DMS) or KDE platform theme.
Matugen accent colors load via gtk3/gtk4 extraCss when matugenGtkColors is enabled.
'';
'' // {
default = true;
};
matugenGtkColors = lib.mkOption {
type = lib.types.bool;
+4 -2
View File
@@ -13,11 +13,13 @@
{
options.chiasson.home.desktop.screenshot.enable = lib.mkEnableOption ''
grim/slurp/swappy + SwiftShare helpers; Hyprland binds if HM Hyprland is on.
'';
'' // {
default = true;
};
options.chiasson.home.desktop.screenshot.swiftshareApiKeyFile = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
default = "/run/secrets/swiftshare/API_KEY";
description = ''
File with SwiftShare API key (sops path is fine). Required when screenshot module is on.
'';
+3 -1
View File
@@ -33,7 +33,9 @@
in
{
options.chiasson.home.editors.cursor = {
enable = lib.mkEnableOption "Cursor editor from the `cursor` flake input.";
enable = lib.mkEnableOption "Cursor editor from the `cursor` flake input." // {
default = true;
};
setAsDefaultEditor = lib.mkOption {
type = lib.types.bool;
default = true;
+3 -1
View File
@@ -6,7 +6,9 @@
cfg = config.chiasson.home.editors.kate;
in
{
options.chiasson.home.editors.kate.enable = lib.mkEnableOption "Kate.";
options.chiasson.home.editors.kate.enable = lib.mkEnableOption "Kate." // {
default = false;
};
config = lib.mkIf (root.enable && cfg.enable) {
home.packages = lib.optional (
+3 -1
View File
@@ -8,7 +8,9 @@
{
options.chiasson.home.editors.obsidian.enable = lib.mkEnableOption ''
Obsidian (unfree); skipped if unavailable here.
'';
'' // {
default = true;
};
config = lib.mkIf (root.enable && cfg.enable) {
home.packages = lib.optional (
+3 -1
View File
@@ -8,7 +8,9 @@
{
options.chiasson.home.filebrowsers.nemo.enable = lib.mkEnableOption ''
Nemo file manager (GTK). Colors come from DMS matugen via GTK settings no KDE/Qt bridge needed.
'';
'' // {
default = true;
};
config = lib.mkIf (root.enable && cfg.enable) {
home.packages = [pkgs.nemo];
+3 -1
View File
@@ -8,7 +8,9 @@
{
options.chiasson.home.hardware.uconsoleGamepad.enable = lib.mkEnableOption ''
uConsole gamepad antimicrox profile + Hyprland exec-once when HM Hyprland is on.
'';
'' // {
default = false;
};
config = lib.mkIf (root.enable && cfg.enable) (lib.mkMerge [
{
+3 -1
View File
@@ -8,7 +8,9 @@
in
{
options.chiasson.home.shell.fish = {
enable = lib.mkEnableOption "Fish + grc, quiet greeting, rbw SSH socket defaults.";
enable = lib.mkEnableOption "Fish + grc, quiet greeting, rbw SSH socket defaults." // {
default = true;
};
nixYourShell = {
enable = lib.mkEnableOption ''
+3 -1
View File
@@ -7,7 +7,9 @@
in
{
options.chiasson.home.shell.ohMyPosh = {
enable = lib.mkEnableOption "[Oh My Posh](https://ohmyposh.dev/) prompt.";
enable = lib.mkEnableOption "[Oh My Posh](https://ohmyposh.dev/) prompt." // {
default = true;
};
builtinTheme = lib.mkOption {
type = lib.types.str;
+3 -1
View File
@@ -7,7 +7,9 @@
cfg = config.chiasson.home.shell.yazi;
in
{
options.chiasson.home.shell.yazi.enable = lib.mkEnableOption "Yazi as `y` + 7zz with rar.";
options.chiasson.home.shell.yazi.enable = lib.mkEnableOption "Yazi as `y` + 7zz with rar." // {
default = true;
};
config = lib.mkIf (root.enable && cfg.enable) {
programs.yazi = {
+3 -1
View File
@@ -15,7 +15,9 @@
{
options.chiasson.home.terminals.kitty.enable = lib.mkEnableOption ''
Kitty + DMS includes; activation strips `*-theme.auto.conf` so matugen colors stick.
'';
'' // {
default = true;
};
config = lib.mkIf (root.enable && cfg.enable) {
programs.kitty = {