Compare commits

...

4 Commits

Author SHA1 Message Date
Olivier 548a438f6a 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.
2026-07-17 11:44:56 -03:00
Olivier 0939766e3a refactor(wisdom): migrate app and browser modules to wisdomSimpleSlice
Replace manual Home Manager module definitions in `localsend`,
`pokeclicker`, and `flow-browser` with the `wisdomSimpleSlice`
helper. This reduces boilerplate by centralizing the option
declaration and configuration logic.
2026-07-17 11:31:35 -03:00
Olivier f424ab98c7 refactor(hosts): remove redundant host and system arguments
Remove explicit `host` and `system` definitions from `specialArgs` in
various host `default.nix` files. These values are redundant as they
can be derived from the flake context or are already provided by the
calling environment.
2026-07-17 11:30:34 -03:00
Olivier 15a4d8d5e8 feat(nfs): centralize nixdesk jellyfin nfs client module
Move the nixdesk jellyfin NFS client configuration from individual
host services to a centralized NixOS module in `modules/system/nfs/`.

This change:
- Creates `modules/system/nfs/default.nix` containing the `nixdeskJellyfin`
  flake module.
- Removes redundant NFS client definitions from `modules/hosts/nix-server/`
  and `modules/hosts/r5500/`.
- Updates `modules/hosts/r5500/configuration.nix` to use the new
  centralized module.
