Compare commits

...

2 Commits

Author SHA1 Message Date
Hilton Chain
6f64117e14
services: Add home-bb-auth-service-type.
* modules/rosenthal/services/desktop.scm (home-bb-auth-service-type): New
variable.
2026-03-04 23:42:46 +08:00
Hilton Chain
ea9ece2941
rosenthal: Add bb-auth.
* modules/rosenthal/packages/patches/bb-auth.patch: New file.
* modules/rosenthal/packages/authentication.scm (bb-auth): New variable.
2026-03-04 23:39:39 +08:00
3 changed files with 108 additions and 0 deletions

View File

@ -0,0 +1,64 @@
;;; SPDX-License-Identifier: GPL-3.0-or-later
;;; Copyright © 2026 Hilton Chain <hako@ultrarare.space>
(define-module (rosenthal packages authentication)
;; Utilities
#:use-module (guix gexp)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix utils)
#:use-module (rosenthal utils packages)
;; Guix origin methods
#:use-module (guix git-download)
;; Guix build systems
#:use-module (guix build-system qt)
;; Guix packages
#:use-module (gnu packages gnome)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages polkit)
#:use-module (gnu packages qt))
(define-public bb-auth
(package
(name "bb-auth")
(version "0.2.0")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/anthonyhab/bb-auth")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32
"1jx526h7qw7mw4cp2c8ys4ck1qlc5v9qf51zvj951l4kqbrs0w44"))
(patches (rosenthal-patches "bb-auth.patch"))))
(build-system qt-build-system)
(arguments
(list #:qtbase qtbase
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'patch-test-references
(lambda _
(substitute* (find-files "tests")
(("/bin/(true|false)" _ cmd)
(which cmd)))))
(add-after 'qt-wrap 'patch-script
(lambda _
(with-directory-excursion (in-vicinity #$output "libexec")
(substitute* "pinentry-bb"
(("libexec/bb-auth\"" all)
(string-append all " \"--pinentry\"")))
(substitute* "bb-keyring-prompter"
(("libexec/bb-auth\"" all)
(string-append all " \"--keyring\"")))))))))
(native-inputs
(list pkg-config))
(inputs
(list gcr
json-glib-minimal
polkit
polkit-qt6))
(home-page "https://github.com/anthonyhab/bb-auth")
(synopsis "Unified polkit, keyring, and pinentry authentication daemon")
(description "")
(license license:bsd-3)))

View File

@ -0,0 +1,20 @@
diff --git a/src/main.cpp b/src/main.cpp
index 18898d7..6426354 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -49,6 +49,7 @@ namespace {
QCommandLineOption optDaemon(QStringList{"daemon", "d"}, "Run as daemon (polkit agent + IPC server).");
QCommandLineOption optKeyring(QStringList{"keyring"}, "Run as keyring prompter (GCR replacement).");
QCommandLineOption optPinentry(QStringList{"pinentry"}, "Run as GPG pinentry.");
+ QCommandLineOption optDisplay(QStringList{"display"}, "");
// CLI options (for interacting with running daemon)
QCommandLineOption optPing(QStringList{"ping"}, "Check if the daemon is reachable.");
@@ -60,6 +61,7 @@ namespace {
parser.addOption(optDaemon);
parser.addOption(optKeyring);
parser.addOption(optPinentry);
+ parser.addOption(optDisplay);
parser.addOption(optPing);
parser.addOption(optNext);
parser.addOption(optRespond);

View File

@ -44,6 +44,7 @@
#:use-module (gnu packages qt)
#:use-module (gnu packages wm)
#:use-module (gnu packages xorg)
#:use-module (rosenthal packages authentication)
#:use-module (rosenthal packages wm)
#:export (home-blueman-applet-configuration
home-blueman-applet-service-type
@ -63,6 +64,7 @@
home-noctalia-shell-configuration
home-noctalia-shell-service-type
home-bb-auth-service-type
home-polkit-gnome-service-type
home-rofi-configuration
@ -353,6 +355,28 @@ compositor.")))
(default-value (home-noctalia-shell-configuration))
(description "")))
;;;
;;; bb-auth
;;;
(define (%home-bb-auth-shepherd _)
(list (shepherd-service
(provision '(bb-auth))
(start
#~(make-forkexec-constructor
(list #$(file-append bb-auth "/libexec/bb-auth") "--daemon")))
(stop #~(make-kill-destructor)))))
(define home-bb-auth-service-type
(service-type
(name 'home-bb-auth)
(extensions
(list (service-extension home-shepherd-service-type
%home-bb-auth-shepherd)))
(default-value #f)
(description "Run @command{bb-auth} daemon.")))
;;;
;;; polkit-gnome