summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.examples/desktop-os-minimal.scm1
-rw-r--r--.examples/desktop-os-sway.scm140
-rw-r--r--DOCS.md9
-rw-r--r--px/services/desktop.scm11
4 files changed, 157 insertions, 4 deletions
diff --git a/.examples/desktop-os-minimal.scm b/.examples/desktop-os-minimal.scm
index c036aa4..4f173a9 100644
--- a/.examples/desktop-os-minimal.scm
+++ b/.examples/desktop-os-minimal.scm
@@ -35,6 +35,7 @@
(home-directory "/home/panther"))
%base-user-accounts))
+ (packages %px-desktop-core-packages)
(services %px-desktop-minmal-services))
#:open-ports '(("tcp" "ssh"))
diff --git a/.examples/desktop-os-sway.scm b/.examples/desktop-os-sway.scm
new file mode 100644
index 0000000..3a41d3e
--- /dev/null
+++ b/.examples/desktop-os-sway.scm
@@ -0,0 +1,140 @@
+;; PantherX OS Server Configuration
+
+(use-modules (gnu)
+ (gnu system)
+ ;;
+ (guix packages)
+ (guix git-download)
+ (guix build-system meson)
+ (gnu packages wm)
+ (gnu packages freedesktop)
+ (gnu packages gtk)
+ (gnu packages web)
+ (gnu packages xorg)
+ (gnu packages xdisorg)
+ (gnu packages pcre)
+ (gnu packages linux)
+ (gnu packages gl)
+ (gnu packages pkg-config)
+ (gnu packages man)
+ ;;
+ (px system config))
+
+(define %ssh-public-key
+ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP7gcLZzs2JiEx2kWCc8lTHOC0Gqpgcudv0QVJ4QydPg franz")
+
+;; Sway 1.9 is not compatible with wlroots 0.16
+(define-public sway-legacy
+ (package
+ (inherit sway)
+ (name "sway")
+ (version "1.8.1")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/swaywm/sway")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1y7brfrsjnm9gksijgnr6zxqiqvn06mdiwsk5j87ggmxazxd66av"))))
+ (build-system meson-build-system)
+ (arguments
+ `(;; elogind is propagated by wlroots -> libseat
+ ;; and would otherwise shadow basu.
+ #:configure-flags '("-Dsd-bus-provider=basu")
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'configure 'hardcode-paths
+ (lambda* (#:key inputs #:allow-other-keys)
+ ;; Hardcode path to swaybg.
+ (substitute* "sway/config.c"
+ (("strdup..swaybg..")
+ (string-append "strdup(\"" (assoc-ref inputs "swaybg")
+ "/bin/swaybg\")")))
+ ;; Hardcode path to scdoc.
+ (substitute* "meson.build"
+ (("scdoc.get_pkgconfig_variable..scdoc..")
+ (string-append "'" (assoc-ref inputs "scdoc")
+ "/bin/scdoc'")))
+ #t)))))
+ (inputs (list basu
+ cairo
+ gdk-pixbuf
+ json-c
+ libevdev
+ libinput-minimal
+ libxkbcommon
+ pango
+ pcre2
+ swaybg
+ wayland
+ wlroots-0.16))
+ (native-inputs
+ (cons* linux-pam mesa pkg-config scdoc wayland-protocols
+ (if (%current-target-system)
+ (list pkg-config-for-build
+ wayland)
+ '())))))
+
+(px-desktop-os
+ (operating-system
+ (host-name "px-base")
+ (timezone "Europe/Berlin")
+ (locale "en_US.utf8")
+
+ (bootloader (bootloader-configuration
+ (bootloader grub-bootloader)
+ (targets '("/dev/vda"))))
+
+ (file-systems (cons (file-system
+ (device (file-system-label "my-root"))
+ (mount-point "/")
+ (type "ext4"))
+ %base-file-systems))
+
+ (users (cons (user-account
+ (name "panther")
+ (comment "panther's account")
+ (group "users")
+ ;; Set the default password to 'pantherx'
+ ;; Important: Change with 'passwd panther' after first login
+ (password (crypt "pantherx" "$6$abc"))
+ (supplementary-groups '("wheel"
+ "audio" "video"))
+ (home-directory "/home/panther"))
+ %base-user-accounts))
+
+ (packages %px-desktop-core-packages)
+
+ (services (cons*
+ (service greetd-service-type
+ (greetd-configuration
+ (greeter-supplementary-groups (list "video" "input"))
+ (terminals
+ (list
+ (greetd-terminal-configuration
+ (terminal-vt "1")
+ (terminal-switch #t)
+ (default-session-command
+ (greetd-wlgreet-sway-session
+ (sway sway-legacy)
+ (wlgreet-session
+ (greetd-wlgreet-session
+ (command (file-append sway-legacy "/bin/sway")))))))
+
+ (greetd-terminal-configuration
+ (terminal-vt "2"))
+ (greetd-terminal-configuration
+ (terminal-vt "3"))
+ (greetd-terminal-configuration
+ (terminal-vt "4"))
+ (greetd-terminal-configuration
+ (terminal-vt "5"))
+ (greetd-terminal-configuration
+ (terminal-vt "6"))))))
+
+ %px-desktop-minmal-services)))
+
+ #:open-ports '(("tcp" "ssh"))
+ #:authorized-keys `(("root" ,(plain-file "panther.pub" %ssh-public-key))))
diff --git a/DOCS.md b/DOCS.md
index d20c89f..fd811f6 100644
--- a/DOCS.md
+++ b/DOCS.md
@@ -65,4 +65,11 @@ Options:
```scheme
(service px-user-identity-service-type)
-``` \ No newline at end of file
+```
+
+## UDEV Rules
+
+- `ledger-wallet-service`
+- `nitro-key-service`
+- `yubikey-service`
+- `coinkite-service` \ No newline at end of file
diff --git a/px/services/desktop.scm b/px/services/desktop.scm
index b6cbddc..99019cd 100644
--- a/px/services/desktop.scm
+++ b/px/services/desktop.scm
@@ -217,9 +217,10 @@
(simple-service 'custom-udev-rules udev-service-type
(list libu2f-host))
- (ledger-wallet-service)
- (nitro-key-service)
- (coinkite-service)
+ ;; Adding plugdev group once should suffice
+ (udev-rules-service 'nitro %nitro-key-udev-rule #:groups '("plugdev"))
+ (udev-rules-service 'yubikey %yubikey-udev-rule)
+ (udev-rules-service 'coinkite %coinkite-udev-rule)
;; Power savings
(service tlp-service-type)
@@ -266,6 +267,10 @@
(define %px-desktop-base-minimal-services
(modify-services
%px-desktop-base-services
+ (delete agetty-service-type)
+ (delete mingetty-service-type)
+ (delete pulseaudio-service-type)
+ (delete alsa-service-type)
(delete sddm-service-type)
(delete gnome-keyring-service-type)
(delete openssh-service-type))) \ No newline at end of file