Rebase to flake parts #8

This commit is contained in:
2026-05-08 21:48:22 -03:00
parent f98606dcce
commit 34b89af77f
30 changed files with 3567 additions and 1 deletions
+90
View File
@@ -0,0 +1,90 @@
{ inputs, ... }: {
flake.nixosModules.desktopShellDmsOptions = { lib, ... }: {
options.chiasson.desktop.shells.dms = {
enableGpuTemp = lib.mkOption {
type = lib.types.bool;
default = true;
description = "GPU temp in DMS bar.";
};
obsidianSnippetsDir = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = "Legacy single Obsidian snippets dir for matugen.";
};
obsidianConfigDirs = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
description = "Vault `.obsidian/` paths for matugen.";
};
obsidianSnippetsDirs = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
description = "Explicit `.obsidian/snippets` paths.";
};
extraRightBarWidgets = lib.mkOption {
type = lib.types.listOf lib.types.attrs;
default = [ ];
description = "Extra right-bar widgets (prepended).";
};
enableWvkbdToggle = lib.mkEnableOption ''
wvkbd DMS plugin + bar toggle (touch / uConsole).
'';
enableRbwLockToggle = lib.mkEnableOption ''
rbw vault lock/unlock button in the DMS bar (Bitwarden CLI via rbw).
'';
rebuildCommand = lib.mkOption {
type = lib.types.nullOr (lib.types.listOf lib.types.str);
default = null;
example = [ "sudo" "nixos-rebuild" "switch" "--flake" ".#14900k" ];
description = "Command used by DMS nix-monitor widget for rebuild actions.";
};
};
};
flake.homeManagerModules.desktopShellDms = {
lib,
osConfig ? { },
...
}:
let
cfg = lib.attrByPath [ "chiasson" "desktop" "shells" "dms" ] { } osConfig;
selectedShell = lib.attrByPath [ "chiasson" "desktop" "shell" ] null osConfig;
dmsEnabled = selectedShell == "dms";
hostName = lib.attrByPath [ "networking" "hostName" ] "nixos" osConfig;
rebuildCommand =
if (cfg.rebuildCommand or null) != null then
cfg.rebuildCommand
else
[ "sudo" "nixos-rebuild" "switch" "--flake" ".#${hostName}" ];
in
{
imports = [
./home-manager/default.nix
];
config = lib.mkIf dmsEnabled {
dms.enable = true;
dms.enableGpuTemp = cfg.enableGpuTemp or true;
dms.obsidianSnippetsDir = cfg.obsidianSnippetsDir or null;
dms.obsidianConfigDirs = cfg.obsidianConfigDirs or [ ];
dms.obsidianSnippetsDirs = cfg.obsidianSnippetsDirs or [ ];
dms.enableWvkbdToggle = cfg.enableWvkbdToggle or false;
dms.enableRbwLockToggle = cfg.enableRbwLockToggle or false;
dms.extraRightBarWidgets =
(lib.optionals (cfg.enableWvkbdToggle or false) [
{
id = "wvkbdToggle";
enabled = true;
}
])
++ (lib.optionals (cfg.enableRbwLockToggle or false) [
{
id = "rbwLockToggle";
enabled = true;
}
])
++ (cfg.extraRightBarWidgets or [ ]);
programs.nix-monitor.rebuildCommand = rebuildCommand;
};
};
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,80 @@
import QtQuick
import Quickshell
import Quickshell.Io
import qs.Common
import qs.Services
import qs.Widgets
import qs.Modules.Plugins
PluginComponent {
id: root
property bool vaultUnlocked: false
function refreshLockState() {
if (!statusProcess.running)
statusProcess.exec(["rbw", "unlocked"]);
}
function toggleLock() {
if (root.vaultUnlocked) {
Quickshell.execDetached(["rbw", "lock"]);
} else {
Quickshell.execDetached(["rbw", "unlock"]);
}
}
pillClickAction: () => root.toggleLock()
Component.onCompleted: refreshLockState()
Timer {
interval: 2500
repeat: true
running: true
onTriggered: root.refreshLockState()
}
Process {
id: statusProcess
command: ["rbw", "unlocked"]
onExited: (exitCode, _exitStatus) => {
root.vaultUnlocked = exitCode === 0;
}
}
horizontalBarPill: Component {
MouseArea {
implicitWidth: iconH.implicitWidth
implicitHeight: iconH.implicitHeight
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: root.toggleLock()
DankIcon {
id: iconH
name: root.vaultUnlocked ? "lock_open_right" : "lock"
size: root.iconSize
color: parent.containsMouse ? Theme.primary : Theme.surfaceText
}
}
}
verticalBarPill: Component {
MouseArea {
implicitWidth: iconV.implicitWidth
implicitHeight: iconV.implicitHeight
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: root.toggleLock()
DankIcon {
id: iconV
name: root.vaultUnlocked ? "lock_open_right" : "lock"
size: root.iconSize
color: parent.containsMouse ? Theme.primary : Theme.surfaceText
anchors.horizontalCenter: parent.horizontalCenter
}
}
}
}
@@ -0,0 +1,16 @@
import QtQuick
import qs.Common
import qs.Modules.Plugins
PluginSettings {
id: root
pluginId: "rbwLockToggle"
StyledText {
width: parent.width
text: "Shows rbw vault state with a closed lock (locked) or open lock (unlocked). Click to run `rbw unlock` (pinentry) or `rbw lock`. Requires `rbw` on PATH in the DMS session and a working pinentry."
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
wrapMode: Text.WordWrap
}
}
@@ -0,0 +1,13 @@
{
"id": "rbwLockToggle",
"name": "Bitwarden (rbw) lock",
"description": "Bar control for rbw vault: locked/unlocked padlock; click to unlock or lock",
"version": "1.0.0",
"author": "NixOS-V2",
"type": "widget",
"capabilities": ["dankbar-widget"],
"component": "./RbwLockToggle.qml",
"settings": "./RbwLockToggleSettings.qml",
"icon": "lock_open",
"permissions": ["settings_read"]
}
@@ -0,0 +1,51 @@
import QtQuick
import Quickshell
import qs.Common
import qs.Services
import qs.Widgets
import qs.Modules.Plugins
PluginComponent {
id: root
function toggleKeyboard() {
Quickshell.execDetached(["sh", "-c", "pkill -SIGRTMIN -x wvkbd-mobintl"]);
}
pillClickAction: () => root.toggleKeyboard()
horizontalBarPill: Component {
MouseArea {
implicitWidth: icon.implicitWidth
implicitHeight: icon.implicitHeight
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: root.toggleKeyboard()
DankIcon {
id: icon
name: "keyboard"
size: Theme.iconSize
color: parent.containsMouse ? Theme.primary : Theme.surfaceText
}
}
}
verticalBarPill: Component {
MouseArea {
implicitWidth: iconV.implicitWidth
implicitHeight: iconV.implicitHeight
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: root.toggleKeyboard()
DankIcon {
id: iconV
name: "keyboard"
size: Theme.iconSize
color: parent.containsMouse ? Theme.primary : Theme.surfaceText
anchors.horizontalCenter: parent.horizontalCenter
}
}
}
}
@@ -0,0 +1,16 @@
import QtQuick
import qs.Common
import qs.Modules.Plugins
PluginSettings {
id: root
pluginId: "wvkbdToggle"
StyledText {
width: parent.width
text: "Click the keyboard icon in the bar to show or hide the on-screen keyboard (wvkbd)."
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
wrapMode: Text.WordWrap
}
}
@@ -0,0 +1,13 @@
{
"id": "wvkbdToggle",
"name": "Virtual Keyboard Toggle",
"description": "Bar button to show/hide the wvkbd on-screen keyboard (for touch/tablet)",
"version": "1.0.0",
"author": "NixOS-V2",
"type": "widget",
"capabilities": ["dankbar-widget"],
"component": "./WvkbdToggle.qml",
"settings": "./WvkbdToggleSettings.qml",
"icon": "keyboard",
"permissions": ["settings_read"]
}
@@ -0,0 +1,119 @@
/**
* Vesktop / Vencord theme — matugen + DMS wallpaper colors.
* Derived from pywal-vencord-style mapping (NixOS-New templates/colors-discord.css).
*/
* {
/* Surfaces */
--background-primary: {{colors.background.default.hex}};
--background-secondary: {{colors.surface.default.hex}};
--background-tertiary: {{colors.surface_dim.default.hex}};
--background-primary-alt: {{colors.background.default.hex}};
--background-secondary-alt: {{colors.surface.default.hex}};
--background-tertiary-alt: {{colors.surface_dim.default.hex}};
--channeltextarea-background: {{colors.surface.default.hex}};
--custom-channel-members-bg: {{colors.surface.default.hex}};
--profile-gradient-primary-color: {{colors.surface.default.hex}};
--profile-gradient-secondary-color: {{colors.surface_variant.default.hex}};
--__header-bar-background: {{colors.surface.default.hex}} !important;
--bg-base-tertiary: {{colors.background.default.hex}};
--card-primary-bg: color-mix(in srgb, {{colors.surface.default.hex}}, black 20%);
--input-background: color-mix(in srgb, {{colors.surface.default.hex}}, black 20%);
--autocomplete-bg: color-mix(in srgb, {{colors.surface.default.hex}}, black 20%);
--background-nested-floating: color-mix(in srgb, {{colors.surface.default.hex}}, black 20%);
--background-floating: color-mix(in srgb, {{colors.surface.default.hex}}, black 20%);
--scrollbar-auto-track: color-mix(in srgb, {{colors.surface.default.hex}}, black 20%);
--scrollbar-thin-track: color-mix(in srgb, {{colors.surface.default.hex}}, black 20%);
--border-subtle: color-mix(in srgb, {{colors.surface.default.hex}}, black 20%);
--background-base-lowest: color-mix(in srgb, {{colors.surface.default.hex}}, black 20%);
--background-surface-high: color-mix(in srgb, {{colors.surface.default.hex}}, black 20%);
--button-secondary-background: color-mix(in srgb, {{colors.surface.default.hex}}, black 30%);
--background-surface-higher: color-mix(in srgb, {{colors.surface.default.hex}}, black 30%);
--background-base-lower: color-mix(in srgb, {{colors.surface.default.hex}}, black 35%);
--background-message-hover: color-mix(in srgb, {{colors.surface.default.hex}}, black 40%);
--button-secondary-background-hover: color-mix(in srgb, {{colors.surface.default.hex}}, black 40%);
--background-base-low: color-mix(in srgb, {{colors.surface.default.hex}}, black 40%);
--background-surface-highest: color-mix(in srgb, {{colors.surface.default.hex}}, black 40%);
--chat-background-default: color-mix(in srgb, {{colors.surface.default.hex}}, black 45%);
--button-secondary-background-active: color-mix(in srgb, {{colors.surface.default.hex}}, black 60%);
--primary-630: {{colors.surface_variant.default.hex}};
/* Muted / secondary chrome */
--scrollbar-auto-thumb: {{colors.on_surface_variant.default.hex}};
--scrollbar-thin-thumb: {{colors.on_surface_variant.default.hex}};
--interactive-muted: {{colors.on_surface_variant.default.hex}};
--text-muted: {{colors.on_surface_variant.default.hex}};
--background-modifier-hover: color-mix(in srgb, {{colors.on_surface_variant.default.hex}}, black 40%);
--background-modifier-active: color-mix(in srgb, {{colors.on_surface_variant.default.hex}}, black 20%);
--background-modifier-accent: {{colors.secondary_container.default.hex}};
--background-accent: {{colors.secondary.default.hex}};
--input-border: {{colors.outline.default.hex}};
--border-normal: {{colors.outline.default.hex}};
--icon-secondary: {{colors.on_surface_variant.default.hex}};
--icon-tertiary: {{colors.on_surface_variant.default.hex}};
--channel-icon: {{colors.on_surface_variant.default.hex}};
--channels-default: {{colors.on_surface_variant.default.hex}};
--header-primary: {{colors.on_surface.default.hex}};
--__lottieIconColor: {{colors.on_surface_variant.default.hex}};
--interactive-normal: {{colors.on_surface_variant.default.hex}};
/* Selection / highlights */
--red-400: {{colors.error.default.hex}};
--background-modifier-selected: {{colors.secondary_container.default.hex}};
--notice-background-positive: color-mix(in srgb, {{colors.tertiary.default.hex}}, black 75%);
--notice-text-positive: {{colors.tertiary.default.hex}};
/* Danger */
--status-danger: {{colors.error.default.hex}};
--button-outline-danger-border: {{colors.error.default.hex}};
--button-outline-danger-text: {{colors.error.default.hex}};
--button-danger-background: {{colors.error.default.hex}};
--yellow-300: {{colors.error.default.hex}};
/* Brand / accents */
--brand-experiment: {{colors.primary.default.hex}};
--brand-experiment-360: {{colors.primary.default.hex}};
--brand-experiment-500: {{colors.primary.default.hex}};
--profile-gradient-button-color: {{colors.primary.default.hex}};
--green-360: {{colors.primary.default.hex}};
/* Foreground */
--text-normal: {{colors.on_surface.default.hex}};
--interactive-active: {{colors.on_surface.default.hex}};
}
/* Status indicators (legacy Discord hex fills) */
rect[fill="#d83a41"] {
fill: {{colors.error.default.hex}} !important;
}
rect[fill="#cc954c"] {
fill: {{colors.secondary.default.hex}} !important;
}
rect[fill="#40a258"] {
fill: {{colors.primary.default.hex}} !important;
}
.wrapper_ef3116 {
background: {{colors.background.default.hex}} !important;
}
.bar_c38106 {
background: {{colors.background.default.hex}} !important;
}