mirror of
https://codeberg.org/hako/Rosenthal.git
synced 2026-11-29 22:58:06 +00:00
services: Add noctalia-greeter-service-type and greetd-noctalia-greeter-session.
* modules/rosenthal/services/base.scm (<noctalia-greeter-configuration>): New data type. (noctalia-greeter-activation-service) (noctalia-greeter-special-files-service): New procedures. (noctalia-greeter-service-type): New variable. (<greetd-noctalia-greeter-session>): New data type with gexp compiler (file-like object).
This commit is contained in:
1 file changed
+99
-1
@@ -5,14 +5,112 @@
|
||||
;; Utilities
|
||||
#:use-module (guix gexp)
|
||||
#:use-module (guix records)
|
||||
#:use-module (rosenthal utils contract combinators)
|
||||
#:use-module (rosenthal utils file)
|
||||
#:use-module (rosenthal utils records)
|
||||
#:use-module (rosenthal utils packages)
|
||||
;; Guix System
|
||||
#:use-module (gnu system keyboard)
|
||||
;; Guix System - services
|
||||
#:use-module (gnu services)
|
||||
#:use-module (gnu services base)
|
||||
#:use-module (gnu services dbus)
|
||||
;; Guix packages
|
||||
#:use-module (gnu packages admin)
|
||||
#:use-module (gnu packages bash)
|
||||
#:use-module (rosenthal packages admin)
|
||||
#:export (greetd-tuigreet-session))
|
||||
#:use-module (rosenthal packages wm)
|
||||
#:export (noctalia-greeter-configuration
|
||||
noctalia-greeter-service-type
|
||||
greetd-noctalia-greeter-session
|
||||
|
||||
greetd-tuigreet-session))
|
||||
|
||||
|
||||
;;;
|
||||
;;; noctalia-greeter
|
||||
;;;
|
||||
|
||||
(define-record-type/dolly <noctalia-greeter-configuration>
|
||||
noctalia-greeter-configuration
|
||||
make-noctalia-greeter-configuration
|
||||
noctalia-greeter-configuration?
|
||||
this-noctalia-greeter-configuration
|
||||
(package
|
||||
noctalia-greeter-configuration-package
|
||||
(default noctalia-greeter)
|
||||
(contract file-like?)
|
||||
(documentation
|
||||
"Noctalia greeter package."))
|
||||
(keyboard-layout
|
||||
noctalia-greeter-configuration-keyboard-layout
|
||||
(default #f)
|
||||
(contract (or/c #f keyboard-layout?))
|
||||
(documentation
|
||||
"Keyboard layout to use in a Noctalia greeter session.")))
|
||||
|
||||
(define (noctalia-greeter-activation-service _)
|
||||
#~(mkdir-p/perms "/var/lib/noctalia-greeter" (getpwnam "greeter") #o750))
|
||||
|
||||
(define noctalia-greeter-special-files-service
|
||||
(match-record-lambda/dolly <noctalia-greeter-configuration>
|
||||
(keyboard-layout)
|
||||
(if keyboard-layout
|
||||
(let* ((name (keyboard-layout-name keyboard-layout))
|
||||
(variant (keyboard-layout-variant keyboard-layout))
|
||||
(options (keyboard-layout-options keyboard-layout))
|
||||
(layout
|
||||
`(("layout" . ,name)
|
||||
,@(if variant
|
||||
`(("variant" . ,variant))
|
||||
'())
|
||||
,@(if (null? options)
|
||||
'()
|
||||
`(("options" . ,(string-join options ",")))))))
|
||||
`(("/var/lib/noctalia-greeter/greeter.toml"
|
||||
,(toml-file "greeter.toml"
|
||||
`(("keyboard" . ,layout))))))
|
||||
'())))
|
||||
|
||||
(define noctalia-greeter-service-type
|
||||
(service-type
|
||||
(name 'noctalia-greeter)
|
||||
(extensions
|
||||
(list (service-extension activation-service-type
|
||||
noctalia-greeter-activation-service)
|
||||
(service-extension special-files-service-type
|
||||
noctalia-greeter-special-files-service)
|
||||
(service-extension polkit-service-type
|
||||
(compose list noctalia-greeter-configuration-package))
|
||||
(service-extension profile-service-type
|
||||
(compose list noctalia-greeter-configuration-package))))
|
||||
(default-value (noctalia-greeter-configuration))
|
||||
(description "Set up environment for @command{noctalia-greeter-session}.")))
|
||||
|
||||
(define-record-type/dolly <greetd-noctalia-greeter-session>
|
||||
greetd-noctalia-greeter-session
|
||||
make-greetd-noctalia-greeter-session
|
||||
greetd-noctalia-greeter-session?
|
||||
this-greetd-noctalia-greeter-session
|
||||
(noctalia-greeter-session
|
||||
greetd-noctalia-greeter-session-noctalia-greeter-session
|
||||
(default (file-append noctalia-greeter "/bin/noctalia-greeter-session"))
|
||||
(contract (or/c file-like? string?))
|
||||
(documentation
|
||||
"@command{noctalia-greeter-session} executable file.")))
|
||||
|
||||
(define-gexp-compiler (greetd-tuigreet-session-compiler
|
||||
(session <greetd-noctalia-greeter-session>)
|
||||
system target)
|
||||
(match-record/dolly session <greetd-noctalia-greeter-session> (noctalia-greeter-session)
|
||||
(lower-object
|
||||
(program-file "noctalia-greeter-wrapper"
|
||||
#~(execl #$noctalia-greeter-session #$noctalia-greeter-session)))))
|
||||
|
||||
|
||||
;;;
|
||||
;;; tuigreet
|
||||
;;;
|
||||
|
||||
(define-record-type* <greetd-tuigreet-session>
|
||||
greetd-tuigreet-session make-greetd-tuigreet-session
|
||||
|
||||
Reference in new issue
Block a user