- Cleans up unused local disk configuration in `modules/hosts/14900k/`.
2026-07-17 11:11:21 -03:00
20 changed files with 88 additions and 177 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).
**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.
+1 -1
View File
@@ -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
@@ -1,9 +1,5 @@
# Extra local disks. Declared here, not in hardware.nix (hardware.nix is generated).
{ config, lib, ... }:
let
# Stable UID so NTFS `uid=` matches `users.users.olivier` (override if your account is not 1000).
olivierUid = config.users.users.olivier.uid or 1000;
in
{
users.users.olivier.uid = lib.mkDefault 1000;
# LABEL="MediaLibrary" (btrfs on sda1 by UUID). No subvol=@ — this disk has no @ subvolume.
@@ -33,15 +29,4 @@ in
# LABEL="Deep Storage Unit". Owner olivier, group nfsmedia (990) so:
# - local logins write as user 1000 (owner rwx);
# - NFS (all_squash → uid/gid 990) matches group 990 → rwx (see jellyfin-nfs-export).
#fileSystems."/mnt/test" = {
# device = "/dev/disk/by-uuid/BC12E55E12E51DE0";
# fsType = "ntfs-3g";
# options = [
# "rw"
# "force"
# "uid=${toString olivierUid}"
# "gid=990"
# "umask=0002"
# ];
#};
}
-2
View File
@@ -4,8 +4,6 @@
system = "x86_64-linux";
specialArgs = {
inherit self inputs;
host = "14900k";
system = "x86_64-linux";
};
modules = [
self.nixosModules."14900kConfiguration"
-2
View File
@@ -4,8 +4,6 @@
system = "aarch64-linux";
specialArgs = {
inherit self inputs;
host = "ideapad";
system = "aarch64-linux";
};
modules = [
self.nixosModules.ideapadConfiguration
@@ -1,35 +0,0 @@
# NFS mounts of nixdesk (14900k) bulk storage for nix-server. Exports live in
# modules/hosts/14900k/_private/jellyfin-nfs-export.nix
#
# Jellyfin library paths (see also services/jellyfin.nix):
# Movies → /mnt/nixdesk-jellyfin/movies
# Shows → /mnt/nixdesk-jellyfin/tv
#
# If you see "Stale file handle" under /mnt after changing exports or fsid on nixdesk, drop the
# old client mount and let automount reattach, e.g.:
# sudo umount -l /mnt/nixdesk-jellyfin
# ls /mnt/nixdesk-jellyfin
# (or reboot nix-server.)
{ ... }:
let
nfsExportHost = "192.168.2.25";
# nfsvers+tcp: predictable Linux↔Linux; lookupcache=none: fewer stale dentries after export changes.
nfsClientOpts = [
"rw"
"noatime"
"nofail"
"_netdev"
"nfsvers=3"
"tcp"
"lookupcache=none"
"x-systemd.automount"
"x-systemd.idle-timeout=3600"
];
in
{
fileSystems."/mnt/nixdesk-jellyfin" = {
device = "${nfsExportHost}:/mnt/deep/jellyfin";
fsType = "nfs";
options = nfsClientOpts;
};
}
-2
View File
@@ -3,8 +3,6 @@
system = "x86_64-linux";
specialArgs = {
inherit self inputs;
host = "nix-server";
system = "x86_64-linux";
};
modules = [
self.nixosModules.nix-serverConfiguration
@@ -1,28 +0,0 @@
# NFS mounts of nixdesk (14900k) bulk storage for r5500. Exports live in
# modules/hosts/14900k/_private/jellyfin-nfs-export.nix
#
# Jellyfin library paths:
# Movies → /mnt/nixdesk-jellyfin/movies
# Shows → /mnt/nixdesk-jellyfin/tv
{ ... }:
let
nfsExportHost = "192.168.2.25";
nfsClientOpts = [
"rw"
"noatime"
"nofail"
"_netdev"
"nfsvers=3"
"tcp"
"lookupcache=none"
"x-systemd.automount"
"x-systemd.idle-timeout=3600"
];
in
{
fileSystems."/mnt/nixdesk-jellyfin" = {
device = "${nfsExportHost}:/mnt/deep/jellyfin";
fsType = "nfs";
options = nfsClientOpts;
};
}
+1 -1
View File
@@ -17,7 +17,7 @@
./_private/media-disk.nix
./_private/media-paths.nix
./_services/docker-media.nix
./_services/nixdesk-nfs-client.nix
self.nixosModules.nixdeskJellyfin
./_services/jellyfin.nix
./_services/sonarr.nix
./_services/radarr.nix
-2
View File
@@ -3,8 +3,6 @@
system = "x86_64-linux";
specialArgs = {
inherit self inputs;
host = "r5500";
system = "x86_64-linux";
};
modules = [
self.nixosModules.r5500Configuration
-2
View File
@@ -4,8 +4,6 @@
system = "x86_64-linux";
specialArgs = {
inherit self inputs;
host = "t2mbp";
system = "x86_64-linux";
};
modules = [
self.nixosModules.t2mbpConfiguration
-2
View File
@@ -4,8 +4,6 @@
specialArgs = inputs // {
inherit self;
inputs = inputs;
host = "uConsole";
system = "aarch64-linux";
};
trustCaches = false;
modules = [
+38
View File
@@ -0,0 +1,38 @@
# NFS mount of nixdesk (14900k) bulk storage for clients. Exports live in
# modules/hosts/14900k/_private/jellyfin-nfs-export.nix
#
# Jellyfin library paths (see also jellyfin.nix):
# Movies → /mnt/nixdesk-jellyfin/movies
# Shows → /mnt/nixdesk-jellyfin/tv
#
# If you see "Stale file handle" under /mnt after changing exports or fsid on nixdesk, drop the
# old client mount and let automount reattach, e.g.:
# sudo umount -l /mnt/nixdesk-jellyfin
# ls /mnt/nixdesk-jellyfin
{ ... }:
{
flake.nixosModules.nixdeskJellyfin =
{ lib, ... }:
let
nfsExportHost = "192.168.2.25";
# nfsvers+tcp: predictable Linux↔Linux; lookupcache=none: fewer stale dentries after export changes.
nfsClientOpts = [
"rw"
"noatime"
"nofail"
"_netdev"
"nfsvers=3"
"tcp"
"lookupcache=none"
"x-systemd.automount"
"x-systemd.idle-timeout=3600"
];
in
{
fileSystems."/mnt/nixdesk-jellyfin" = {
device = "${nfsExportHost}:/mnt/deep/jellyfin";
fsType = "nfs";
options = nfsClientOpts;
};
};
}
+5 -20
View File
@@ -1,4 +1,4 @@
{ ... }: {
{ self, ... }: {
flake.nixosModules.systemLocalsend =
{ config, lib, ... }:
let
@@ -19,25 +19,10 @@
};
};
flake.homeManagerModules.wisdomAppsLocalsend =
{ config, lib, pkgs, ... }:
let
root = config.chiasson.home;
cfg = config.chiasson.home.apps.localsend;
in
{
options.chiasson.home.apps.localsend = {
enable = lib.mkEnableOption ''
LocalSend client; open the firewall on NixOS with `system.localsend` if you want inbound.
'' // {
flake.homeManagerModules.wisdomAppsLocalsend = self.lib.wisdomSlice {
path = "apps.localsend";
default = true;
};
package = lib.mkPackageOption pkgs "localsend" { };
};
config = lib.mkIf (root.enable && cfg.enable) {
home.packages = [ cfg.package ];
};
description = "LocalSend client; open the firewall on NixOS with `system.localsend` if you want inbound.";
packages = pkgs: [ pkgs.localsend ];
};
}
+5 -15
View File
@@ -1,18 +1,8 @@
{ ... }: {
flake.homeManagerModules.wisdomAppsPokeclicker =
{ config, lib, pkgs, ... }:
let
root = config.chiasson.home;
cfg = config.chiasson.home.apps.pokeclicker;
pokeclickerPkg = pkgs.callPackage ./package { };
in
{
options.chiasson.home.apps.pokeclicker.enable = lib.mkEnableOption "PokéClicker desktop (Farigh fork .deb nix)." // {
{ self, ... }: {
flake.homeManagerModules.wisdomAppsPokeclicker = self.lib.wisdomSlice {
path = "apps.pokeclicker";
default = false;
};
config = lib.mkIf (root.enable && cfg.enable) {
home.packages = [ pokeclickerPkg ];
};
description = "PokéClicker desktop (Farigh fork .deb nix).";
packages = pkgs: [ (pkgs.callPackage ./package { }) ];
};
}
+1 -1
View File
@@ -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 -1
View File
@@ -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.";
+13 -25
View File
@@ -1,11 +1,10 @@
{ ... }: {
flake.homeManagerModules.wisdomBrowsersFlow =
{ config, lib, pkgs, ... }:
let
root = config.chiasson.home;
cfg = config.chiasson.home.browsers.flow;
flow-browser =
{ self, ... }: {
flake.homeManagerModules.wisdomBrowsersFlow = self.lib.wisdomSlice {
path = "browsers.flow";
default = false;
description = "[Flow](https://github.com/MultiboxLabs/flow-browser) upstream AppImage wrapped for NixOS.";
packages =
pkgs:
let
pname = "flow-browser";
version = "0.11.0";
@@ -25,7 +24,8 @@
appimageContents = pkgs.appimageTools.extractType2 { inherit pname version src; };
in
pkgs.appimageTools.wrapType2 {
[
(pkgs.appimageTools.wrapType2 {
inherit pname version src;
nativeBuildInputs = [ pkgs.makeWrapper ];
@@ -45,25 +45,13 @@
meta = {
description = "Chromium-based browser (upstream AppImage)";
homepage = "https://github.com/MultiboxLabs/flow-browser";
license = lib.licenses.gpl3Plus;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
license = pkgs.lib.licenses.gpl3Plus;
sourceProvenance = with pkgs.lib.sourceTypes; [ binaryNativeCode ];
platforms = [ "x86_64-linux" "aarch64-linux" ];
mainProgram = pname;
maintainers = [ ];
};
};
in
{
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 (
lib.meta.availableOn pkgs.stdenv.hostPlatform flow-browser
) flow-browser;
};
})
];
};
}
+1 -1
View File
@@ -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 -1
View File
@@ -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.";