Add DMS configuration enhancements and new default settings

- Introduced a new private default settings file for Dank Material Shell (DMS) to manage user-specific settings.
- Updated DMS home-manager module to generate a settings seed file, merging extra right-bar widgets into the first-run configuration.
- Added support for dynamic inclusion of DMS window rules based on user configuration.
- Enhanced the Niri configuration with a preference for no client-side decorations and improved keybindings for bar toggling.
This commit is contained in:
2026-06-20 21:20:00 -03:00
parent 1a34db6f22
commit 17337b9675
7 changed files with 205 additions and 509 deletions
+34 -6
View File
@@ -14,6 +14,7 @@ let
}; };
input."warp-mouse-to-focus" = _: { }; input."warp-mouse-to-focus" = _: { };
layout.gaps = 5; layout.gaps = 5;
prefer-no-csd = true;
window-rules = [ window-rules = [
{ {
@@ -62,7 +63,7 @@ let
"Mod+N"."spawn-sh" = "dms ipc call notepad toggle"; #TODO[epic=Binds] This should only be set if having dms "Mod+N"."spawn-sh" = "dms ipc call notepad toggle"; #TODO[epic=Binds] This should only be set if having dms
"Mod+Shift+N"."spawn-sh" = "dms ipc call notifications toggle"; #TODO[epic=Binds] This should only be set if having dms "Mod+Shift+N"."spawn-sh" = "dms ipc call notifications toggle"; #TODO[epic=Binds] This should only be set if having dms
"Mod+M"."spawn-sh" = "dms ipc call processlist toggle"; #TODO[epic=Binds] This should only be set if having dms "Mod+M"."spawn-sh" = "dms ipc call processlist toggle"; #TODO[epic=Binds] This should only be set if having dms
"Mod+B"."spawn-sh" = "dms ipc call bar toggle name \"Main Bar\""; #TODO[epic=Binds] This should only be set if having dms "Mod+B"."spawn-sh" = "dms ipc call bar toggle name \"Main Bar\"; dms ipc call bar toggle name \"Bar 2\""; #TODO[epic=Binds] This should only be set if having dms
"Mod+Shift+B"."spawn-sh" = "dms ipc call bar toggle name \"Bar 2\""; #TODO[epic=Binds] This should only be set if having dms "Mod+Shift+B"."spawn-sh" = "dms ipc call bar toggle name \"Bar 2\""; #TODO[epic=Binds] This should only be set if having dms
"Mod+L"."spawn-sh" = "dms ipc call lock lock"; #TODO[epic=Binds] This should only be set if having dms "Mod+L"."spawn-sh" = "dms ipc call lock lock"; #TODO[epic=Binds] This should only be set if having dms
@@ -178,28 +179,55 @@ let
// lib.optionalAttrs (windowRules != [ ]) { // lib.optionalAttrs (windowRules != [ ]) {
window-rules = windowRules; window-rules = windowRules;
} }
// lib.optionalAttrs (rpi5Extra != "" || (userExtra.extraConfig or "") != "") { // lib.optionalAttrs (extraConfigMerged != "") {
extraConfig = extraConfigMerged; extraConfig = extraConfigMerged;
} }
); );
in in
{ {
flake.homeManagerModules.desktopNiri = flake.homeManagerModules.desktopNiri =
{ lib, pkgs, osConfig ? { }, ... }: { config, lib, pkgs, osConfig ? { }, ... }:
let let
home = config.home.homeDirectory;
niriOs = osConfig.chiasson.desktop.niri or { }; niriOs = osConfig.chiasson.desktop.niri or { };
niriEnabled = osConfig.chiasson.desktop.niri.enable or false; niriEnabled = osConfig.chiasson.desktop.niri.enable or false;
keyringEnabled = osConfig.chiasson.desktop.keyring.enable or false; keyringEnabled = osConfig.chiasson.desktop.keyring.enable or false;
mergedSettings = mergeNiriSettings pkgs niriOs keyringEnabled; dmsEnabled = (osConfig.chiasson.desktop.shell or null) == "dms";
dmsWindowRulesPath = "${home}/.config/niri/dms/windowrules.kdl";
# wrapper-modules emits quoted KDL (`"include" "…"`) which DMS's parser ignores.
# config.kdl is a store symlink, so a relative include would not resolve to the real
# ~/.config/niri/dms/windowrules.kdl that DMS writes at runtime.
dmsWindowRulesInclude = lib.optionalString dmsEnabled ''
include "${dmsWindowRulesPath}"
'';
baseMergedSettings = mergeNiriSettings pkgs niriOs keyringEnabled;
mergedSettings = lib.recursiveUpdate baseMergedSettings {
extraConfig = dmsWindowRulesInclude + (baseMergedSettings.extraConfig or "");
};
niriConfigPkg = inputs.wrapper-modules.wrappers.niri.wrap { niriConfigPkg = inputs.wrapper-modules.wrappers.niri.wrap {
inherit pkgs; inherit pkgs;
settings = mergedSettings; settings = mergedSettings;
# User-owned rules path is not available during the Nix build.
disableConfigValidation = dmsEnabled;
}; };
in in
{ {
config = lib.mkIf niriEnabled { config = lib.mkIf niriEnabled (lib.mkMerge [
{
xdg.configFile."niri/config.kdl".source = "${niriConfigPkg}/niri-config.kdl"; xdg.configFile."niri/config.kdl".source = "${niriConfigPkg}/niri-config.kdl";
}; }
(lib.mkIf dmsEnabled {
# Seed empty rules file so niri can load the include before DMS first deploy.
home.activation.dmsNiriWindowRulesSeed = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
rulesDir="$HOME/.config/niri/dms"
rulesFile="$rulesDir/windowrules.kdl"
mkdir -p "$rulesDir"
if [ ! -e "$rulesFile" ]; then
${pkgs.coreutils}/bin/touch "$rulesFile"
fi
'';
})
]);
}; };
flake.nixosModules.desktopNiri = flake.nixosModules.desktopNiri =
@@ -0,0 +1,108 @@
# Defaults written once to ~/.config/DankMaterialShell/settings.json on first login.
# After that, DMS settings are owned by the UI — rebuilds do not overwrite them.
{
lib,
gpuTempEnabled ? true,
extraRightBarWidgets ? [ ],
}:
let
gpuTempBarWidget = {
id = "gpuTemp";
enabled = true;
selectedGpuIndex = 0;
pciId = "10de:1f07";
};
in
{
theme = "dark";
dynamicTheming = true;
currentThemeName = "dynamic";
matugenScheme = "scheme-tonal-spot";
runUserMatugenTemplates = true;
matugenTemplateVesktop = false;
showDock = false;
gtkThemingEnabled = true;
qtThemingEnabled = true;
terminalsAlwaysDark = true;
syncModeWithPortal = true;
configVersion = 5;
barConfigs = [
{
id = "default";
name = "Main Bar";
enabled = true;
position = 0;
screenPreferences = [ "all" ];
showOnLastDisplay = true;
leftWidgets =
[
{
id = "launcherButton";
enabled = true;
}
{
id = "nixMonitor";
enabled = true;
}
{
id = "cpuUsage";
enabled = true;
}
{
id = "cpuTemp";
enabled = true;
}
]
++ lib.optionals gpuTempEnabled [ gpuTempBarWidget ]
++ [
{
id = "memUsage";
enabled = true;
}
];
centerWidgets = [
{
id = "workspaceSwitcher";
enabled = true;
}
];
rightWidgets = extraRightBarWidgets
++ [
{
id = "systemTray";
enabled = true;
}
{
id = "notificationButton";
enabled = true;
}
{
id = "battery";
enabled = true;
}
{
id = "controlCenterButton";
enabled = true;
}
{
id = "clock";
enabled = true;
clockCompactMode = false;
}
];
spacing = 0;
innerPadding = 4;
bottomGap = 0;
transparency = 1;
widgetTransparency = 0.45;
squareCorners = true;
maximizeDetection = true;
visible = true;
}
];
}
+1 -1
View File
@@ -24,7 +24,7 @@
extraRightBarWidgets = lib.mkOption { extraRightBarWidgets = lib.mkOption {
type = lib.types.listOf lib.types.attrs; type = lib.types.listOf lib.types.attrs;
default = [ ]; default = [ ];
description = "Extra right-bar widgets (prepended)."; description = "Extra right-bar widgets merged into the first-run DMS settings seed.";
}; };
enableWvkbdToggle = lib.mkEnableOption '' enableWvkbdToggle = lib.mkEnableOption ''
wvkbd DMS plugin + bar toggle (touch / uConsole). wvkbd DMS plugin + bar toggle (touch / uConsole).
@@ -15,7 +15,11 @@
matugenOutputDirs = matugenOutputDirs =
lib.optionals hyprlandEnabled [ "${home}/.config/hypr" ] lib.optionals hyprlandEnabled [ "${home}/.config/hypr" ]
++ lib.optionals ohMyPoshEnabled [ "${home}/.config/oh-my-posh" ] ++ lib.optionals ohMyPoshEnabled [ "${home}/.config/oh-my-posh" ]
++ lib.optionals discordEnabled [ "${home}/.config/vesktop/themes" ]; ++ lib.optionals discordEnabled [ "${home}/.config/vesktop/themes" ]
++ [
"${home}/.config/qt6ct/colors"
"${home}/.config/qt5ct/colors"
];
ensureMatugenOutputDirsScript = pkgs.writeShellScript "dms-ensure-matugen-output-dirs" '' ensureMatugenOutputDirsScript = pkgs.writeShellScript "dms-ensure-matugen-output-dirs" ''
set -euo pipefail set -euo pipefail
${lib.concatStringsSep "\n" (map (dir: "mkdir -p ${lib.escapeShellArg dir}") matugenOutputDirs)} ${lib.concatStringsSep "\n" (map (dir: "mkdir -p ${lib.escapeShellArg dir}") matugenOutputDirs)}
@@ -54,6 +58,14 @@
${pkgs.systemd}/bin/systemctl --user try-restart dms.service 2>/dev/null || true ${pkgs.systemd}/bin/systemctl --user try-restart dms.service 2>/dev/null || true
''; '';
jsonFormat = pkgs.formats.json { };
dmsSeedSettings = import ../_private/default-settings.nix {
inherit lib gpuTempEnabled;
extraRightBarWidgets = cfg.extraRightBarWidgets;
};
dmsSeedFile = jsonFormat.generate "dms-settings-seed.json" dmsSeedSettings;
dmsSettingsPath = "${config.xdg.configHome}/DankMaterialShell/settings.json";
in { in {
options = { options = {
dms.enable = lib.mkOption { dms.enable = lib.mkOption {
@@ -104,7 +116,7 @@ in {
{ id = "wvkbdToggle"; enabled = true; } { id = "wvkbdToggle"; enabled = true; }
{ id = "rbwLockToggle"; enabled = true; } { id = "rbwLockToggle"; enabled = true; }
]; ];
description = "Extra `{ id, enabled, }` widgets, merged before defaults."; description = "Extra `{ id, enabled, }` widgets merged into the first-run settings seed.";
}; };
dms.enableWvkbdToggle = lib.mkEnableOption '' dms.enableWvkbdToggle = lib.mkEnableOption ''
@@ -167,6 +179,11 @@ in {
programs.dank-material-shell = { programs.dank-material-shell = {
enable = true; enable = true;
# homeAssistantMonitor plugin (QtWebSockets) needs QML on DMS's import path, not just home.packages.
package = inputs.dms.packages.${pkgs.stdenv.hostPlatform.system}.dms-shell.override {
extraQtPackages = with pkgs.kdePackages; [ qtwebsockets ];
};
systemd = { systemd = {
enable = true; # Systemd service for auto-start enable = true; # Systemd service for auto-start
restartIfChanged = true; # Auto-restart dms.service when dankMaterialShell changes restartIfChanged = true; # Auto-restart dms.service when dankMaterialShell changes
@@ -181,390 +198,28 @@ in {
enableCalendarEvents = false; # Disable calendar integration (khal/ikhal) enableCalendarEvents = false; # Disable calendar integration (khal/ikhal)
# Leave `session` at {} — non-empty makes HM rewrite session.json every switch and nukes wallpaper/session state. # Leave `session` at {} — non-empty makes HM rewrite session.json every switch and nukes wallpaper/session state.
settings = { # Leave `settings` at {} — UI-owned settings.json is seeded once on first run (see home.activation below).
theme = "dark"; settings = { };
dynamicTheming = true; session = { };
currentThemeName = "dynamic";
customThemeFile = "";
matugenScheme = "scheme-tonal-spot";
runUserMatugenTemplates = true;
# Stock DMS vesktop matugen output conflicts with our `templates/dank-discord.css` + config.toml entry.
matugenTemplateVesktop = false;
matugenTargetMonitor = "";
popupTransparency = 1;
dockTransparency = 0.85;
widgetBackgroundColor = "sch";
widgetColorMode = "default";
cornerRadius = 10;
use24HourClock = false;
showSeconds = true;
useFahrenheit = false;
nightModeEnabled = false;
animationSpeed = 1;
customAnimationDuration = 500;
wallpaperFillMode = "Fill";
blurredWallpaperLayer = false;
blurWallpaperOnOverview = false;
showLauncherButton = true;
showWorkspaceSwitcher = true;
showFocusedWindow = true;
showWeather = true;
showMusic = true;
showClipboard = true;
showCpuUsage = true;
showMemUsage = true;
showCpuTemp = true;
showGpuTemp = gpuTempEnabled;
showSystemTray = true;
}
// lib.optionalAttrs gpuTempEnabled {
selectedGpuIndex = 0;
enabledGpuPciIds = [];
}
// {
showClock = true;
showNotificationButton = true;
showBattery = true;
showControlCenterButton = true;
showCapsLockIndicator = true;
controlCenterShowNetworkIcon = true;
controlCenterShowBluetoothIcon = true;
controlCenterShowAudioIcon = true;
controlCenterShowVpnIcon = true;
controlCenterShowBrightnessIcon = false;
controlCenterShowMicIcon = false;
controlCenterShowBatteryIcon = false;
controlCenterShowPrinterIcon = false;
showPrivacyButton = true;
privacyShowMicIcon = false;
privacyShowCameraIcon = false;
privacyShowScreenShareIcon = false;
controlCenterWidgets = [
{
id = "volumeSlider";
enabled = true;
width = 50;
}
{
id = "brightnessSlider";
enabled = true;
width = 50;
}
{
id = "wifi";
enabled = true;
width = 50;
}
{
id = "bluetooth";
enabled = true;
width = 50;
}
{
id = "audioOutput";
enabled = true;
width = 50;
}
{
id = "audioInput";
enabled = true;
width = 50;
}
{
id = "nightMode";
enabled = true;
width = 50;
}
{
id = "darkMode";
enabled = true;
width = 50;
}
];
showWorkspaceIndex = true;
showWorkspacePadding = false;
workspaceScrolling = false;
showWorkspaceApps = true;
maxWorkspaceIcons = 10;
workspaceAppIconSizeOffset = 1;
workspacesPerMonitor = true;
showOccupiedWorkspacesOnly = false;
dwlShowAllTags = false;
workspaceNameIcons = {};
waveProgressEnabled = true;
scrollTitleEnabled = true;
clockCompactMode = false;
focusedWindowCompactMode = false;
runningAppsCompactMode = true;
keyboardLayoutNameCompactMode = false;
runningAppsCurrentWorkspace = false;
runningAppsGroupByApp = true;
centeringMode = "geometric";
clockDateFormat = "yyyy-MM-dd";
lockDateFormat = "";
mediaSize = 1;
appLauncherViewMode = "list";
spotlightModalViewMode = "list";
sortAppsAlphabetically = false;
appLauncherGridColumns = 4;
spotlightCloseNiriOverview = true;
niriOverviewOverlayEnabled = true;
useAutoLocation = true;
weatherEnabled = true;
networkPreference = "auto";
vpnLastConnected = "";
iconTheme = "System Default";
launcherLogoMode = "os";
launcherLogoCustomPath = "";
launcherLogoColorOverride = "";
launcherLogoColorInvertOnMode = false;
launcherLogoBrightness = 0.5;
launcherLogoContrast = 1;
launcherLogoSizeOffset = 0;
fontFamily = "Inter Variable";
monoFontFamily = "Fira Code";
fontWeight = 400;
fontScale = 1;
notepadUseMonospace = true;
notepadFontFamily = "";
notepadFontSize = 14;
notepadShowLineNumbers = false;
notepadTransparencyOverride = -1;
notepadLastCustomTransparency = 0.7;
soundsEnabled = true;
useSystemSoundTheme = false;
soundNewNotification = true;
soundVolumeChanged = true;
soundPluggedIn = true;
acMonitorTimeout = 0;
acLockTimeout = 0;
acSuspendTimeout = 0;
acSuspendBehavior = 0;
acProfileName = "";
batteryMonitorTimeout = 0;
batteryLockTimeout = 0;
batterySuspendTimeout = 0;
batterySuspendBehavior = 0;
batteryProfileName = "";
lockBeforeSuspend = false;
loginctlLockIntegration = true;
fadeToLockEnabled = false;
fadeToLockGracePeriod = 5;
launchPrefix = "";
brightnessDevicePins = {};
wifiNetworkPins = {};
bluetoothDevicePins = {};
audioInputDevicePins = {};
audioOutputDevicePins = {};
gtkThemingEnabled = false;
qtThemingEnabled = false;
syncModeWithPortal = true;
terminalsAlwaysDark = true;
showDock = false;
dockAutoHide = true;
dockGroupByApp = true;
dockOpenOnOverview = false;
dockPosition = 1;
dockSpacing = 3;
dockBottomGap = -16;
dockMargin = 2;
dockIconSize = 45;
dockIndicatorStyle = "circle";
dockBorderEnabled = true;
dockBorderColor = "primary";
dockBorderOpacity = 0.2;
dockBorderThickness = 2;
notificationOverlayEnabled = false;
modalDarkenBackground = true;
lockScreenShowPowerActions = true;
enableFprint = false;
maxFprintTries = 15;
lockScreenActiveMonitor = "all";
lockScreenInactiveColor = "#000000";
hideBrightnessSlider = false;
notificationTimeoutLow = 5000;
notificationTimeoutNormal = 5000;
notificationTimeoutCritical = 0;
notificationPopupPosition = 0;
osdAlwaysShowValue = false;
osdPosition = 5;
osdVolumeEnabled = true;
osdMediaVolumeEnabled = true;
osdBrightnessEnabled = true;
osdIdleInhibitorEnabled = true;
osdMicMuteEnabled = true;
osdCapsLockEnabled = true;
osdPowerProfileEnabled = false;
osdAudioOutputEnabled = true;
powerActionConfirm = true;
powerActionHoldDuration = 0.5;
powerMenuActions = ["reboot" "logout" "poweroff" "lock" "suspend" "restart"];
powerMenuDefaultAction = "logout";
powerMenuGridLayout = false;
customPowerActionLock = "";
customPowerActionLogout = "";
customPowerActionSuspend = "";
customPowerActionHibernate = "";
customPowerActionReboot = "";
customPowerActionPowerOff = "";
updaterUseCustomCommand = false;
updaterCustomCommand = "";
updaterTerminalAdditionalParams = "";
displayNameMode = "model";
showOnLastDisplay = {
dock = true;
}; };
barConfigs = [ # Detach store symlink so UI edits survive rebuilds; seed defaults only on a fresh profile.
{ home.activation.dmsMaterializeSettings = lib.hm.dag.entryBefore [ "writeBoundary" ] ''
id = "default"; settingsFile=${lib.escapeShellArg dmsSettingsPath}
name = "Main Bar"; if [ -L "$settingsFile" ]; then
enabled = true; mkdir -p "$(dirname "$settingsFile")"
position = 0; ${pkgs.coreutils}/bin/cp --remove-destination -L "$settingsFile" "$settingsFile"
screenPreferences = ["all"]; fi
showOnLastDisplay = true; '';
leftWidgets = [ home.activation.dmsSeedSettings = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
{ settingsFile=${lib.escapeShellArg dmsSettingsPath}
id = "launcherButton"; mkdir -p "$(dirname "$settingsFile")"
enabled = true; if [ ! -e "$settingsFile" ]; then
} ${pkgs.coreutils}/bin/cp ${lib.escapeShellArg dmsSeedFile} "$settingsFile"
{ chmod u+w "$settingsFile"
id = "nixMonitor"; fi
enabled = true; '';
}
{
id = "cpuUsage";
enabled = true;
}
{
id = "cpuTemp";
enabled = true;
}
]
++ lib.optionals gpuTempEnabled [
{
id = "gpuTemp";
enabled = true;
selectedGpuIndex = 0;
pciId = "10de:1f07";
}
]
++ [
{
id = "memUsage";
enabled = true;
}
{
id = "music";
enabled = false;
}
{
id = "focusedWindow";
enabled = false;
}
];
centerWidgets = [
{
id = "privacyIndicator";
enabled = false;
}
{
id = "workspaceSwitcher";
enabled = true;
}
{
id = "privacyIndicator";
enabled = true;
}
];
rightWidgets = cfg.extraRightBarWidgets
++ [
{
id = "systemTray";
enabled = true;
}
{
id = "notificationButton";
enabled = true;
}
{
id = "battery";
enabled = true;
}
{
id = "controlCenterButton";
enabled = true;
}
{
id = "clock";
enabled = true;
clockCompactMode = false;
}
];
spacing = 0;
innerPadding = 4;
bottomGap = -4;
transparency = 0;
widgetTransparency = 0.45;
squareCorners = true;
noBackground = false;
gothCornersEnabled = true;
gothCornerRadiusOverride = false;
gothCornerRadiusValue = 12;
borderEnabled = false;
borderColor = "primary";
borderOpacity = 1;
borderThickness = 1;
widgetOutlineEnabled = true;
widgetOutlineColor = "secondary";
widgetOutlineOpacity = 0.25;
widgetOutlineThickness = 2;
fontScale = 1;
autoHide = false;
autoHideDelay = 250;
openOnOverview = false;
visible = true;
popupGapsAuto = true;
popupGapsManual = 22;
maximizeDetection = true;
}
];
configVersion = 2;
};
};
# matugen won't create missing output_path parents; run before DMS theme generation. # matugen won't create missing output_path parents; run before DMS theme generation.
systemd.user.services.dms.serviceConfig.ExecStartPre = systemd.user.services.dms.serviceConfig.ExecStartPre =
@@ -582,12 +237,6 @@ in {
input_path = '${home}/.config/matugen/templates/hyprland-colors.conf' input_path = '${home}/.config/matugen/templates/hyprland-colors.conf'
output_path = '${home}/.config/hypr/colors.conf' output_path = '${home}/.config/hypr/colors.conf'
'' ''
+ ''
[templates.kdeglobals]
input_path = '${home}/.config/matugen/templates/kdeglobals.conf'
output_path = '${home}/.config/kdeglobals'
''
+ lib.optionalString ohMyPoshEnabled '' + lib.optionalString ohMyPoshEnabled ''
[templates.ohmyposh] [templates.ohmyposh]
@@ -612,10 +261,6 @@ in {
) )
; ;
home.activation.dmsEnsureMatugenOutputDirs = lib.hm.dag.entryAfter ["writeBoundary"] ''
${ensureMatugenOutputDirsScript}
'';
# Obsidian snippet dirs for matugen: mkdir here instead of tmpfiles (no chmod fights on weird mounts). # Obsidian snippet dirs for matugen: mkdir here instead of tmpfiles (no chmod fights on weird mounts).
home.activation.dmsEnsureObsidianSnippetDirs = lib.hm.dag.entryAfter ["writeBoundary"] ( home.activation.dmsEnsureObsidianSnippetDirs = lib.hm.dag.entryAfter ["writeBoundary"] (
let let
@@ -669,97 +314,6 @@ in {
} }
''; '';
# matugen template → KDE globals file used by KDE/Qt apps (e.g. Dolphin).
# Uses DMS-provided matugen color variables; keep `.default` for mode-aware colors.
xdg.configFile."matugen/templates/kdeglobals.conf".text = ''
[General]
ColorScheme=DMSDynamic
TerminalApplication=kitty
TerminalService=kitty.desktop
# Keep Qt/KDE app icons on WhiteSur (this is what Dolphin reads via KDE config)
[Icons]
Theme=WhiteSur-dark
[Colors:Window]
BackgroundNormal=#{{colors.background.default.hex_stripped}}
BackgroundAlternate=#{{colors.surface.default.hex_stripped}}
DecorationFocus=#{{colors.primary.default.hex_stripped}}
DecorationHover=#{{colors.secondary.default.hex_stripped}}
ForegroundNormal=#{{colors.on_surface.default.hex_stripped}}
ForegroundInactive=#{{colors.on_surface_variant.default.hex_stripped}}
ForegroundActive=#{{colors.on_surface.default.hex_stripped}}
ForegroundLink=#{{colors.primary.default.hex_stripped}}
ForegroundVisited=#{{colors.tertiary.default.hex_stripped}}
ForegroundNegative=#{{colors.error.default.hex_stripped}}
ForegroundNeutral=#{{colors.secondary.default.hex_stripped}}
ForegroundPositive=#{{colors.primary.default.hex_stripped}}
[Colors:View]
BackgroundNormal=#{{colors.background.default.hex_stripped}}
BackgroundAlternate=#{{colors.surface.default.hex_stripped}}
DecorationFocus=#{{colors.primary.default.hex_stripped}}
DecorationHover=#{{colors.secondary.default.hex_stripped}}
ForegroundNormal=#{{colors.on_surface.default.hex_stripped}}
ForegroundInactive=#{{colors.on_surface_variant.default.hex_stripped}}
ForegroundActive=#{{colors.on_surface.default.hex_stripped}}
ForegroundLink=#{{colors.primary.default.hex_stripped}}
ForegroundVisited=#{{colors.tertiary.default.hex_stripped}}
ForegroundNegative=#{{colors.error.default.hex_stripped}}
ForegroundNeutral=#{{colors.secondary.default.hex_stripped}}
ForegroundPositive=#{{colors.primary.default.hex_stripped}}
[Colors:Button]
BackgroundNormal=#{{colors.surface.default.hex_stripped}}
BackgroundAlternate=#{{colors.surface_variant.default.hex_stripped}}
DecorationFocus=#{{colors.primary.default.hex_stripped}}
DecorationHover=#{{colors.secondary.default.hex_stripped}}
ForegroundNormal=#{{colors.on_surface.default.hex_stripped}}
ForegroundInactive=#{{colors.on_surface_variant.default.hex_stripped}}
ForegroundActive=#{{colors.on_surface.default.hex_stripped}}
ForegroundLink=#{{colors.primary.default.hex_stripped}}
ForegroundVisited=#{{colors.tertiary.default.hex_stripped}}
ForegroundNegative=#{{colors.error.default.hex_stripped}}
ForegroundNeutral=#{{colors.secondary.default.hex_stripped}}
ForegroundPositive=#{{colors.primary.default.hex_stripped}}
[Colors:Selection]
BackgroundNormal=#{{colors.primary.default.hex_stripped}}
BackgroundAlternate=#{{colors.primary_container.default.hex_stripped}}
DecorationFocus=#{{colors.primary.default.hex_stripped}}
DecorationHover=#{{colors.secondary.default.hex_stripped}}
ForegroundNormal=#{{colors.on_primary.default.hex_stripped}}
ForegroundInactive=#{{colors.on_primary.default.hex_stripped}}
ForegroundActive=#{{colors.on_primary.default.hex_stripped}}
ForegroundLink=#{{colors.on_primary.default.hex_stripped}}
ForegroundVisited=#{{colors.on_primary.default.hex_stripped}}
ForegroundNegative=#{{colors.on_primary.default.hex_stripped}}
ForegroundNeutral=#{{colors.on_primary.default.hex_stripped}}
ForegroundPositive=#{{colors.on_primary.default.hex_stripped}}
[Colors:Tooltip]
BackgroundNormal=#{{colors.surface_variant.default.hex_stripped}}
BackgroundAlternate=#{{colors.surface.default.hex_stripped}}
DecorationFocus=#{{colors.primary.default.hex_stripped}}
DecorationHover=#{{colors.secondary.default.hex_stripped}}
ForegroundNormal=#{{colors.on_surface.default.hex_stripped}}
ForegroundInactive=#{{colors.on_surface_variant.default.hex_stripped}}
ForegroundActive=#{{colors.on_surface.default.hex_stripped}}
ForegroundLink=#{{colors.primary.default.hex_stripped}}
ForegroundVisited=#{{colors.tertiary.default.hex_stripped}}
ForegroundNegative=#{{colors.error.default.hex_stripped}}
ForegroundNeutral=#{{colors.secondary.default.hex_stripped}}
ForegroundPositive=#{{colors.primary.default.hex_stripped}}
[WM]
activeBackground=#{{colors.background.default.hex_stripped}}
activeBlend=#{{colors.background.default.hex_stripped}}
activeForeground=#{{colors.on_surface.default.hex_stripped}}
inactiveBackground=#{{colors.background.default.hex_stripped}}
inactiveBlend=#{{colors.background.default.hex_stripped}}
inactiveForeground=#{{colors.on_surface_variant.default.hex_stripped}}
'';
# matugen → Oh My Posh JSON; hex in the base theme swapped for matugen tokens. # matugen → Oh My Posh JSON; hex in the base theme swapped for matugen tokens.
xdg.configFile."matugen/templates/ohmyposh-theme.omp.json".text = '' xdg.configFile."matugen/templates/ohmyposh-theme.omp.json".text = ''
{ {
+1 -1
View File
@@ -80,7 +80,7 @@
enable = lib.mkDefault true; enable = lib.mkDefault true;
swiftshareApiKeyFile = "/run/secrets/swiftshare/API_KEY"; #TODO[epic=sops] redo this by passing sops file output directly swiftshareApiKeyFile = "/run/secrets/swiftshare/API_KEY"; #TODO[epic=sops] redo this by passing sops file output directly
}; };
# WhiteSur GTK/icons, Phinger cursor, Qt via KDE platform theme; imports DMS matugen `dank-colors.css`. # WhiteSur GTK/icons, Phinger cursor, DMS matugen for GTK (+ qt6ct for Qt apps).
theming.enable = lib.mkDefault true; theming.enable = lib.mkDefault true;
}; };
+2 -2
View File
@@ -55,7 +55,7 @@
]; ];
} }
{ {
home.packages = [ pkgs.rbw pkgs.pinentry-qt ]; home.packages = with pkgs; [ rbw pinentry-gtk2 ];
home.sessionVariables.SSH_AUTH_SOCK = "$XDG_RUNTIME_DIR/rbw/ssh-agent-socket"; home.sessionVariables.SSH_AUTH_SOCK = "$XDG_RUNTIME_DIR/rbw/ssh-agent-socket";
home.file = inventory.mkIdentityFiles selectedHosts; home.file = inventory.mkIdentityFiles selectedHosts;
@@ -88,7 +88,7 @@ EOF
}; };
home.activation.rbwPinentryConfig = lib.hm.dag.entryAfter [ "writeBoundary" ] '' home.activation.rbwPinentryConfig = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
${pkgs.rbw}/bin/rbw config set pinentry "${pkgs.pinentry-qt}/bin/pinentry-qt" >/dev/null 2>&1 || true ${pkgs.rbw}/bin/rbw config set pinentry "${pkgs.pinentry-gtk2}/bin/pinentry-gtk-2" >/dev/null 2>&1 || true
''; '';
} }
]); ]);
+18 -12
View File
@@ -1,25 +1,24 @@
{ ... }: { { ... }: {
flake.homeManagerModules.wisdomDesktopGtkQtTheming = flake.homeManagerModules.wisdomDesktopGtkQtTheming =
{ config, lib, pkgs, ... }: { config, lib, pkgs, osConfig ? { }, ... }:
let let
root = config.chiasson.home; root = config.chiasson.home;
cfg = config.chiasson.home.desktop.theming; cfg = config.chiasson.home.desktop.theming;
dmsShell = (lib.attrByPath [ "chiasson" "desktop" "shell" ] null osConfig) == "dms";
qtPlatformTheme = if dmsShell then "qt6ct" else cfg.qt.platformTheme;
in in
{ {
options.chiasson.home.desktop.theming = { options.chiasson.home.desktop.theming = {
enable = lib.mkEnableOption '' enable = lib.mkEnableOption ''
WhiteSur GTK + icon themes, Phinger cursor, and Qt via the KDE platform theme same idea as WhiteSur GTK + icon themes, Phinger cursor, and Qt via qt6ct (DMS) or KDE platform theme.
the old `home-shared.nix` stack for Hyprland/Niri (no full Plasma session required). Optional Matugen accent colors load via gtk3/gtk4 extraCss when matugenGtkColors is enabled.
`dank-colors.css` import for DMS/matugen GTK accents.
''; '';
matugenGtkColors = lib.mkOption { matugenGtkColors = lib.mkOption {
type = lib.types.bool; type = lib.types.bool;
default = true; default = true;
description = '' description = ''
Add `@import url("dank-colors.css");` to gtk3/gtk4 extraCss. DMS/matugen writes Add `@import url("dank-colors.css");` to gtk3/gtk4 extraCss (DMS matugen writes the file).
`~/.config/gtk-3.0` / `gtk-4.0` `dank-colors.css` when dynamic theming is on disable if
you use this module without DMS.
''; '';
}; };
@@ -65,23 +64,30 @@
type = lib.types.str; type = lib.types.str;
default = "kde"; default = "kde";
description = '' description = ''
`QT_QPA_PLATFORMTHEME` (e.g. `kde` for Qt/KDE integration, matches previous flake). `QT_QPA_PLATFORMTHEME` when not using DMS shell. DMS hosts use qt6ct automatically.
''; '';
}; };
extraPackages = lib.mkOption { extraPackages = lib.mkOption {
type = lib.types.listOf lib.types.package; type = lib.types.listOf lib.types.package;
default = [ pkgs.whitesur-kde pkgs.qt6Packages.qt6ct ]; default = [ pkgs.kdePackages.qt6ct ];
description = "Extra packages (KDE look-and-feel + qt6ct GUI)."; description = "Qt platform integration packages.";
}; };
}; };
}; };
config = lib.mkIf (root.enable && cfg.enable) (lib.mkMerge [ config = lib.mkIf (root.enable && cfg.enable) (lib.mkMerge [
{ {
home.packages = cfg.qt.extraPackages; home.packages =
if dmsShell then
[ pkgs.kdePackages.qt6ct ]
else
cfg.qt.extraPackages;
home.sessionVariables = { home.sessionVariables = {
QT_QPA_PLATFORMTHEME = cfg.qt.platformTheme; QT_QPA_PLATFORMTHEME = qtPlatformTheme;
}
// lib.optionalAttrs (qtPlatformTheme == "qt6ct") {
QT_QPA_PLATFORMTHEME_QT6 = "qt6ct";
}; };
home.pointerCursor = { home.pointerCursor = {