From d738f14a816ead20927cf13e6d7b46cd1e3a458f Mon Sep 17 00:00:00 2001 From: Ly-sec Date: Sun, 30 Nov 2025 15:04:09 +0100 Subject: [PATCH] AboutTab: possible commit display for nixos --- Modules/Panels/Settings/Tabs/AboutTab.qml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Modules/Panels/Settings/Tabs/AboutTab.qml b/Modules/Panels/Settings/Tabs/AboutTab.qml index ec5ab8d6..3b14a4ae 100644 --- a/Modules/Panels/Settings/Tabs/AboutTab.qml +++ b/Modules/Panels/Settings/Tabs/AboutTab.qml @@ -6,6 +6,7 @@ import Quickshell import Quickshell.Io import qs.Commons import qs.Services.Noctalia +import qs.Services.System import qs.Widgets ColumnLayout { @@ -26,6 +27,24 @@ ColumnLayout { Logger.d("AboutTab", "Component.onCompleted - Is git version:", root.isGitVersion); // Only fetch commit info for -git versions if (root.isGitVersion) { + // On NixOS, extract commit hash from the store path + if (HostService.isNixOS) { + var shellDir = Quickshell.shellDir || ""; + Logger.d("AboutTab", "Component.onCompleted - NixOS detected, shellDir:", shellDir); + if (shellDir) { + // Extract commit hash from path like: /nix/store/...-noctalia-shell-2025-11-30_225e6d3/share/noctalia-shell + // Pattern matches: noctalia-shell-YYYY-MM-DD_ + var match = shellDir.match(/noctalia-shell-\d{4}-\d{2}-\d{2}_([0-9a-f]{7,})/i); + if (match && match[1]) { + // Use first 7 characters of the commit hash + root.commitInfo = match[1].substring(0, 7); + Logger.d("AboutTab", "Component.onCompleted - Extracted commit from NixOS path:", root.commitInfo); + return; + } else { + Logger.d("AboutTab", "Component.onCompleted - Could not extract commit from NixOS path, trying fallback"); + } + } + } // Try to get Arch package version first (which includes commit hash) pacmanProcess.running = true; // Start fallback timer in case pacman fails to start