summaryrefslogtreecommitdiff
path: root/px/services
diff options
context:
space:
mode:
Diffstat (limited to 'px/services')
-rw-r--r--px/services/base.scm63
-rw-r--r--px/services/desktop.scm135
-rw-r--r--px/services/device.scm59
3 files changed, 44 insertions, 213 deletions
diff --git a/px/services/base.scm b/px/services/base.scm
index 42911f2..93a71bb 100644
--- a/px/services/base.scm
+++ b/px/services/base.scm
@@ -6,34 +6,23 @@
;;;
(define-module (px services base)
- #:use-module (gnu packages gnome)
- #:use-module (gnu packages openbox)
+ #:use-module (guix gexp)
+ #:use-module (guix utils)
+ #:use-module (srfi srfi-1)
#:use-module (gnu packages networking)
- #:use-module (gnu packages security-token)
- #:use-module (gnu packages xdisorg)
#:use-module (gnu services)
- #:use-module (gnu services avahi)
#:use-module (gnu services base)
- #:use-module (gnu services cups)
- #:use-module (gnu services dbus)
#:use-module (gnu services desktop)
#:use-module (gnu services networking)
- #:use-module (gnu services pm)
- #:use-module (gnu services sddm)
- #:use-module (gnu services sound)
#:use-module (gnu services ssh)
- #:use-module (gnu services xorg)
- #:use-module (px packages desktop)
+
#:use-module (px services desktop)
#:use-module (px services device)
#:use-module (px services security-token)
- #:use-module (guix gexp)
- #:use-module (guix utils)
- #:use-module (ice-9 match)
- #:use-module (srfi srfi-1)
+
#:export (%px-core-services
- %px-desktop-core-services
+ %px-desktop-minmal-services
%px-desktop-services
%px-desktop-ee-services
@@ -42,51 +31,39 @@
;;;
;;; CORE
-;;; px-core-os services
;;;
(define %px-core-services
- (append (list
- (service dhcp-client-service-type)
- (service ntp-service-type))
+ (append (list (service dhcp-client-service-type)
+ (service ntp-service-type))
%base-services))
;;;
;;; DESKTOP
-;;; px-desktop-os services
-;;; px-desktop-ee-os services
;;;
-(define %px-desktop-core-services
- (append %desktop-services-assembly-plain))
+(define %px-desktop-minmal-services
+ (append %px-desktop-base-minimal-services))
(define %px-desktop-services
- (append %desktop-services-assembly))
+ (append %px-desktop-base-services))
(define %px-desktop-ee-services
;; TODO: Does not include default desktop
- (append (list
- (service px-device-identity-service-type)
- (service px-user-identity-service-type))
- %desktop-services-assembly))
+ (append (list (service px-device-identity-service-type)
+ (service px-user-identity-service-type))
+ %px-desktop-base-services))
;;;
;;; SERVER
-;;; px-server-os services
-;;; px-server-ee-os services
;;;
(define %px-server-services
- (append (list
- (service openssh-service-type
- (openssh-configuration (permit-root-login 'prohibit-password)))
-
- (service ntp-service-type)
- (service nftables-service-type)
- (service dhcp-client-service-type))
- %base-services))
+ (append (list (service openssh-service-type
+ (openssh-configuration (permit-root-login 'prohibit-password)))
+ (service nftables-service-type))
+ %px-core-services))
(define %px-server-ee-services
- (append (list
- (service px-device-identity-service-type))
- %px-server-services))
+ (append (list (service px-device-identity-service-type))
+ %px-server-services))
diff --git a/px/services/desktop.scm b/px/services/desktop.scm
index 4644edb..b6cbddc 100644
--- a/px/services/desktop.scm
+++ b/px/services/desktop.scm
@@ -36,7 +36,7 @@
#:use-module (srfi srfi-1)
#:use-module (guix utils)
#:use-module (ice-9 match)
- #:export (px-desktop-configuration
+ #:export (px-desktop-configuration
px-desktop-configuration?
polkit-network-manager-service
@@ -44,8 +44,9 @@
create-swap-space-service
- %desktop-services-assembly
- %desktop-services-assembly-plain))
+ %px-desktop-base-services
+ %px-desktop-base-minimal-services
+ %desktop-services-assembly-plain))
;;
;; allow netdev group to control network manger
@@ -145,20 +146,19 @@
;; Generic Desktop for Qt, GTP
(define* (desktop-services-for-system #:optional (system (or (%current-target-system)
(%current-system))))
+
+ ;;
+ ;; GUIX DEFAULT
+ ;;
+
;; List of services typically useful for a "desktop" use case.
-
- ;; Since GDM depends on Rust (gdm -> gnome-shell -> gjs -> mozjs -> rust)
- ;; and Rust is currently unavailable on non-x86_64 platforms, default to
- ;; SDDM there (FIXME).
(cons* (service screen-locker-service-type
(screen-locker-configuration (name "xlock")
(program (file-append xlockmore
"/bin/xlock"))))
- ;; Add udev rules for MTP devices so that non-root users can access
- ;; them.
- (simple-service 'mtp udev-service-type
- (list libmtp))
+ ;; Add udev rules for MTP devices so that non-root users can access them.
+ (simple-service 'mtp udev-service-type (list libmtp))
;; Add udev rules for scanners.
(service sane-service-type)
;; Add polkit rules, so that non-root users in the wheel group can
@@ -210,7 +210,10 @@
(service pulseaudio-service-type)
(service alsa-service-type)
- ;; PantherX Specific
+ ;;
+ ;; PANTHERX SPECIFIC
+ ;;
+
(simple-service 'custom-udev-rules udev-service-type
(list libu2f-host))
@@ -256,107 +259,13 @@
%base-services))
-(define-syntax %desktop-services-assembly
+(define-syntax %px-desktop-base-services
(identifier-syntax (desktop-services-for-system)))
-;; Generic Desktop for use with other locker's and DE's; for ex. Sway on Wayland
-(define* (desktop-services-for-system-plain #:optional (system (or (%current-target-system)
- (%current-system))))
- ;; List of services typically useful for a "desktop" use case.
-
- ;; Since GDM depends on Rust (gdm -> gnome-shell -> gjs -> mozjs -> rust)
- ;; and Rust is currently unavailable on non-x86_64 platforms, default to
- ;; SDDM there (FIXME).
- (cons*
- ;; Add udev rules for MTP devices so that non-root users can access
- ;; them.
- (simple-service 'mtp udev-service-type
- (list libmtp))
- ;; Add udev rules for scanners.
- (service sane-service-type)
- ;; Add polkit rules, so that non-root users in the wheel group can
- ;; perform administrative tasks (similar to "sudo").
- polkit-wheel-service
-
- ;; Allow desktop users to also mount NTFS and NFS file systems
- ;; without root.
- (simple-service 'mount-setuid-helpers setuid-program-service-type
- (map (lambda (program)
- (setuid-program
- (program program)))
- (list (file-append nfs-utils "/sbin/mount.nfs")
- (file-append ntfs-3g "/sbin/mount.ntfs-3g"))))
-
- ;; The global fontconfig cache directory can sometimes contain
- ;; stale entries, possibly referencing fonts that have been GC'd,
- ;; so mount it read-only.
- fontconfig-file-system-service
-
- ;; NetworkManager and its applet.
- (service network-manager-service-type)
- (service wpa-supplicant-service-type) ;needed by NetworkManager
- (service modem-manager-service-type)
- (service usb-modeswitch-service-type)
-
- ;; The D-Bus clique.
- (service avahi-service-type)
- (service udisks-service-type)
- (service upower-service-type)
- (service accountsservice-service-type)
- (service cups-pk-helper-service-type)
- (service colord-service-type)
- (service geoclue-service-type)
- (service polkit-service-type)
- (service elogind-service-type)
- (service dbus-root-service-type)
-
- (service ntp-service-type)
-
- (service x11-socket-directory-service-type)
-
- (service pulseaudio-service-type)
- (service alsa-service-type)
-
- ;; PantherX Specific
- (simple-service 'custom-udev-rules udev-service-type
- (list libu2f-host))
-
- (ledger-wallet-service)
- (nitro-key-service)
- (coinkite-service)
-
- ;; Power savings
- (service tlp-service-type)
-
- ;; Prevent overheating
- ;; TLP does not conflict with thermald.
- (service thermald-service-type)
-
- ;; Bluetooth service
- ;; (bluetooth-service #:auto-enable? #t)
- (service bluetooth-service-type
- (bluetooth-configuration (auto-enable? #t)))
-
- ;; Printing
- (service cups-service-type
- (cups-configuration (web-interface? #t)
- (browsing? #t)
- (default-paper-size "a4")))
-
- ;; Keychain
- (service gnome-keyring-service-type
- (gnome-keyring-configuration (pam-services '(("passwd" . passwd)
- ("greetd" . login)))))
-
- ;; SSH is enabled by default but only with SSH key
- (service openssh-service-type
- (openssh-configuration (permit-root-login 'prohibit-password)))
-
- ;; Firewall
- (service nftables-service-type
- (nftables-configuration (ruleset (make-firewall-rules '()))))
-
- %base-services))
-(define-syntax %desktop-services-assembly-plain
- (identifier-syntax (desktop-services-for-system-plain)))
+(define %px-desktop-base-minimal-services
+ (modify-services
+ %px-desktop-base-services
+ (delete sddm-service-type)
+ (delete gnome-keyring-service-type)
+ (delete openssh-service-type))) \ No newline at end of file
diff --git a/px/services/device.scm b/px/services/device.scm
index ac405e5..e00fc4a 100644
--- a/px/services/device.scm
+++ b/px/services/device.scm
@@ -33,10 +33,7 @@
px-device-runner-service-type
px-file-upload-configuration
- px-file-upload-service-type
-
- btuart-configuration
- btuart-service-type))
+ px-file-upload-service-type))
;;
;; Device Identity Service
@@ -241,56 +238,4 @@ delete_on_success = ~a"
px-device-identity
tpm2-tss-engine)))))
(description
- "Service definition to run file upload on intervals")))
-
-;;
-;; btuart-service-type
-;;
-
-(define-record-type* <btuart-configuration> btuart-configuration
- make-btuart-configuration
- btuart-configuration?
- (package
- btuart-configuration-package
- (default bluez))
- (device btuart-configuration-device
- (default "/dev/ttyAMA0"))
- (protocol btuart-configuration-protocol
- (default "bcm"))
- (baudrate btuart-configuration-baudrate
- (default "3000000"))
- (flow-control? btuart-configuration-flow-control?
- (default #t)))
-
-(define btuart-shepherd-service
- (match-lambda
- (($ <btuart-configuration>
- package
- device
- protocol
- baudrate
- flow-control?)
- (list (shepherd-service (documentation
- "attach serial lines as Bluetooth HCI interfaces")
- (provision '(btuart))
- (requirement '(udev))
- (start #~(make-forkexec-constructor (list #$(file-append
- package
- "/bin/btattach")
- "-B"
- #$device
- "-P"
- #$protocol
- "-S"
- #$baudrate
- (when #$flow-control?
- "-N"))))
- (one-shot? #t))))))
-
-(define btuart-service-type
- (service-type (name 'btuart)
- (extensions (list (service-extension
- shepherd-root-service-type
- btuart-shepherd-service)))
- (default-value (btuart-configuration))
- (description "Attach serial lines as Bluetooth HCI interfaces")))
+ "Service definition to run file upload on intervals"))) \ No newline at end of file