Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76ebc8c822 | ||
|
|
32dd2abdce | ||
|
|
694317acbb | ||
|
|
a8e5c200dc | ||
|
|
ee0a2f39e9 | ||
|
|
666e84bb26 | ||
|
|
f3dddc9150 | ||
|
|
4adb59808f | ||
|
|
d117d26fde | ||
|
|
959ad30fdc |
@@ -210,3 +210,9 @@ kept its ssh host key. Run it after ANY change to the kexec paths.
|
|||||||
- **`kexec-local` stages on `/var/tmp`, not `/tmp`**: `kexec-run.sh` appends a fresh cpio
|
- **`kexec-local` stages on `/var/tmp`, not `/tmp`**: `kexec-run.sh` appends a fresh cpio
|
||||||
to `kexec/initrd` in place and execs binaries from that dir, so a size-capped or
|
to `kexec/initrd` in place and execs binaries from that dir, so a size-capped or
|
||||||
`noexec` tmpfs gives a half-written initrd or a bare "Permission denied".
|
`noexec` tmpfs gives a half-written initrd or a bare "Permission denied".
|
||||||
|
- **terra's greeter is a throwaway Hyprland running `dotfiles/quickshell/greeter.qml`**
|
||||||
|
(`services/desktop/quickshell-greeter.nix`). It must exit after login or greetd never
|
||||||
|
starts the session, and with a Lua config `hyprctl dispatch exit` is REJECTED — it needs
|
||||||
|
`hyprctl dispatch 'hl.dsp.exit()'`. Test the flow without touching the real greetd by
|
||||||
|
running greetd's `fakegreet "qs -p …/greeter.qml"` inside a nested Hyprland
|
||||||
|
(user `user`, password `password`, then answer `9`).
|
||||||
|
|||||||
@@ -100,6 +100,8 @@ on it, hence the index loops in `HyprChromeShell`.
|
|||||||
and its panels, with `Bar/Panels/BarPanel.qml` the chamfered chrome they all
|
and its panels, with `Bar/Panels/BarPanel.qml` the chamfered chrome they all
|
||||||
extend; `Widgets/Polkit/` is the authentication agent and its dialog;
|
extend; `Widgets/Polkit/` is the authentication agent and its dialog;
|
||||||
`Widgets/Launcher/` is the primary application launcher (`SUPER_L`);
|
`Widgets/Launcher/` is the primary application launcher (`SUPER_L`);
|
||||||
|
`Widgets/Greeter/` is the greetd login screen, run standalone via `greeter.qml`
|
||||||
|
(see `services/desktop/quickshell-greeter.nix`), NOT part of `shell.qml`;
|
||||||
`Theme/Theme.qml` is this tree's palette singleton. `DebugWindow.qml` stages a
|
`Theme/Theme.qml` is this tree's palette singleton. `DebugWindow.qml` stages a
|
||||||
single widget on the secondary monitor for eyeballing it in isolation.
|
single widget on the secondary monitor for eyeballing it in isolation.
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,200 @@
|
|||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Wayland
|
||||||
|
import Quickshell.Services.Greetd
|
||||||
|
import qs.HyprChrome.Widgets
|
||||||
|
|
||||||
|
// greetd greeter: backdrop on every output, login panel on the primary one.
|
||||||
|
// Configured through env set by services/desktop/quickshell-greeter.nix.
|
||||||
|
Scope {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
readonly property string primaryName: Quickshell.env("QS_GREETER_OUTPUT") ?? ""
|
||||||
|
readonly property string defaultUser: Quickshell.env("QS_GREETER_USER") ?? ""
|
||||||
|
readonly property string sessionCommand: Quickshell.env("QS_GREETER_SESSION") || "start-hyprland"
|
||||||
|
readonly property string sessionName: Quickshell.env("QS_GREETER_SESSION_NAME") || "hyprland"
|
||||||
|
readonly property string hostName: Quickshell.env("QS_GREETER_HOST") || "localhost"
|
||||||
|
|
||||||
|
readonly property var primaryScreen: {
|
||||||
|
const screens = Quickshell.screens;
|
||||||
|
if (screens.length === 0)
|
||||||
|
return null;
|
||||||
|
for (let i = 0; i < screens.length; i++) {
|
||||||
|
if (screens[i].name === root.primaryName)
|
||||||
|
return screens[i];
|
||||||
|
}
|
||||||
|
return screens[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Typed password, held until PAM's first secret prompt arrives.
|
||||||
|
property string pendingSecret: ""
|
||||||
|
// PAM asked a follow-up (OTP etc.) that the user must answer directly.
|
||||||
|
property bool awaitingResponse: false
|
||||||
|
property bool busy: false
|
||||||
|
property bool launching: false
|
||||||
|
|
||||||
|
function setMessage(text, isError) {
|
||||||
|
content.message = text;
|
||||||
|
content.messageIsError = isError;
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetToPassword() {
|
||||||
|
root.pendingSecret = "";
|
||||||
|
root.awaitingResponse = false;
|
||||||
|
root.busy = false;
|
||||||
|
content.inputPrompt = "";
|
||||||
|
content.responseVisible = false;
|
||||||
|
content.clearSecret();
|
||||||
|
content.focusSecret();
|
||||||
|
}
|
||||||
|
|
||||||
|
function submit(user, secret) {
|
||||||
|
if (!Greetd.available) {
|
||||||
|
root.setMessage("greetd socket unavailable", true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
content.failed = false;
|
||||||
|
|
||||||
|
if (root.awaitingResponse) {
|
||||||
|
root.awaitingResponse = false;
|
||||||
|
root.busy = true;
|
||||||
|
content.clearSecret();
|
||||||
|
Greetd.respond(secret);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Greetd.state !== GreetdState.Inactive)
|
||||||
|
return;
|
||||||
|
|
||||||
|
root.setMessage("", false);
|
||||||
|
root.pendingSecret = secret;
|
||||||
|
root.busy = true;
|
||||||
|
Greetd.createSession(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: Greetd
|
||||||
|
|
||||||
|
function onAuthMessage(message, error, responseRequired, echoResponse) {
|
||||||
|
if (!responseRequired) {
|
||||||
|
root.setMessage(message, error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// First hidden prompt is the password already typed.
|
||||||
|
if (root.pendingSecret !== "" && !echoResponse) {
|
||||||
|
const secret = root.pendingSecret;
|
||||||
|
root.pendingSecret = "";
|
||||||
|
Greetd.respond(secret);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
root.busy = false;
|
||||||
|
root.awaitingResponse = true;
|
||||||
|
content.inputPrompt = message.replace(/:\s*$/, "");
|
||||||
|
content.responseVisible = echoResponse;
|
||||||
|
content.clearSecret();
|
||||||
|
content.focusSecret();
|
||||||
|
}
|
||||||
|
|
||||||
|
function onAuthFailure(message) {
|
||||||
|
root.resetToPassword();
|
||||||
|
content.failed = true;
|
||||||
|
root.setMessage(message || "authentication failed", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onError(error) {
|
||||||
|
root.resetToPassword();
|
||||||
|
root.setMessage(error, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onReadyToLaunch() {
|
||||||
|
root.setMessage("starting " + root.sessionName, false);
|
||||||
|
root.launching = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fade out first: greetd wants the greeter gone promptly after launch().
|
||||||
|
Timer {
|
||||||
|
running: root.launching
|
||||||
|
interval: 220
|
||||||
|
onTriggered: Greetd.launch([root.sessionCommand])
|
||||||
|
}
|
||||||
|
|
||||||
|
Variants {
|
||||||
|
model: Quickshell.screens
|
||||||
|
|
||||||
|
ChromeBackdrop {
|
||||||
|
required property var modelData
|
||||||
|
|
||||||
|
screen: modelData
|
||||||
|
active: true
|
||||||
|
dim: 1
|
||||||
|
wlrLayer: WlrLayer.Background
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PanelWindow {
|
||||||
|
screen: root.primaryScreen
|
||||||
|
visible: root.primaryScreen !== null
|
||||||
|
|
||||||
|
WlrLayershell.namespace: "hyprchrome-greeter"
|
||||||
|
WlrLayershell.layer: WlrLayer.Overlay
|
||||||
|
WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive
|
||||||
|
exclusionMode: ExclusionMode.Ignore
|
||||||
|
color: "transparent"
|
||||||
|
|
||||||
|
anchors {
|
||||||
|
top: true
|
||||||
|
left: true
|
||||||
|
right: true
|
||||||
|
bottom: true
|
||||||
|
}
|
||||||
|
|
||||||
|
LoginContent {
|
||||||
|
id: content
|
||||||
|
|
||||||
|
width: 640
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
y: Math.max(32, Math.round(parent.height * 0.42 - height / 2)) + (1 - opacity) * 12
|
||||||
|
|
||||||
|
opacity: root.launching ? 0 : 1
|
||||||
|
Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutCubic } }
|
||||||
|
|
||||||
|
hostName: root.hostName
|
||||||
|
sessionName: root.sessionName
|
||||||
|
user: root.defaultUser
|
||||||
|
busy: root.busy || root.launching
|
||||||
|
|
||||||
|
onSubmitted: (user, secret) => root.submit(user, secret)
|
||||||
|
|
||||||
|
// A different user invalidates a half-finished conversation.
|
||||||
|
onUserEdited: {
|
||||||
|
if (Greetd.state !== GreetdState.Inactive)
|
||||||
|
Greetd.cancelSession();
|
||||||
|
root.resetToPassword();
|
||||||
|
content.focusUser();
|
||||||
|
}
|
||||||
|
|
||||||
|
onPowerRequested: action => Quickshell.execDetached(["systemctl", action])
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
if (root.defaultUser !== "")
|
||||||
|
content.focusSecret();
|
||||||
|
else
|
||||||
|
content.focusUser();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
running: true
|
||||||
|
repeat: true
|
||||||
|
interval: 1000
|
||||||
|
triggeredOnStart: true
|
||||||
|
onTriggered: content.now = new Date()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,304 @@
|
|||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import qs.HyprChrome.Theme
|
||||||
|
|
||||||
|
// Headless visual core of the login greeter; Greeter.qml owns greetd.
|
||||||
|
Item {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property string hostName: ""
|
||||||
|
property string sessionName: ""
|
||||||
|
property date now: new Date()
|
||||||
|
|
||||||
|
// Label over the secret field. Empty means the plain password step; set
|
||||||
|
// when PAM asks for something else (OTP, PIN).
|
||||||
|
property string inputPrompt: ""
|
||||||
|
property bool responseVisible: false
|
||||||
|
|
||||||
|
property string message: ""
|
||||||
|
property bool messageIsError: false
|
||||||
|
property bool failed: false
|
||||||
|
property bool busy: false
|
||||||
|
|
||||||
|
property alias user: userInput.text
|
||||||
|
property alias response: secretInput.text
|
||||||
|
|
||||||
|
signal submitted(string user, string response)
|
||||||
|
signal userEdited
|
||||||
|
signal powerRequested(string action)
|
||||||
|
|
||||||
|
function focusSecret() { secretInput.forceActiveFocus(); }
|
||||||
|
function focusUser() { userInput.forceActiveFocus(); }
|
||||||
|
function clearSecret() { secretInput.text = ""; }
|
||||||
|
|
||||||
|
implicitWidth: 640
|
||||||
|
implicitHeight: panel.implicitHeight
|
||||||
|
|
||||||
|
function submit() {
|
||||||
|
if (root.busy)
|
||||||
|
return;
|
||||||
|
if (userInput.text.trim() === "") {
|
||||||
|
root.focusUser();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
root.submitted(userInput.text.trim(), secretInput.text);
|
||||||
|
}
|
||||||
|
|
||||||
|
component MicroText: Text {
|
||||||
|
color: Theme.muted
|
||||||
|
font.family: Theme.microFont
|
||||||
|
font.pixelSize: 8
|
||||||
|
font.letterSpacing: 0.9
|
||||||
|
elide: Text.ElideRight
|
||||||
|
}
|
||||||
|
|
||||||
|
component Field: Rectangle {
|
||||||
|
id: field
|
||||||
|
|
||||||
|
property bool active: false
|
||||||
|
property bool alert: false
|
||||||
|
property string glyph: ""
|
||||||
|
default property alias input: slot.data
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
implicitHeight: 36
|
||||||
|
color: Theme.selection
|
||||||
|
border.width: 1
|
||||||
|
border.color: field.alert ? Theme.hot : field.active ? Theme.accentAlpha(0.7) : Theme.hair
|
||||||
|
|
||||||
|
Behavior on border.color { ColorAnimation { duration: 120 } }
|
||||||
|
|
||||||
|
// Focus tick on the left edge.
|
||||||
|
Rectangle {
|
||||||
|
width: 2
|
||||||
|
height: parent.height
|
||||||
|
color: Theme.accent
|
||||||
|
visible: field.active
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: glyphText
|
||||||
|
|
||||||
|
x: 12
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
text: field.glyph
|
||||||
|
color: field.active ? Theme.accent : Theme.disabled
|
||||||
|
font.family: Theme.displayFont
|
||||||
|
font.pixelSize: 14
|
||||||
|
font.bold: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: slot
|
||||||
|
|
||||||
|
anchors.left: glyphText.right
|
||||||
|
anchors.leftMargin: 10
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: 12
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
component PowerChip: Rectangle {
|
||||||
|
id: chip
|
||||||
|
|
||||||
|
property string label: ""
|
||||||
|
property string action: ""
|
||||||
|
|
||||||
|
width: chipLabel.implicitWidth + 16
|
||||||
|
height: chipLabel.implicitHeight + 8
|
||||||
|
color: chipMouse.containsMouse ? Theme.accent : "transparent"
|
||||||
|
border.width: 1
|
||||||
|
border.color: chipMouse.containsMouse ? Theme.accent : Theme.disabled
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: chipLabel
|
||||||
|
|
||||||
|
anchors.centerIn: parent
|
||||||
|
text: chip.label
|
||||||
|
color: chipMouse.containsMouse ? Theme.surface : Theme.muted
|
||||||
|
font.family: Theme.microFont
|
||||||
|
font.pixelSize: 9
|
||||||
|
font.letterSpacing: 0.8
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: chipMouse
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
onClicked: root.powerRequested(chip.action)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LoginPanel {
|
||||||
|
id: panel
|
||||||
|
|
||||||
|
width: root.width
|
||||||
|
panelId: "LGN"
|
||||||
|
title: "SESSION // " + root.hostName.toUpperCase()
|
||||||
|
meta: "GREETD"
|
||||||
|
busy: root.busy
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
width: parent.width
|
||||||
|
spacing: 16
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
spacing: 20
|
||||||
|
|
||||||
|
// ---- clock column ----
|
||||||
|
ColumnLayout {
|
||||||
|
Layout.preferredWidth: 190
|
||||||
|
Layout.alignment: Qt.AlignTop
|
||||||
|
spacing: 4
|
||||||
|
|
||||||
|
Text {
|
||||||
|
text: Qt.formatTime(root.now, "HH:mm")
|
||||||
|
color: Theme.text
|
||||||
|
font.family: Theme.displayFont
|
||||||
|
font.pixelSize: 54
|
||||||
|
font.letterSpacing: 2
|
||||||
|
}
|
||||||
|
|
||||||
|
MicroText {
|
||||||
|
text: Qt.formatDate(root.now, "ddd dd.MM.yyyy").toUpperCase()
|
||||||
|
color: Theme.accent
|
||||||
|
font.pixelSize: 10
|
||||||
|
}
|
||||||
|
|
||||||
|
// Seconds as a segment meter: one cell per five seconds.
|
||||||
|
Row {
|
||||||
|
Layout.topMargin: 10
|
||||||
|
spacing: 3
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: 12
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
required property int index
|
||||||
|
|
||||||
|
width: 11
|
||||||
|
height: 5
|
||||||
|
color: index < Math.floor(root.now.getSeconds() / 5) + 1
|
||||||
|
? Theme.accent : Theme.raised
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MicroText {
|
||||||
|
Layout.topMargin: 10
|
||||||
|
text: "SESSION " + root.sessionName.toUpperCase()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
Layout.fillHeight: true
|
||||||
|
implicitWidth: 1
|
||||||
|
color: Theme.textAlpha(0.12)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---- credentials ----
|
||||||
|
ColumnLayout {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.alignment: Qt.AlignTop
|
||||||
|
spacing: 6
|
||||||
|
|
||||||
|
MicroText { text: "OPERATOR" }
|
||||||
|
|
||||||
|
Field {
|
||||||
|
glyph: "@"
|
||||||
|
active: userInput.activeFocus
|
||||||
|
|
||||||
|
TextInput {
|
||||||
|
id: userInput
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
verticalAlignment: TextInput.AlignVCenter
|
||||||
|
enabled: !root.busy && root.inputPrompt === ""
|
||||||
|
color: Theme.text
|
||||||
|
selectionColor: Theme.accent
|
||||||
|
selectedTextColor: Theme.surface
|
||||||
|
font.family: Theme.displayFont
|
||||||
|
font.pixelSize: 14
|
||||||
|
font.letterSpacing: 1
|
||||||
|
clip: true
|
||||||
|
|
||||||
|
onTextEdited: root.userEdited()
|
||||||
|
onAccepted: root.focusSecret()
|
||||||
|
KeyNavigation.tab: secretInput
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MicroText {
|
||||||
|
Layout.topMargin: 6
|
||||||
|
text: root.inputPrompt !== "" ? root.inputPrompt.toUpperCase() : "PASSPHRASE"
|
||||||
|
color: root.inputPrompt !== "" ? Theme.accent : Theme.muted
|
||||||
|
}
|
||||||
|
|
||||||
|
Field {
|
||||||
|
glyph: ">_"
|
||||||
|
active: secretInput.activeFocus
|
||||||
|
alert: root.failed
|
||||||
|
|
||||||
|
TextInput {
|
||||||
|
id: secretInput
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
verticalAlignment: TextInput.AlignVCenter
|
||||||
|
enabled: !root.busy
|
||||||
|
color: Theme.text
|
||||||
|
selectionColor: Theme.accent
|
||||||
|
selectedTextColor: Theme.surface
|
||||||
|
font.family: Theme.displayFont
|
||||||
|
font.pixelSize: 14
|
||||||
|
font.letterSpacing: 1
|
||||||
|
clip: true
|
||||||
|
|
||||||
|
echoMode: root.responseVisible ? TextInput.Normal : TextInput.Password
|
||||||
|
passwordCharacter: "▪"
|
||||||
|
passwordMaskDelay: 0
|
||||||
|
|
||||||
|
onAccepted: root.submit()
|
||||||
|
KeyNavigation.backtab: userInput
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Status line; keeps its height so the panel does not jump.
|
||||||
|
MicroText {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 4
|
||||||
|
Layout.preferredHeight: 12
|
||||||
|
text: root.busy && root.message === "" ? "AUTHENTICATING…" : root.message.toUpperCase()
|
||||||
|
color: root.messageIsError ? Theme.hot : root.busy ? Theme.accent : Theme.muted
|
||||||
|
font.pixelSize: 9
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---- footer ----
|
||||||
|
Rectangle {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
implicitHeight: 1
|
||||||
|
color: Theme.textAlpha(0.12)
|
||||||
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
spacing: 14
|
||||||
|
|
||||||
|
MicroText { text: "ENTER LOG IN" }
|
||||||
|
MicroText { text: "TAB SWITCH FIELD" }
|
||||||
|
Item { Layout.fillWidth: true }
|
||||||
|
|
||||||
|
PowerChip { label: "REBOOT"; action: "reboot" }
|
||||||
|
PowerChip { label: "POWER OFF"; action: "poweroff" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,231 @@
|
|||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Shapes
|
||||||
|
import qs.HyprChrome.Theme
|
||||||
|
|
||||||
|
// Panel chrome for the login greeter. Same vocabulary as PolkitPanel, mirrored:
|
||||||
|
// cuts on the OTHER diagonal (top-left, bottom-right), registration brackets
|
||||||
|
// instead of detached caps, and a segmented accent spine down the left edge.
|
||||||
|
Item {
|
||||||
|
id: panel
|
||||||
|
|
||||||
|
property string panelId: ""
|
||||||
|
property string title: ""
|
||||||
|
property string meta: ""
|
||||||
|
|
||||||
|
property int chamfer: 20
|
||||||
|
property int padding: 18
|
||||||
|
property int spineWidth: 3
|
||||||
|
property int spineSegments: 9
|
||||||
|
|
||||||
|
// Sweeps the bottom rule while greetd is working.
|
||||||
|
property bool busy: false
|
||||||
|
|
||||||
|
readonly property int headerHeight: 32
|
||||||
|
readonly property int headerPadding: 12
|
||||||
|
|
||||||
|
property real bracketGap: 6
|
||||||
|
property real bracketArm: 14
|
||||||
|
|
||||||
|
readonly property real activeChamfer: Math.max(2, Math.min(panel.chamfer, panel.height / 2 - 1))
|
||||||
|
|
||||||
|
default property alias content: body.data
|
||||||
|
|
||||||
|
implicitHeight: Math.round(body.y + body.height + panel.padding)
|
||||||
|
|
||||||
|
Shape {
|
||||||
|
id: panelShape
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
preferredRendererType: Shape.CurveRenderer
|
||||||
|
|
||||||
|
ShapePath {
|
||||||
|
fillColor: Theme.surface
|
||||||
|
strokeColor: Theme.hair
|
||||||
|
strokeWidth: 1
|
||||||
|
|
||||||
|
startX: panel.activeChamfer; startY: 0
|
||||||
|
PathLine { x: panelShape.width; y: 0 }
|
||||||
|
PathLine { x: panelShape.width; y: panelShape.height - panel.activeChamfer }
|
||||||
|
PathLine { x: panelShape.width - panel.activeChamfer; y: panelShape.height }
|
||||||
|
PathLine { x: 0; y: panelShape.height }
|
||||||
|
PathLine { x: 0; y: panel.activeChamfer }
|
||||||
|
PathLine { x: panel.activeChamfer; y: 0 }
|
||||||
|
}
|
||||||
|
|
||||||
|
// Accent along each cut, inset so it reads as an edge highlight.
|
||||||
|
ShapePath {
|
||||||
|
fillColor: "transparent"
|
||||||
|
strokeColor: Theme.accent
|
||||||
|
strokeWidth: 2
|
||||||
|
capStyle: ShapePath.FlatCap
|
||||||
|
|
||||||
|
startX: 0; startY: panel.activeChamfer
|
||||||
|
PathLine { x: panel.activeChamfer; y: 0 }
|
||||||
|
}
|
||||||
|
|
||||||
|
ShapePath {
|
||||||
|
fillColor: "transparent"
|
||||||
|
strokeColor: Theme.accent
|
||||||
|
strokeWidth: 2
|
||||||
|
capStyle: ShapePath.FlatCap
|
||||||
|
|
||||||
|
startX: panelShape.width; startY: panelShape.height - panel.activeChamfer
|
||||||
|
PathLine { x: panelShape.width - panel.activeChamfer; y: panelShape.height }
|
||||||
|
}
|
||||||
|
|
||||||
|
// Registration brackets on the two square corners, echoing the
|
||||||
|
// backdrop's crosses.
|
||||||
|
ShapePath {
|
||||||
|
fillColor: "transparent"
|
||||||
|
strokeColor: Theme.muted
|
||||||
|
strokeWidth: 1
|
||||||
|
|
||||||
|
startX: panelShape.width + panel.bracketGap - panel.bracketArm
|
||||||
|
startY: -panel.bracketGap
|
||||||
|
PathLine { x: panelShape.width + panel.bracketGap; y: -panel.bracketGap }
|
||||||
|
PathLine { x: panelShape.width + panel.bracketGap; y: -panel.bracketGap + panel.bracketArm }
|
||||||
|
}
|
||||||
|
|
||||||
|
ShapePath {
|
||||||
|
fillColor: "transparent"
|
||||||
|
strokeColor: Theme.muted
|
||||||
|
strokeWidth: 1
|
||||||
|
|
||||||
|
startX: -panel.bracketGap
|
||||||
|
startY: panelShape.height + panel.bracketGap - panel.bracketArm
|
||||||
|
PathLine { x: -panel.bracketGap; y: panelShape.height + panel.bracketGap }
|
||||||
|
PathLine { x: -panel.bracketGap + panel.bracketArm; y: panelShape.height + panel.bracketGap }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Segmented spine, below the header.
|
||||||
|
Column {
|
||||||
|
x: 0
|
||||||
|
y: panel.headerHeight + 8
|
||||||
|
spacing: 3
|
||||||
|
|
||||||
|
readonly property real segment: (panel.height - panel.headerHeight - 8 - panel.activeChamfer - 8
|
||||||
|
- (panel.spineSegments - 1) * spacing) / panel.spineSegments
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: panel.spineSegments
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
required property int index
|
||||||
|
|
||||||
|
width: panel.spineWidth
|
||||||
|
height: Math.max(1, parent.segment)
|
||||||
|
color: Theme.accent
|
||||||
|
// Fades downward.
|
||||||
|
opacity: 1 - index / panel.spineSegments * 0.85
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Header: title, meta, slug chip on the right.
|
||||||
|
Text {
|
||||||
|
x: panel.activeChamfer + panel.headerPadding
|
||||||
|
anchors.verticalCenter: header.verticalCenter
|
||||||
|
text: panel.title
|
||||||
|
color: Theme.text
|
||||||
|
font.family: Theme.displayFont
|
||||||
|
font.pixelSize: 12
|
||||||
|
font.bold: true
|
||||||
|
font.letterSpacing: 1.4
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: header
|
||||||
|
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: panel.headerPadding
|
||||||
|
y: Math.round((panel.headerHeight - height) / 2)
|
||||||
|
spacing: 12
|
||||||
|
|
||||||
|
Text {
|
||||||
|
anchors.verticalCenter: slugChip.verticalCenter
|
||||||
|
visible: panel.meta.length > 0
|
||||||
|
text: panel.meta
|
||||||
|
color: Theme.muted
|
||||||
|
font.family: Theme.microFont
|
||||||
|
font.pixelSize: 8
|
||||||
|
font.letterSpacing: 0.7
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: slugChip
|
||||||
|
|
||||||
|
width: slugText.implicitWidth + 10
|
||||||
|
height: slugText.implicitHeight + 4
|
||||||
|
color: "transparent"
|
||||||
|
border.width: 1
|
||||||
|
border.color: Theme.accent
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: slugText
|
||||||
|
|
||||||
|
anchors.centerIn: parent
|
||||||
|
text: panel.panelId
|
||||||
|
color: Theme.accent
|
||||||
|
font.family: Theme.microFont
|
||||||
|
font.pixelSize: 11
|
||||||
|
font.bold: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Header rule: dashed, not solid, to set it apart from the polkit dialog.
|
||||||
|
Row {
|
||||||
|
x: panel.activeChamfer
|
||||||
|
y: panel.headerHeight
|
||||||
|
spacing: 3
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: Math.max(0, Math.floor((panel.width - panel.activeChamfer - 1) / 9))
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: 6
|
||||||
|
height: 1
|
||||||
|
color: Theme.textAlpha(0.18)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Busy sweep along the bottom edge.
|
||||||
|
Item {
|
||||||
|
x: 0
|
||||||
|
y: panel.height - 2
|
||||||
|
width: panel.width - panel.activeChamfer
|
||||||
|
height: 2
|
||||||
|
clip: true
|
||||||
|
visible: panel.busy
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: sweep
|
||||||
|
|
||||||
|
width: parent.width / 4
|
||||||
|
height: parent.height
|
||||||
|
color: Theme.accent
|
||||||
|
|
||||||
|
NumberAnimation on x {
|
||||||
|
running: panel.busy
|
||||||
|
loops: Animation.Infinite
|
||||||
|
from: -sweep.width
|
||||||
|
to: panel.width
|
||||||
|
duration: 900
|
||||||
|
easing.type: Easing.InOutQuad
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: body
|
||||||
|
|
||||||
|
x: panel.padding + panel.spineWidth
|
||||||
|
y: panel.headerHeight + panel.padding
|
||||||
|
width: Math.max(0, panel.width - panel.padding * 2 - panel.spineWidth)
|
||||||
|
height: childrenRect.height
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import Quickshell
|
||||||
|
import qs.HyprChrome.Widgets.Greeter
|
||||||
|
|
||||||
|
// greetd greeter entry point: `qs -p greeter.qml`, as the greeter user. See
|
||||||
|
// services/desktop/quickshell-greeter.nix.
|
||||||
|
Scope {
|
||||||
|
Greeter {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import QtQuick
|
||||||
|
import qs.HyprChrome.Widgets.Greeter
|
||||||
|
|
||||||
|
// Offscreen render of the login panel after a rejected password.
|
||||||
|
//
|
||||||
|
// ./tools/quickshell-preview/render.sh \
|
||||||
|
// tests/LoginPanelHeadless.qml \
|
||||||
|
// .artifacts/quickshell-preview/login-panel.png 700 340
|
||||||
|
LoginContent {
|
||||||
|
width: 640
|
||||||
|
|
||||||
|
hostName: "terra"
|
||||||
|
sessionName: "hyprland"
|
||||||
|
now: new Date(2026, 8, 18, 21, 47, 38)
|
||||||
|
user: "darman"
|
||||||
|
response: "hunter2"
|
||||||
|
|
||||||
|
message: "Authentication failure"
|
||||||
|
messageIsError: true
|
||||||
|
failed: true
|
||||||
|
}
|
||||||
+192
-3
@@ -38,9 +38,9 @@ let
|
|||||||
# it's inside Hermes's own write-safe root (HERMES_WRITE_SAFE_ROOT).
|
# it's inside Hermes's own write-safe root (HERMES_WRITE_SAFE_ROOT).
|
||||||
dropboxDir = "/mnt/jupiter/AppData/hermes-dropbox";
|
dropboxDir = "/mnt/jupiter/AppData/hermes-dropbox";
|
||||||
|
|
||||||
# Pinned by digest (captured 2026-08-21 from jupiter) rather than floating
|
# v2026.9.14, pinned by index digest rather than floating
|
||||||
# :latest, so bumping Hermes is an explicit edit here, not silent drift.
|
# :latest, so bumping Hermes is an explicit edit here, not silent drift.
|
||||||
hermesImage = "docker.io/nousresearch/hermes-agent@sha256:5342e518734a08f6c66b89b4262434813c28a77abbc59c230c8f1637df71a259";
|
hermesImage = "docker.io/nousresearch/hermes-agent@sha256:99641e57ec762c59e54cb44aa6746b7fc68c18b3c5ddb088af54234c613d9294";
|
||||||
|
|
||||||
# Kept identical to jupiter's instance purely so nothing else needs to
|
# Kept identical to jupiter's instance purely so nothing else needs to
|
||||||
# change if state ever gets migrated over.
|
# change if state ever gets migrated over.
|
||||||
@@ -74,6 +74,40 @@ let
|
|||||||
builtins.readFile ./gitea-pr-review-prompt.md
|
builtins.readFile ./gitea-pr-review-prompt.md
|
||||||
);
|
);
|
||||||
|
|
||||||
|
# Mnemosyne memory provider (local SQLite, third-party plugin — not bundled
|
||||||
|
# with the official image). Fully built as a Nix derivation — see
|
||||||
|
# pkgs/mnemosyne-env.nix — and mounted READ-ONLY into the container at a
|
||||||
|
# fixed path. The oneshot near the bottom of this file only writes the
|
||||||
|
# plugin symlink Docker needs at $HERMES_HOME/plugins/mnemosyne.
|
||||||
|
mnemosyneEnv = pkgs.callPackage ../../pkgs/mnemosyne-env.nix { };
|
||||||
|
|
||||||
|
# KittenTTS voice provider inputs (CPU-only; model + wheel hash-pinned).
|
||||||
|
# Provisioning unit near the bottom of this file; background on why the
|
||||||
|
# deps deviate from upstream's declaration lives in
|
||||||
|
# ./kittentts/requirements.txt + ./kittentts/kitten-misaki-stub.py.
|
||||||
|
kittenttsWheel = pkgs.fetchurl {
|
||||||
|
url = "https://github.com/KittenML/KittenTTS/releases/download/0.8.1/kittentts-0.8.1-py3-none-any.whl";
|
||||||
|
sha256 = "sha256-SCpDbE8fMZIVNxA3bkWf82iVF+vNp8KwUeL9QYe0GFE=";
|
||||||
|
};
|
||||||
|
kittenttsReqs = pkgs.writeText "kittentts-requirements.txt" (
|
||||||
|
builtins.readFile ./kittentts/requirements.txt
|
||||||
|
);
|
||||||
|
kittenttsStub = pkgs.writeText "kitten-tts-stub.py" (
|
||||||
|
builtins.readFile ./kittentts/kitten-misaki-stub.py
|
||||||
|
);
|
||||||
|
kittenttsModelOnnx = pkgs.fetchurl {
|
||||||
|
url = "https://huggingface.co/KittenML/kitten-tts-mini-0.8/resolve/main/kitten_tts_mini_v0_8.onnx";
|
||||||
|
sha256 = "sha256-D1u65PxIAMmNvFRKh+z6eVEN4vuCItsw0S5b/pF335E=";
|
||||||
|
};
|
||||||
|
kittenttsModelVoices = pkgs.fetchurl {
|
||||||
|
url = "https://huggingface.co/KittenML/kitten-tts-mini-0.8/resolve/main/voices.npz";
|
||||||
|
sha256 = "sha256-QK0mOJUrd7ey8wEn4mCOFp/GndJWtTvYqqNAmjMZPEI=";
|
||||||
|
};
|
||||||
|
kittenttsModelConfig = pkgs.fetchurl {
|
||||||
|
url = "https://huggingface.co/KittenML/kitten-tts-mini-0.8/resolve/main/config.json";
|
||||||
|
sha256 = "sha256-axYLybGeJOyyHoS8FPin2iH99H7HLUJFC8XPUUthgEo=";
|
||||||
|
};
|
||||||
|
|
||||||
# Wire event names (X-GitHub-Event) each route accepts — NOT the
|
# Wire event names (X-GitHub-Event) each route accepts — NOT the
|
||||||
# subscription names the gitea hooks in services/dev/gitea.nix use. The two
|
# subscription names the gitea hooks in services/dev/gitea.nix use. The two
|
||||||
# namespaces collide; see the long comment on the route unit below.
|
# namespaces collide; see the long comment on the route unit below.
|
||||||
@@ -228,6 +262,15 @@ in
|
|||||||
"${hermesHome}:/opt/data"
|
"${hermesHome}:/opt/data"
|
||||||
"${dropboxDir}:/opt/data/dropbox"
|
"${dropboxDir}:/opt/data/dropbox"
|
||||||
|
|
||||||
|
# Mnemosyne memory provider — a Nix-built python env, mounted :ro.
|
||||||
|
# Nothing fetched at boot, nothing writable from inside the container.
|
||||||
|
# The plugin symlink the oneshot at the bottom of this file writes
|
||||||
|
# points at the canonical store path (site-packages passthru), which
|
||||||
|
# is visible inside thanks to the existing /nix/store ro mount, so
|
||||||
|
# this /opt/data restatement is a readability alias, not a load
|
||||||
|
# bearing path.
|
||||||
|
"${mnemosyneEnv}:/opt/data/mnemosyne-env:ro"
|
||||||
|
|
||||||
# luna's Obsidian vault, synced with CouchDB on jupiter by
|
# luna's Obsidian vault, synced with CouchDB on jupiter by
|
||||||
# livesync-bridge.nix. Under /opt/data so she can write notes, not just
|
# livesync-bridge.nix. Under /opt/data so she can write notes, not just
|
||||||
# read them; the bridge runs as this same uid/gid so no chown is needed.
|
# read them; the bridge runs as this same uid/gid so no chown is needed.
|
||||||
@@ -395,7 +438,7 @@ in
|
|||||||
|
|
||||||
# created_at is cosmetic and the only key carried over from any
|
# created_at is cosmetic and the only key carried over from any
|
||||||
# existing route; everything else is replaced outright so a
|
# existing route; everything else is replaced outright so a
|
||||||
# leftover key from an earlier definition can't survive here.
|
# leftover key from an earlier definition cannot survive here.
|
||||||
def upsert($name; $r):
|
def upsert($name; $r):
|
||||||
.[$name] = ($r + { created_at: (.[$name].created_at // (now | todate)) });
|
.[$name] = ($r + { created_at: (.[$name].created_at // (now | todate)) });
|
||||||
|
|
||||||
@@ -418,4 +461,150 @@ in
|
|||||||
mv -f "$tmp" "$conf"
|
mv -f "$tmp" "$conf"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# ---- Mnemosyne memory provider ----------------------------------------
|
||||||
|
# The provider's Python closure (mnemosyneEnv, callPackage'd
|
||||||
|
# pkgs/mnemosyne-env.nix above) is a READ-ONLY nix store path mounted into
|
||||||
|
# the container — nothing fetched at boot, nothing inside the container can
|
||||||
|
# write to it, and the mono-repo reproducibility story applies. Hermes only
|
||||||
|
# needs one mutable pickup point: $HERMES_HOME/plugins/mnemosyne, the
|
||||||
|
# symlink its discovery scan looks for. Both the plugin wrapper and its
|
||||||
|
# sibling `mnemosyne` core package live in that env's single site-packages,
|
||||||
|
# so one link covers them.
|
||||||
|
#
|
||||||
|
# Path handling: the symlink target is spelled in the CONTAINER's path
|
||||||
|
# space (/opt/data/...), because Hermes resolves the plugin from inside the
|
||||||
|
# container — the same host/container mismatch the webhook prompts already
|
||||||
|
# navigate via containerHome. Host-side the identical literal resolves
|
||||||
|
# onto the same store path through hermesHome's bind mount.
|
||||||
|
#
|
||||||
|
# Failure posture: after=, not requires= — a failed link write leaves the
|
||||||
|
# container running with whatever memory.provider falls back to Hermes's
|
||||||
|
# built-in memory, not a dead bot. The ro mount itself is evaluated at
|
||||||
|
# build time, so there is nothing provisionable to drift at runtime.
|
||||||
|
systemd.services.hermes-agent-mnemosyne-plugin = {
|
||||||
|
description = "Link Mnemosyne provider into the Hermes plugin dir";
|
||||||
|
before = [ "podman-hermes-agent.service" ];
|
||||||
|
wantedBy = [ "podman-hermes-agent.service" ];
|
||||||
|
after = [ "hermes-agent-prepare-dirs.service" ];
|
||||||
|
requires = [ "hermes-agent-prepare-dirs.service" ];
|
||||||
|
path = [ pkgs.coreutils ];
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
RemainAfterExit = true;
|
||||||
|
};
|
||||||
|
script = ''
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
pluginsDir=${hermesHome}/plugins
|
||||||
|
pluginDir=$pluginsDir/mnemosyne
|
||||||
|
# Target is the STORE path itself, not a /opt/data restatement: the
|
||||||
|
# container already ro-mounts /nix/store for git/tea (see the volumes
|
||||||
|
# list), so the identical literal resolves on both sides of the bind
|
||||||
|
# mount. Using the canonical store path directly — not the
|
||||||
|
# /opt/data/mnemosyne-env mount — keeps one truth and still works
|
||||||
|
# whether Hermes resolves the link inside the container or host-side
|
||||||
|
# during debugging.
|
||||||
|
target="${mnemosyneEnv.sitePackages}/hermes_memory_provider"
|
||||||
|
|
||||||
|
if [ ! -d "$target" ]; then
|
||||||
|
echo "hermes_memory_provider not found in the mnemosyne env — unit bug, not transient" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "$pluginsDir"
|
||||||
|
chown ${hermesUid}:${hermesGid} "$pluginsDir"
|
||||||
|
# Atomic swap: write to a temp name, rename over the old link. `-T`
|
||||||
|
# errors loudly if the target turned into a directory for any reason.
|
||||||
|
ln -sfn "$target" "$pluginDir.new"
|
||||||
|
mv -Tf "$pluginDir.new" "$pluginDir"
|
||||||
|
chown -h ${hermesUid}:${hermesGid} "$pluginDir"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
# ---- KittenTTS voice provider ------------------------------------------
|
||||||
|
# CPU-only onnxruntime TTS (no GPU on mars), mini model per darman. The
|
||||||
|
# upstream `misaki[en]` declaration is deliberately not honored — it pulls
|
||||||
|
# torch→CUDA (5.6 GB verified); the runtime phonemizes with espeak-ng only,
|
||||||
|
# so the dead `from misaki import en, espeak` import is satisfied by a
|
||||||
|
# .pth-registered stub (kitten-misaki-stub.py) that fails loudly if misaki
|
||||||
|
# is ever actually used.
|
||||||
|
#
|
||||||
|
# Provisioner invariants (shaped by the Mnemosyne-round review):
|
||||||
|
# - `uv venv --clear`: re-provision cannot wedge on an existing dir.
|
||||||
|
# - Root runs NO python from this venv: the unit itself does only fs
|
||||||
|
# writes; the venv is chowned to the container uid before Hermes ever
|
||||||
|
# imports from it. (Hermes executes provider code as uid 986.)
|
||||||
|
# - HF model cache is PRE-SEEDED from hash-pinned store paths, so
|
||||||
|
# HF_HUB_OFFLINE=1 gives zero boot-time network and no drift.
|
||||||
|
# - Idempotent via a stamp keyed on the requirements hash; checked
|
||||||
|
# against BOTH the venv python and model files being intact.
|
||||||
|
#
|
||||||
|
# Trust boundary: the venv lives inside hermesHome (HERMES_WRITE_SAFE_ROOT),
|
||||||
|
# so luna can technically alter her own TTS engine. Deliberate: it's her
|
||||||
|
# voice, not her jail — the webhook filter scripts remain the only
|
||||||
|
# write-protected-but-load-bearing items.
|
||||||
|
systemd.services.hermes-agent-kittentts-provision = {
|
||||||
|
description = "Provision KittenTTS voice provider (side venv + offline HF cache)";
|
||||||
|
before = [ "podman-hermes-agent.service" ];
|
||||||
|
wantedBy = [ "podman-hermes-agent.service" ];
|
||||||
|
wants = [ "network-online.target" ];
|
||||||
|
after = [ "network-online.target" ];
|
||||||
|
path = [ pkgs.uv pkgs.coreutils ];
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
TimeoutStartSec = 600;
|
||||||
|
};
|
||||||
|
script = ''
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
venv=${hermesHome}/kittentts-venv
|
||||||
|
hubDir=${hermesHome}/kittentts-hf/hub/models--KittenML--kitten-tts-mini-0.8
|
||||||
|
snap=$hubDir/snapshots/kitten
|
||||||
|
stampFile=${hermesHome}/kittentts-provision.stamp
|
||||||
|
reqHash=$(sha256sum ${kittenttsReqs} | cut -d' ' -f1)
|
||||||
|
|
||||||
|
# Idempotent early exit: stamp + venv + all three model files intact.
|
||||||
|
if [ -f "$stampFile" ] && [ "$(cat "$stampFile")" = "$reqHash" ] \
|
||||||
|
&& [ -x "$venv/bin/python" ] \
|
||||||
|
&& [ -f "$snap/kitten_tts_mini_v0_8.onnx" ] \
|
||||||
|
&& [ -f "$snap/voices.npz" ] \
|
||||||
|
&& [ -f "$venv/lib/python3.13/site-packages/kitten_tts_stub.py" ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Venv (rebuilt rather than broken on --no-clear: uv exits 2 otherwise).
|
||||||
|
uv venv "$venv" --python ${pkgs.python313}/bin/python3 --clear --quiet
|
||||||
|
UV_CACHE_DIR=${hermesHome}/kittentts-uv-cache \
|
||||||
|
uv pip install --python "$venv/bin/python" --quiet \
|
||||||
|
--requirement ${kittenttsReqs}
|
||||||
|
# kittentts --no-deps: its overlay of spacy/misaki[en] is what drags in
|
||||||
|
# the CUDA tree; the requirements freeze already covers its real needs.
|
||||||
|
UV_CACHE_DIR=${hermesHome}/kittentts-uv-cache \
|
||||||
|
uv pip install --python "$venv/bin/python" --quiet --no-deps \
|
||||||
|
${kittenttsWheel}
|
||||||
|
|
||||||
|
# Dead-import shim: .pth auto-loads kitten_tts_stub at interpreter start
|
||||||
|
# so `from misaki import en, espeak` resolves without the real misaki.en.
|
||||||
|
siteDir=$("$venv/bin/python" -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])')
|
||||||
|
cp ${kittenttsStub} "$siteDir/kitten_tts_stub.py"
|
||||||
|
printf 'import kitten_tts_stub\n' > "$siteDir/zz-kitten-stub.pth"
|
||||||
|
|
||||||
|
# Seed the HF cache with the hashed model files (exact hub layout;
|
||||||
|
# hf_hub_download scans refs/snapshots on disk offline).
|
||||||
|
mkdir -p "$hubDir/refs" "$snap"
|
||||||
|
install -m 0444 ${kittenttsModelOnnx} "$snap/kitten_tts_mini_v0_8.onnx"
|
||||||
|
install -m 0444 ${kittenttsModelVoices} "$snap/voices.npz"
|
||||||
|
install -m 0444 ${kittenttsModelConfig} "$snap/config.json"
|
||||||
|
|
||||||
|
# Hand ownership to the container uid BEFORE any python runs in this
|
||||||
|
# tree (root never imports from it — that was Mnemosyne review #3).
|
||||||
|
chown -R ${hermesUid}:${hermesGid} "$venv" "$hubDir"
|
||||||
|
|
||||||
|
# Stamp LAST — a half-provisioned venv fails the integrity check and
|
||||||
|
# re-provisions on next boot rather than being trusted.
|
||||||
|
printf '%s' "$reqHash" > "$stampFile"
|
||||||
|
chown ${hermesUid}:${hermesGid} "$stampFile"
|
||||||
|
'';
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
# Runtime shim for KittenTTS on a CPU-only, disk-constrained host.
|
||||||
|
#
|
||||||
|
# kittentts/onnx_model.py opens with `from misaki import en, espeak` — a dead import:
|
||||||
|
# every code path that produces audio from text goes through phonemizer-fork's
|
||||||
|
# EspeakBackend (espeak-ng via espeakng-loader); misaki.en/espeak are never called.
|
||||||
|
# If misaki[en] were installed for real, those two imports would be a hook for the
|
||||||
|
# whole spacy → thinc → torch → CUDA chain (~5.6 GB verified). This stub registers
|
||||||
|
# `misaki.en` and `misaki.espeak` as import-time-only placeholders instead.
|
||||||
|
#
|
||||||
|
# Written into site-packages by the derivation (see pkgs/kittentts-env.nix) under
|
||||||
|
# `sitecustomize.py`-style auto-load — actually via a `kitten_tts_stub.py` + a `.pth`
|
||||||
|
# pointing at it, so any Python process in this env gets the stub registered before
|
||||||
|
# any kittentts import. If KittenTTS upstream ever starts USING misaki, this shim
|
||||||
|
# will fail loudly at import of the missing attributes (better than silent distortion),
|
||||||
|
# and the fix becomes "install the real misaki[en]" — a deliberate, reviewed change.
|
||||||
|
import sys
|
||||||
|
import types
|
||||||
|
|
||||||
|
_misaki = sys.modules.get("misaki")
|
||||||
|
if _misaki is None:
|
||||||
|
# Avoid registering a fake parent before the real misaki loads — the base misaki
|
||||||
|
# (addict/regex only) is installed normally, so usually already here.
|
||||||
|
import misaki # noqa: F401 (raises if base misaki is missing — loud, not silent)
|
||||||
|
_misaki = sys.modules["misaki"]
|
||||||
|
|
||||||
|
if getattr(_misaki, "en", None) is None:
|
||||||
|
_stub = types.ModuleType("misaki.en")
|
||||||
|
sys.modules.setdefault("misaki.en", _stub)
|
||||||
|
_misaki.en = _stub
|
||||||
|
|
||||||
|
if getattr(_misaki, "espeak", None) is None:
|
||||||
|
_stub2 = types.ModuleType("misaki.espeak")
|
||||||
|
sys.modules.setdefault("misaki.espeak", _stub2)
|
||||||
|
_misaki.espeak = _stub2
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
# Pinned requirements for the KittenTTS side-venv on mars (validated freeze, CPU-only).
|
||||||
|
#
|
||||||
|
# DEPENDENCY DISCIPLINE (important — this is NOT the upstream dependency set):
|
||||||
|
# `kittentts` declares `misaki[en]` + spacy, which transitively pull torch → the whole
|
||||||
|
# CUDA runtime (~5.6 GB with nvidia-* wheels, verified in a clean install on this box).
|
||||||
|
# NONE of that is reachable at runtime: onnx_model.py imports `from misaki import en, espeak`
|
||||||
|
# at module load but generate() phonemizes exclusively through `phonemizer-fork` +
|
||||||
|
# `espeakng-loader` (espeak-ng via EspeakBackend); misaki.en/espeak glyphs are parsed but
|
||||||
|
# never called in the ONNX path. mars has no GPU and a modest disk budget, so:
|
||||||
|
#
|
||||||
|
# - install kittentts with --no-deps and enumerate its deps manually,
|
||||||
|
# - install base `misaki` (NOT misaki[en]) — only addict/regex,
|
||||||
|
# - the misaki.en import is satisfied by a stub registered in sitecustomize
|
||||||
|
# (kitten-misaki-stub.py, written into site-packages by the derivation).
|
||||||
|
#
|
||||||
|
# Freeze captured 2026-09-19 from a verified CPU-only venv (python 3.13, i5-4460,
|
||||||
|
# generation ~= 1x realtime with the mini model, HF_HUB_OFFLINE=1).
|
||||||
|
#
|
||||||
|
# kittentts itself comes from a GitHub release wheel (0.8.1), not PyPI (PyPI's 0.1.3 is
|
||||||
|
# the old v0.1-lineage); see pkgs/kittentts-env.nix.
|
||||||
|
addict==2.4.0
|
||||||
|
anyio==4.15.1
|
||||||
|
attrs==26.1.0
|
||||||
|
babel==2.18.0
|
||||||
|
certifi==2026.7.22
|
||||||
|
cffi==2.1.1
|
||||||
|
click==8.5.0
|
||||||
|
cloudpickle==3.1.2
|
||||||
|
csvw==4.1.0
|
||||||
|
dlinfo==2.0.0
|
||||||
|
docopt==0.6.2
|
||||||
|
espeakng-loader==0.2.4
|
||||||
|
filelock==4.0.1
|
||||||
|
flatbuffers==25.12.19
|
||||||
|
fsspec==2026.9.0
|
||||||
|
h11==0.16.0
|
||||||
|
hf-xet==1.6.0
|
||||||
|
httpcore==1.0.9
|
||||||
|
httpx==0.28.1
|
||||||
|
huggingface-hub==1.32.0
|
||||||
|
idna==3.20
|
||||||
|
isodate==0.7.2
|
||||||
|
joblib==1.6.0
|
||||||
|
jsonschema-specifications==2025.9.1
|
||||||
|
jsonschema==4.26.0
|
||||||
|
language-tags==1.3.1
|
||||||
|
misaki==0.9.4
|
||||||
|
num2words==0.5.14
|
||||||
|
numpy==2.5.3
|
||||||
|
onnxruntime==1.30.0
|
||||||
|
packaging==26.3
|
||||||
|
phonemizer-fork==3.3.2
|
||||||
|
protobuf==7.36.2
|
||||||
|
pycparser==3.0
|
||||||
|
pyparsing==3.3.2
|
||||||
|
python-dateutil==2.9.0.post0
|
||||||
|
pyyaml==6.0.3
|
||||||
|
rdflib==7.6.0
|
||||||
|
referencing==0.37.0
|
||||||
|
regex==2026.9.10
|
||||||
|
rfc3986==1.5.0
|
||||||
|
rpds-py==2026.6.3
|
||||||
|
segments==2.4.0
|
||||||
|
six==1.17.0
|
||||||
|
soundfile==0.14.0
|
||||||
|
termcolor==3.3.0
|
||||||
|
tqdm==4.70.1
|
||||||
|
typing-extensions==4.16.0
|
||||||
|
uritemplate==4.2.0
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
# Pinned requirements for a Mnemosyne side-venv on mars.
|
||||||
|
#
|
||||||
|
# Hermes vendors its own Python (the official image's venv) and deliberately
|
||||||
|
# stays minimal: no pip module inside it, PEP 668 external-management on top.
|
||||||
|
# Installing provider packages straight into that interpreter would fight the
|
||||||
|
# image on every rebuild, so Mnemosyne (and its plugin wrapper) live in their
|
||||||
|
# own venv instead — see the provisioning unit in hosts/mars/hermes-agent.nix.
|
||||||
|
#
|
||||||
|
# Freeze captured 2026-09-19 from a verified container-side install of
|
||||||
|
# `mnemosyne-memory[embeddings]` + `mnemosyne-hermes` — side venv at
|
||||||
|
# $HERMES_HOME/mnemosyne-venv, activated via $HERMES_HOME/plugins/mnemosyne.
|
||||||
|
# Versions pinned exactly; transitive deps frozen for reproducibility
|
||||||
|
# (onnxruntime/numpy drift under a long-lived SQLite state dir is what a
|
||||||
|
# freeze is here to prevent).
|
||||||
|
#
|
||||||
|
anyio==4.15.0
|
||||||
|
certifi==2026.7.22
|
||||||
|
charset-normalizer==3.5.1
|
||||||
|
click==8.5.0
|
||||||
|
fastembed==0.8.0
|
||||||
|
filelock==3.32.5
|
||||||
|
flatbuffers==25.12.19
|
||||||
|
fsspec==2026.7.0
|
||||||
|
h11==0.16.0
|
||||||
|
hf-xet==1.6.0
|
||||||
|
httpcore==1.0.9
|
||||||
|
httpx==0.28.1
|
||||||
|
huggingface-hub==1.32.0
|
||||||
|
idna==3.19
|
||||||
|
loguru==0.7.3
|
||||||
|
mmh3==5.3.0
|
||||||
|
mnemosyne-hermes==0.5.0
|
||||||
|
mnemosyne-memory==3.15.1
|
||||||
|
numpy==2.5.3
|
||||||
|
onnxruntime==1.30.0
|
||||||
|
packaging==26.3
|
||||||
|
pillow==12.3.0
|
||||||
|
protobuf==7.36.1
|
||||||
|
py-rust-stemmers==0.1.8
|
||||||
|
pyyaml==6.0.3
|
||||||
|
requests==2.34.2
|
||||||
|
sqlite-vec==0.1.9
|
||||||
|
tokenizers==0.23.2
|
||||||
|
tqdm==4.70.0
|
||||||
|
typing-extensions==4.16.0
|
||||||
|
urllib3==2.7.0
|
||||||
@@ -23,6 +23,13 @@ in
|
|||||||
|
|
||||||
networking.hostName = "terra";
|
networking.hostName = "terra";
|
||||||
|
|
||||||
|
homelab.greeter = {
|
||||||
|
monitors = config.home-manager.users.darman.wayland.windowManager.hyprland.settings.monitor;
|
||||||
|
primaryOutput = "DP-2";
|
||||||
|
defaultUser = "darman";
|
||||||
|
keyboardLayout = "de";
|
||||||
|
};
|
||||||
|
|
||||||
services.flatpak = {
|
services.flatpak = {
|
||||||
enable = true;
|
enable = true;
|
||||||
remotes = [{ name = "flathub"; location = "https://dl.flathub.org/repo/flathub.flatpakrepo"; }];
|
remotes = [{ name = "flathub"; location = "https://dl.flathub.org/repo/flathub.flatpakrepo"; }];
|
||||||
|
|||||||
@@ -0,0 +1,86 @@
|
|||||||
|
# Mnemosyne memory provider for Hermes on mars — packaged for real (Nix).
|
||||||
|
#
|
||||||
|
# Why derivations instead of a runtime side-venv: the official Hermes image
|
||||||
|
# vendors its own Python and stays off-limits to pip (no pip module, PEP 668),
|
||||||
|
# and a runtime venv built host-side breaks twice over inside the container:
|
||||||
|
# the venv's pyvenv.cfg records a /nix/store python home the container never
|
||||||
|
# mounts, and a plugins symlink with an absolute host path points nowhere
|
||||||
|
# from /opt/data. Building here means nothing is fetched at boot, nothing
|
||||||
|
# under the provider's control is writable from inside the container, and
|
||||||
|
# the closure is as reproducible as the rest of the host.
|
||||||
|
#
|
||||||
|
# Package set (one shared site-packages — the plugin wrapper imports its
|
||||||
|
# sibling `mnemosyne` core package, so withPackages, not separate envs):
|
||||||
|
#
|
||||||
|
# mnemosyne-memory core engine: SQLite/FTS5 storage, recall, tools.
|
||||||
|
# Base deps only (PyYAML); the optional extras (llm,
|
||||||
|
# embeddings via fastembed/onnxruntime, mcp, sync) are
|
||||||
|
# deliberately NOT pulled — recall uses the bundled FTS5
|
||||||
|
# lexical path, and the heavyweight ML stack (~hundreds of
|
||||||
|
# MB, live network on first vector use) buys nothing for
|
||||||
|
# a first deployment. Adding the embeddings extra later
|
||||||
|
# is pinning fastembed + sqlite-vec here.
|
||||||
|
# mnemosyne-hermes the wrapper Hermes discovers under $HERMES_HOME/plugins
|
||||||
|
# (installs itself as package `hermes_memory_provider`).
|
||||||
|
# Hard dependency: mnemosyne-memory, PyYAML.
|
||||||
|
#
|
||||||
|
# Platform note: both sdists are pure Python (build no C extensions), so
|
||||||
|
# nothing here constrains the host arch beyond the interpreter itself.
|
||||||
|
{
|
||||||
|
python3,
|
||||||
|
fetchPypi,
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
python = python3;
|
||||||
|
|
||||||
|
mnemosyneMemory = python.pkgs.buildPythonPackage rec {
|
||||||
|
pname = "mnemosyne-memory";
|
||||||
|
version = "3.15.1";
|
||||||
|
pyproject = true;
|
||||||
|
|
||||||
|
src = fetchPypi {
|
||||||
|
inherit pname version;
|
||||||
|
sha256 = "sha256-lspUMxc0pUSkhSUrNdiiO5OJ1NMC/S853EYSanXtXKM=";
|
||||||
|
};
|
||||||
|
|
||||||
|
build-system = with python.pkgs; [ setuptools ];
|
||||||
|
|
||||||
|
# Base dependency set — everything else in the upstream metadata is an
|
||||||
|
# optional extra (llm / embeddings / mcp / sync / test / dev) and is not
|
||||||
|
# installed; see the file-level comment.
|
||||||
|
dependencies = with python.pkgs; [ pyyaml ];
|
||||||
|
|
||||||
|
doCheck = false; # upstream tests want a live Hermes + LLM key present
|
||||||
|
pythonImportsCheck = [ "mnemosyne" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
mnemosyneHermes = python.pkgs.buildPythonPackage rec {
|
||||||
|
pname = "mnemosyne-hermes";
|
||||||
|
version = "0.5.0";
|
||||||
|
pyproject = true;
|
||||||
|
|
||||||
|
src = fetchPypi {
|
||||||
|
inherit pname version;
|
||||||
|
sha256 = "sha256-CzEvnUw5oPFtT5bHQQ/GBdy2C/E7qShQn32irIRYKqw=";
|
||||||
|
};
|
||||||
|
|
||||||
|
build-system = with python.pkgs; [ setuptools ];
|
||||||
|
|
||||||
|
# The wrapper declares `mnemosyne-memory[embeddings]>=3.11.1` on PyPI, but
|
||||||
|
# the embeddings extra is only consulted when vector recall is enabled
|
||||||
|
# (see above) — pass the core dependency explicitly rather than dragging
|
||||||
|
# in onnxruntime for nothing.
|
||||||
|
dependencies = [ mnemosyneMemory ] ++ (with python.pkgs; [ pyyaml ]);
|
||||||
|
|
||||||
|
doCheck = false;
|
||||||
|
pythonImportsCheck = [ "hermes_memory_provider" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
# The exposed value is the python env itself (a store path mounted :ro).
|
||||||
|
# Hermes only needs the site-packages dir inside it; `sitePackages` is a
|
||||||
|
# passthru the python interpreter derivation (and hence withPackages envs)
|
||||||
|
# exposes, so the caller uses `${env.sitePackages}` instead of guessing
|
||||||
|
# the python version in a path literal.
|
||||||
|
in
|
||||||
|
python.withPackages (_: [ mnemosyneMemory mnemosyneHermes ])
|
||||||
@@ -2,18 +2,14 @@
|
|||||||
|
|
||||||
# Hyprland (wayland) desktop: compositor, login manager, audio, portals.
|
# Hyprland (wayland) desktop: compositor, login manager, audio, portals.
|
||||||
{
|
{
|
||||||
|
imports = [ ./quickshell-greeter.nix ];
|
||||||
|
|
||||||
programs.hyprland.enable = true;
|
programs.hyprland.enable = true;
|
||||||
|
|
||||||
services.gnome.gnome-keyring.enable = true;
|
services.gnome.gnome-keyring.enable = true;
|
||||||
security.pam.services.login.enableGnomeKeyring = true;
|
security.pam.services.login.enableGnomeKeyring = true;
|
||||||
security.pam.services.greetd.enableGnomeKeyring = true;
|
security.pam.services.greetd.enableGnomeKeyring = true;
|
||||||
|
|
||||||
services.greetd = {
|
|
||||||
enable = true;
|
|
||||||
settings.default_session.command =
|
|
||||||
"${pkgs.tuigreet}/bin/tuigreet --time --cmd start-hyprland";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Audio (pipewire replaces pulseaudio/jack).
|
# Audio (pipewire replaces pulseaudio/jack).
|
||||||
security.rtkit.enable = true;
|
security.rtkit.enable = true;
|
||||||
services.pipewire = {
|
services.pipewire = {
|
||||||
|
|||||||
@@ -0,0 +1,76 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
# greetd greeter: a throwaway Hyprland running quickshell's greeter.qml as the
|
||||||
|
# `greeter` user. Hyprland must exit after the login so greetd can start the
|
||||||
|
# real session, hence the exit dispatch once qs returns.
|
||||||
|
let
|
||||||
|
cfg = config.homelab.greeter;
|
||||||
|
hyprland = config.programs.hyprland.package;
|
||||||
|
toLua = lib.generators.toLua { };
|
||||||
|
|
||||||
|
shellDir = ../../dotfiles/quickshell;
|
||||||
|
|
||||||
|
session = pkgs.writeShellScript "greeter-session" ''
|
||||||
|
${lib.getExe pkgs.quickshell} -p ${shellDir}/greeter.qml
|
||||||
|
${hyprland}/bin/hyprctl dispatch 'hl.dsp.exit()'
|
||||||
|
'';
|
||||||
|
|
||||||
|
hyprConfig = pkgs.writeText "greeter-hyprland.lua" ''
|
||||||
|
${lib.concatMapStrings (m: "hl.monitor(${toLua m})\n") cfg.monitors}
|
||||||
|
hl.config(${toLua {
|
||||||
|
input = { kb_layout = cfg.keyboardLayout; numlock_by_default = true; };
|
||||||
|
animations.enabled = false;
|
||||||
|
misc = {
|
||||||
|
disable_hyprland_logo = true;
|
||||||
|
disable_splash_rendering = true;
|
||||||
|
background_color = "rgb(0a0a0a)";
|
||||||
|
};
|
||||||
|
ecosystem = { no_update_news = true; no_donation_nag = true; };
|
||||||
|
}})
|
||||||
|
|
||||||
|
hl.env("QS_GREETER_OUTPUT", ${toLua cfg.primaryOutput})
|
||||||
|
hl.env("QS_GREETER_USER", ${toLua cfg.defaultUser})
|
||||||
|
hl.env("QS_GREETER_HOST", ${toLua config.networking.hostName})
|
||||||
|
hl.env("QS_GREETER_SESSION", "start-hyprland")
|
||||||
|
|
||||||
|
hl.on("hyprland.start", function()
|
||||||
|
hl.exec_cmd("${session}")
|
||||||
|
end)
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.homelab.greeter = {
|
||||||
|
monitors = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.attrs;
|
||||||
|
default = [ ];
|
||||||
|
description = "hl.monitor() tables; reuse the user's so outputs line up.";
|
||||||
|
};
|
||||||
|
primaryOutput = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "";
|
||||||
|
description = "Output that gets the login panel (others get the backdrop only).";
|
||||||
|
};
|
||||||
|
defaultUser = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "";
|
||||||
|
};
|
||||||
|
keyboardLayout = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "us";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
services.greetd = {
|
||||||
|
enable = true;
|
||||||
|
settings.default_session.command =
|
||||||
|
"${hyprland}/bin/start-hyprland -- --config ${hyprConfig}";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Hyprland and quickshell want a writable $HOME for cache/state.
|
||||||
|
users.users.greeter = {
|
||||||
|
home = "/var/lib/greeter";
|
||||||
|
createHome = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user