mirror of
https://codeberg.org/hako/Rosenthal.git
synced 2026-06-06 09:50:36 +00:00
Compare commits
3 Commits
0b6b5feb72
...
2889a00542
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2889a00542 | ||
|
|
42701881b4 | ||
|
|
86d418b080 |
@ -13,9 +13,20 @@
|
||||
#:use-module (gnu services)
|
||||
#:use-module (gnu services configuration)
|
||||
;; Guix Home - services
|
||||
#:use-module (gnu home services)
|
||||
#:use-module (gnu home services shepherd)
|
||||
;; Guix packages
|
||||
#:autoload (rosenthal packages wm) (noctalia)
|
||||
#:export (home-graphical-session-service-type
|
||||
home-graphical-session-configuration))
|
||||
home-graphical-session-configuration
|
||||
|
||||
home-noctalia-configuration
|
||||
home-noctalia-service-type))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Graphical session.
|
||||
;;;
|
||||
|
||||
(define-configuration/no-serialization home-graphical-session-configuration
|
||||
(timeout
|
||||
@ -175,3 +186,44 @@
|
||||
#f))))))
|
||||
(default-value (home-graphical-session-configuration))
|
||||
(description "")))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Noctalia
|
||||
;;;
|
||||
|
||||
(define-configuration/no-serialization home-noctalia-configuration
|
||||
(noctalia
|
||||
(file-like noctalia)
|
||||
"File-like object to provide @command{/bin/noctalia}."))
|
||||
|
||||
(define home-noctalia-shepherd-service
|
||||
(match-record-lambda <home-noctalia-configuration>
|
||||
(noctalia)
|
||||
(list (shepherd-service
|
||||
(documentation "Start noctalia.")
|
||||
(provision '(noctalia))
|
||||
(requirement '(dbus graphical-session))
|
||||
(modules '((shepherd support)))
|
||||
(start
|
||||
#~(lambda args
|
||||
((make-forkexec-constructor
|
||||
(list #$(file-append noctalia "/bin/noctalia"))
|
||||
#:log-file (in-vicinity %user-log-dir "noctalia.log")
|
||||
;; Inherit graphical session environment.
|
||||
#:environment-variables (environ))
|
||||
args)))
|
||||
(stop #~(make-kill-destructor))))))
|
||||
|
||||
(define home-noctalia-service-type
|
||||
(service-type
|
||||
(name 'home-noctalia)
|
||||
(extensions
|
||||
(list (service-extension home-profile-service-type
|
||||
(compose list home-noctalia-configuration-noctalia))
|
||||
(service-extension home-shepherd-service-type
|
||||
home-noctalia-shepherd-service)
|
||||
(service-extension home-graphical-session-service-type
|
||||
(const 'wayland))))
|
||||
(default-value (home-noctalia-configuration))
|
||||
(description "Run Noctalia, a lightweight Wayland shell and bar.")))
|
||||
|
||||
@ -1,175 +1,94 @@
|
||||
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
||||
;;; Copyright © 2025 Hilton Chain <hako@ultrarare.space>
|
||||
;;; Copyright © 2025-2026 Hilton Chain <hako@ultrarare.space>
|
||||
|
||||
(define-module (rosenthal packages wm)
|
||||
;; Utilities
|
||||
#:use-module (guix deprecation)
|
||||
#:use-module (guix gexp)
|
||||
#:use-module ((guix licenses) #:prefix license:)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (rosenthal utils cargo)
|
||||
;; Guix origin methods
|
||||
#:use-module (guix git-download)
|
||||
;; Guix build systems
|
||||
#:use-module (guix build-system cargo)
|
||||
#:use-module (guix build-system copy)
|
||||
#:use-module (guix build-system meson)
|
||||
;; Guix packages
|
||||
#:use-module (gnu packages admin)
|
||||
#:use-module (gnu packages audio)
|
||||
#:use-module (gnu packages base)
|
||||
#:use-module (gnu packages bash)
|
||||
#:use-module (gnu packages calendar)
|
||||
#:use-module (gnu packages curl)
|
||||
#:use-module (gnu packages fontutils)
|
||||
#:use-module (gnu packages freedesktop)
|
||||
#:use-module (gnu packages gl)
|
||||
#:use-module (gnu packages glib)
|
||||
#:use-module (gnu packages gnome)
|
||||
#:use-module (gnu packages gtk)
|
||||
#:use-module (gnu packages guile)
|
||||
#:use-module (gnu packages hardware)
|
||||
#:use-module (gnu packages imagemagick)
|
||||
#:use-module (gnu packages image)
|
||||
#:use-module (gnu packages jemalloc)
|
||||
#:use-module (gnu packages linux)
|
||||
#:use-module (gnu packages llvm)
|
||||
#:use-module (gnu packages pkg-config)
|
||||
#:use-module (gnu packages polkit)
|
||||
#:use-module (gnu packages python)
|
||||
#:use-module (gnu packages qt)
|
||||
#:use-module (gnu packages version-control)
|
||||
#:use-module (gnu packages wm)
|
||||
#:use-module (gnu packages xdisorg))
|
||||
|
||||
(define-public noctalia-shell
|
||||
(package
|
||||
(name "noctalia-shell")
|
||||
(version "4.7.7")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/noctalia-dev/noctalia-shell")
|
||||
(commit (string-append "v" version))))
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"0pchvsd89js4q7k10q621w3jqndv6raw6zy0px2b43ygh2kcpk22"))))
|
||||
(build-system copy-build-system)
|
||||
(arguments
|
||||
(list
|
||||
#:install-plan
|
||||
#~'(("." "etc/xdg/quickshell/noctalia-shell"))
|
||||
#:imported-modules
|
||||
`((guix build qt-utils)
|
||||
,@%copy-build-system-modules)
|
||||
#:modules
|
||||
'((srfi srfi-26)
|
||||
(guix build copy-build-system)
|
||||
(guix build qt-utils)
|
||||
(guix build utils))
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(add-after 'unpack 'patch-references
|
||||
(lambda* (#:key inputs #:allow-other-keys)
|
||||
(substitute* "Services/Power/IdleInhibitorService.qml"
|
||||
(("systemd-inhibit")
|
||||
(search-input-file inputs "bin/elogind-inhibit")))))
|
||||
(add-after 'unpack 'reduce-output-size
|
||||
(lambda _
|
||||
(delete-file-recursively "Assets/Screenshots")))
|
||||
(add-after 'install 'make-wrapper
|
||||
(lambda* (#:key inputs #:allow-other-keys)
|
||||
(let ((script "noctalia-shell"))
|
||||
(with-output-to-file script
|
||||
(lambda ()
|
||||
(format #t "~
|
||||
#!~a
|
||||
exec ~a --config ~a/etc/xdg/quickshell/noctalia-shell \"$@\"~%"
|
||||
(search-input-file inputs "bin/sh")
|
||||
(search-input-file inputs "bin/quickshell")
|
||||
#$output)))
|
||||
(wrap-script script
|
||||
`("PATH"
|
||||
suffix
|
||||
,(map (compose dirname
|
||||
(cut search-input-file inputs <>))
|
||||
'("bin/bluetoothctl"
|
||||
"bin/brightnessctl"
|
||||
"bin/cliphist"
|
||||
"bin/convert"
|
||||
"bin/ddcutil"
|
||||
"bin/fastfetch"
|
||||
"bin/fc-list"
|
||||
"bin/find"
|
||||
"bin/getent"
|
||||
"bin/git"
|
||||
"bin/grep"
|
||||
"bin/khal"
|
||||
"bin/ls"
|
||||
"bin/nmcli"
|
||||
"bin/python3"
|
||||
"bin/sh"
|
||||
"bin/which"
|
||||
"bin/wl-paste"
|
||||
"bin/wlsunset"
|
||||
"bin/wtype"
|
||||
"bin/xdg-open"))))
|
||||
(chmod script #o555)
|
||||
(install-file script (in-vicinity #$output "bin")))))
|
||||
(add-after 'make-wrapper 'qt-wrap
|
||||
(lambda args
|
||||
(apply wrap-all-qt-programs
|
||||
#:qtbase #$(this-package-input "qtbase")
|
||||
args))))))
|
||||
(inputs
|
||||
(list bash-minimal
|
||||
bluez
|
||||
brightnessctl
|
||||
cliphist
|
||||
coreutils-minimal
|
||||
ddcutil
|
||||
elogind
|
||||
fastfetch-minimal
|
||||
findutils
|
||||
fontconfig
|
||||
git-minimal
|
||||
glibc
|
||||
grep
|
||||
guile-3.0
|
||||
imagemagick
|
||||
khal
|
||||
network-manager
|
||||
noctalia-qs
|
||||
python-minimal
|
||||
qtbase
|
||||
qtmultimedia
|
||||
qtwayland
|
||||
which
|
||||
wl-clipboard
|
||||
wlsunset
|
||||
wtype
|
||||
xdg-utils))
|
||||
(home-page "https://noctalia.dev/")
|
||||
(synopsis "Wayland desktop shell")
|
||||
(description
|
||||
"Noctalia is a minimal desktop shell designed for Wayland, built on the
|
||||
@code{quickshell} framework. It offers a customizable and clean user interface,
|
||||
supporting various Wayland compositors like @code{niri}, @code{hyprland}, and
|
||||
@code{sway}.")
|
||||
(license license:expat)))
|
||||
;; TODO: Unbundle dependencies under the third_party directory.
|
||||
(define-public noctalia
|
||||
(let ((commit "0e4bb96a8b42abb47af67286902a52eaa628c50a")
|
||||
(revision "0"))
|
||||
(package
|
||||
(name "noctalia")
|
||||
(version (git-version "5.0.0" revision commit))
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/noctalia-dev/noctalia-shell")
|
||||
(commit commit)))
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"0ymv5i8dfd10ynfh1lrr7h8ydbi3h1xf4gp2j6313i7yghcymqy8"))))
|
||||
(build-system meson-build-system)
|
||||
(arguments
|
||||
(list #:build-type "release"
|
||||
;; FIXME: process_test fails with:
|
||||
;; --8<---------------cut here---------------start------------->8---
|
||||
;; stderr:
|
||||
;; process_test: completion-only async command exit code was wrong
|
||||
;; process_test: completion-only async command stdout was wrong
|
||||
;; --8<---------------cut here---------------end--------------->8---
|
||||
#:tests? #f
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(add-after 'unpack 'prepare-for-build
|
||||
(lambda _
|
||||
;; For reproducibility.
|
||||
(substitute* "meson.build"
|
||||
(("'-march=native', '-mtune=native',") ""))
|
||||
;; /bin/sh doesn't exist in the build environment.
|
||||
(substitute* "tests/process_test.cpp"
|
||||
(("/bin/(sh)" _ cmd)
|
||||
(which cmd))))))))
|
||||
(native-inputs
|
||||
(list pkg-config))
|
||||
(inputs
|
||||
(list cairo
|
||||
curl
|
||||
fontconfig
|
||||
freetype
|
||||
glib
|
||||
harfbuzz
|
||||
jemalloc
|
||||
(librsvg-for-system)
|
||||
libwebp
|
||||
libxkbcommon
|
||||
linux-pam
|
||||
mesa
|
||||
pango
|
||||
pipewire
|
||||
polkit
|
||||
sdbus-c++
|
||||
wayland
|
||||
wayland-protocols))
|
||||
(home-page "https://noctalia.dev/")
|
||||
(synopsis "Wayland shell and bar")
|
||||
(description
|
||||
"Noctalia is a lightweight Wayland shell and bar built directly on
|
||||
Wayland and OpenGL ES, with no Qt or GTK dependency.")
|
||||
(license license:expat))))
|
||||
|
||||
(define-public noctalia-qs
|
||||
(package
|
||||
(inherit quickshell)
|
||||
(name "noctalia-qs")
|
||||
(version "0.0.12")
|
||||
(source
|
||||
(origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/noctalia-dev/noctalia-qs")
|
||||
(commit (string-append "v" version))))
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32 "0zbqq9qgdsk5r2y4hag5p6276f67pq2w9imihdirvgnx0kclzlpg"))))
|
||||
(inputs
|
||||
(modify-inputs inputs
|
||||
(prepend glib polkit)))
|
||||
(home-page "https://noctalia.dev/")
|
||||
(synopsis "QtQuick-based desktop shell toolkit (Noctalia fork)")))
|
||||
(define-deprecated-package noctalia-shell noctalia)
|
||||
|
||||
@ -65,9 +65,6 @@
|
||||
home-niri-configuration
|
||||
home-niri-service-type
|
||||
|
||||
home-noctalia-shell-configuration
|
||||
home-noctalia-shell-service-type
|
||||
|
||||
home-bb-auth-service-type
|
||||
home-polkit-gnome-service-type
|
||||
|
||||
@ -378,54 +375,11 @@ compositor.")))
|
||||
;;; Noctalia
|
||||
;;;
|
||||
|
||||
(define-configuration/no-serialization home-noctalia-shell-configuration
|
||||
(noctalia-shell
|
||||
(file-like noctalia-shell)
|
||||
"File-like object to provide @command{/bin/noctalia-shell}."))
|
||||
(define-deprecated/public-alias home-noctalia-shell-configuration
|
||||
(@ (rosenthal home services desktop) home-noctalia-configuration))
|
||||
|
||||
;; Create ~/.config/noctalia directory, otherwise Noctalia shell won't show up
|
||||
;; on initial startup.
|
||||
(define (%home-noctalia-shell-activation _)
|
||||
(with-imported-modules (source-module-closure '((guix build utils)))
|
||||
#~(begin
|
||||
(use-modules (guix build utils))
|
||||
(let ((xdg-config-home
|
||||
(or (getenv "XDG_CONFIG_HOME")
|
||||
(in-vicinity (getenv "HOME") ".config"))))
|
||||
(mkdir-p (in-vicinity xdg-config-home "noctalia"))))))
|
||||
|
||||
(define %home-noctalia-shell-shepherd
|
||||
(match-record-lambda <home-noctalia-shell-configuration>
|
||||
(noctalia-shell)
|
||||
(list (shepherd-service
|
||||
(documentation "Start noctalia-shell.")
|
||||
(provision '(noctalia-shell))
|
||||
(requirement '(dbus graphical-session))
|
||||
(modules '((shepherd support)))
|
||||
(start
|
||||
#~(lambda args
|
||||
((make-forkexec-constructor
|
||||
(list #$(file-append noctalia-shell "/bin/noctalia-shell"))
|
||||
#:log-file (in-vicinity %user-log-dir "noctalia-shell.log")
|
||||
;; Inherit graphical session environment.
|
||||
#:environment-variables (environ))
|
||||
args)))
|
||||
(stop #~(make-kill-destructor))))))
|
||||
|
||||
(define home-noctalia-shell-service-type
|
||||
(service-type
|
||||
(name 'home-noctalia-shell)
|
||||
(extensions
|
||||
(list (service-extension home-profile-service-type
|
||||
(compose list home-noctalia-shell-configuration-noctalia-shell))
|
||||
(service-extension home-activation-service-type
|
||||
%home-noctalia-shell-activation)
|
||||
(service-extension home-shepherd-service-type
|
||||
%home-noctalia-shell-shepherd)
|
||||
(service-extension home-graphical-session-service-type
|
||||
(const 'wayland))))
|
||||
(default-value (home-noctalia-shell-configuration))
|
||||
(description "")))
|
||||
(define-deprecated/public-alias home-noctalia-shell-service-type
|
||||
(@ (rosenthal home services desktop) home-noctalia-shell-service-type))
|
||||
|
||||
|
||||
;;;
|
||||
|
||||
@ -64,53 +64,72 @@
|
||||
|
||||
;; https://github.com/artyom-poptsov/guile-ini
|
||||
(define (ini-file name exp)
|
||||
"Return file-like object NAME, serialized from G-expression EXP in INI
|
||||
format."
|
||||
"Return a file-like object, outputing INI file serialized from EXP."
|
||||
(computed-file name
|
||||
(with-extensions (list guile-ini guile-lib guile-smc)
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26) (ini))
|
||||
(call-with-output-file #$output
|
||||
(cut scm->ini #$exp #:port <>))))
|
||||
(if (gexp? exp)
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26) (ini))
|
||||
(call-with-output-file #$output
|
||||
(cut scm->ini #$exp #:port <>)))
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26) (ini))
|
||||
(call-with-output-file #$output
|
||||
(cut scm->ini '#$exp #:port <>)))))
|
||||
#:options '(#:substitutable? #f)))
|
||||
|
||||
;; https://github.com/aconchillo/guile-json
|
||||
(define (json-file name exp)
|
||||
"Return file-like object NAME, serialized from G-expression EXP in JSON
|
||||
format."
|
||||
"Return a file-like object, outputing JSON file serialized from EXP."
|
||||
(computed-file name
|
||||
(with-extensions (list guile-json-4)
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26) (json))
|
||||
(call-with-output-file #$output
|
||||
(cut scm->json #$exp <> #:pretty #t))))
|
||||
(if (gexp? exp)
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26) (json))
|
||||
(call-with-output-file #$output
|
||||
(cut scm->json #$exp <> #:pretty #t)))
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26) (json))
|
||||
(call-with-output-file #$output
|
||||
(cut scm->json '#$exp <> #:pretty #t)))))
|
||||
#:options '(#:substitutable? #f)))
|
||||
|
||||
;; https://github.com/hylophile/guile-toml
|
||||
;; TODO: TOML writing support is incomplete.
|
||||
;; See https://github.com/hylophile/guile-toml/blob/main/toml/builder.scm.
|
||||
(define (toml-file name exp)
|
||||
"Return file-like object NAME, serialized from G-expression EXP in TOML
|
||||
format."
|
||||
"Return a file-like object, outputing TOML file serialized from EXP."
|
||||
(computed-file name
|
||||
(with-extensions (list guile-json-4 guile-toml)
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26) (toml))
|
||||
(call-with-output-file #$output
|
||||
(cut scm->toml #$exp <>))))
|
||||
(if (gexp? exp)
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26) (toml))
|
||||
(call-with-output-file #$output
|
||||
(cut scm->toml #$exp <>)))
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26) (toml))
|
||||
(call-with-output-file #$output
|
||||
(cut scm->toml '#$exp <>)))))
|
||||
#:options '(#:substitutable? #f)))
|
||||
|
||||
;; https://gitlab.com/yorgath/guile-yamlpp
|
||||
(define (yaml-file name exp)
|
||||
"Return file-like object NAME, serialized from G-expression EXP in YAML
|
||||
format."
|
||||
"Return a file-like object, outputing YAML file serialized from EXP."
|
||||
(computed-file name
|
||||
(with-extensions (list guile-yamlpp)
|
||||
#~(begin
|
||||
(use-modules (yamlpp))
|
||||
(call-with-output-file #$output
|
||||
(lambda (port)
|
||||
(let ((emitter (make-yaml-emitter)))
|
||||
(yaml-emit! emitter #$exp)
|
||||
(display (yaml-emitter-string emitter) port))))))
|
||||
(if (gexp? exp)
|
||||
#~(begin
|
||||
(use-modules (yamlpp))
|
||||
(call-with-output-file #$output
|
||||
(lambda (port)
|
||||
(let ((emitter (make-yaml-emitter)))
|
||||
(yaml-emit! emitter #$exp)
|
||||
(display (yaml-emitter-string emitter) port)))))
|
||||
#~(begin
|
||||
(use-modules (yamlpp))
|
||||
(call-with-output-file #$output
|
||||
(lambda (port)
|
||||
(let ((emitter (make-yaml-emitter)))
|
||||
(yaml-emit! emitter '#$exp)
|
||||
(display (yaml-emitter-string emitter) port)))))))
|
||||
#:options '(#:substitutable? #f)))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user