Scope matugen templates to hosts that can actually run them

btop is shared across all hosts, Homepage is mediaserver-only, and the
GNOME/Ghostty/VSCodium/Vesktop templates only apply to desktop hosts.
Emitting them everywhere made matugen error loudly on the server.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
ediblerope 2026-04-16 20:33:40 +01:00
parent 3a5daa6c80
commit 2709805c84

View file

@ -1,5 +1,8 @@
# settings/fred.nix # settings/fred.nix
{ config, pkgs, lib, inputs, ... }: { config, pkgs, lib, inputs, osConfig, ... }:
let
isDesktop = lib.elem osConfig.networking.hostName [ "FredOS-Gaming" "FredOS-Macbook" ];
in
{ {
# Define the state version for Home Manager # Define the state version for Home Manager
home.stateVersion = "25.11"; home.stateVersion = "25.11";
@ -53,6 +56,11 @@
reload_apps = true reload_apps = true
reload_apps_list = { ghostty = "" } reload_apps_list = { ghostty = "" }
[templates.btop]
input_path = "${inputs.self}/templates/btop.theme"
output_path = "${config.home.homeDirectory}/.config/btop/themes/matugen.theme"
'' + lib.optionalString isDesktop ''
[templates.ghostty] [templates.ghostty]
input_path = "${inputs.self}/templates/ghostty-colors" input_path = "${inputs.self}/templates/ghostty-colors"
output_path = "${config.home.homeDirectory}/.config/ghostty/themes/wallpaper" output_path = "${config.home.homeDirectory}/.config/ghostty/themes/wallpaper"
@ -86,10 +94,7 @@
input_path = "${inputs.self}/templates/recolor-folders.sh" input_path = "${inputs.self}/templates/recolor-folders.sh"
output_path = "${config.home.homeDirectory}/.local/share/matugen/recolor-folders.sh" output_path = "${config.home.homeDirectory}/.local/share/matugen/recolor-folders.sh"
post_hook = "bash ${config.home.homeDirectory}/.local/share/matugen/recolor-folders.sh" post_hook = "bash ${config.home.homeDirectory}/.local/share/matugen/recolor-folders.sh"
'' + lib.optionalString (osConfig.networking.hostName == "FredOS-Mediaserver") ''
[templates.btop]
input_path = "${inputs.self}/templates/btop.theme"
output_path = "${config.home.homeDirectory}/.config/btop/themes/matugen.theme"
[templates.homepage] [templates.homepage]
input_path = "${inputs.self}/templates/homepage.css" input_path = "${inputs.self}/templates/homepage.css"