diff --git a/sakura/services/pipewire.scm b/sakura/home/services/pipewire.scm similarity index 50% rename from sakura/services/pipewire.scm rename to sakura/home/services/pipewire.scm index eccb5a9..76555c0 100644 --- a/sakura/services/pipewire.scm +++ b/sakura/home/services/pipewire.scm @@ -1,17 +1,25 @@ -(define-module (sakura services pipewire) +(define-module (sakura home services pipewire) #:use-module (gnu packages) #:use-module (gnu packages linux) #:use-module (gnu services) #:use-module (gnu services configuration) #:use-module (gnu home services) #:use-module (gnu home services shepherd) - #:use-module (sakura packages networking) - #:use-module (guix gexp)) + #:use-module (guix gexp) + #:use-module (guix records) + #:export (home-pipewire-service-type + home-pipewire-configuration + home-pipewire-configuration?)) + +(define-record-type* + home-pipewire-configuration make-home-pipewire-configuration + home-pipewire-configuration? + (pipewire home-pipewire-configuration-pipewire (default pipewire)) + (wireplumber home-pipewire-configuration-wireplumber (default wireplumber))) (define (home-pipewire-profile-service config) - (list pipewire - wireplumber)) - + (list (home-pipewire-configuration-pipewire config) + (home-pipewire-configuration-wireplumber config))) (define (home-pipewire-shepherd-service config) (list @@ -21,7 +29,8 @@ (provision '(pipewire)) (stop #~(make-kill-destructor)) (start #~(make-forkexec-constructor - (list #$(file-append pipewire "/bin/pipewire")) + (list #$(file-append (home-pipewire-configuration-pipewire config) + "/bin/pipewire")) #:log-file (string-append (or (getenv "XDG_LOG_HOME") (format #f "~a/.local/var/log" @@ -36,7 +45,8 @@ (provision '(pipewire-pulse)) (stop #~(make-kill-destructor)) (start #~(make-forkexec-constructor - (list #$(file-append pipewire "/bin/pipewire-pulse")) + (list #$(file-append (home-pipewire-configuration-pipewire config) + "/bin/pipewire-pulse")) #:log-file (string-append (or (getenv "XDG_LOG_HOME") (format #f "~a/.local/var/log" @@ -51,7 +61,8 @@ (provision '(wireplumber)) (stop #~(make-kill-destructor)) (start #~(make-forkexec-constructor - (list #$(file-append wireplumber "/bin/wireplumber")) + (list #$(file-append (home-pipewire-configuration-wireplumber config) + "/bin/wireplumber")) #:log-file (string-append (or (getenv "XDG_LOG_HOME") (format #f "~a/.local/var/log" @@ -67,34 +78,33 @@ "asoundrc" #~(string-append "<" - #$(file-append - pipewire "/share/alsa/alsa.conf.d/50-pipewire.conf") + #$(file-append (home-pipewire-configuration-pipewire config) + "/share/alsa/alsa.conf.d/50-pipewire.conf") ">\n<" - #$(file-append - pipewire "/share/alsa/alsa.conf.d/99-pipewire-default.conf") + #$(file-append (home-pipewire-configuration-pipewire config) + "/share/alsa/alsa.conf.d/99-pipewire-default.conf") ">\n" - " - pcm_type.pipewire { - lib " #$(file-append pipewire "/lib/alsa-lib/libasound_module_pcm_pipewire.so") - " - } - ctl_type.pipewire { - lib " #$(file-append pipewire "/lib/alsa-lib/libasound_module_ctl_pipewire.so") - " - } - "))))) + "\npcm_type.pipewire {\n lib " + #$(file-append (home-pipewire-configuration-pipewire config) + "/lib/alsa-lib/libasound_module_pcm_pipewire.so") + "\n}ctl_type.pipewire {\n lib " + #$(file-append (home-pipewire-configuration-pipewire config) + "/lib/alsa-lib/libasound_module_ctl_pipewire.so") + "\n}\n" + ))))) -(define-public home-pipewire-service-type - (service-type (name 'home-pipewire) - (extensions - (list (service-extension - home-profile-service-type - home-pipewire-profile-service) - (service-extension - home-shepherd-service-type - home-pipewire-shepherd-service) - (service-extension - home-xdg-configuration-files-service-type - home-pipewire-xdg-configuration-service))) - (default-value #f) - (description "Configures and runs Pipewire and Wireplumber"))) +(define home-pipewire-service-type + (service-type + (name 'home-pipewire) + (extensions + (list (service-extension + home-profile-service-type + home-pipewire-profile-service) + (service-extension + home-shepherd-service-type + home-pipewire-shepherd-service) + (service-extension + home-xdg-configuration-files-service-type + home-pipewire-xdg-configuration-service))) + (default-value (home-pipewire-configuration)) + (description "Configures and runs Pipewire and Wireplumber"))) diff --git a/sakura/packages/networking.scm b/sakura/packages/networking.scm index 01fef38..049c30c 100644 --- a/sakura/packages/networking.scm +++ b/sakura/packages/networking.scm @@ -8,11 +8,14 @@ #:use-module (guix git-download) #:use-module (guix build-system cargo) #:use-module (guix build-system meson) + #:use-module (guix build-system python) #:use-module (gnu packages) #:use-module (gnu packages linux) #:use-module (gnu packages gcc) #:use-module (gnu packages gtk) #:use-module (gnu packages glib) + #:use-module (gnu packages bash) + #:use-module (gnu packages base) #:use-module (gnu packages gnome) #:use-module (gnu packages pkg-config) #:use-module (gnu packages networking) @@ -20,7 +23,11 @@ #:use-module (gnu packages crates-gtk) #:use-module (gnu packages pulseaudio) #:use-module (gnu packages freedesktop) + #:use-module (gnu packages compression) #:use-module (gnu packages gettext) + #:use-module (gnu packages gnome) + #:use-module (gnu packages python) + #:use-module (gnu packages python-xyz) #:use-module (gnu packages rust) #:use-module (sakura packages) #:use-module (sakura packages crates-io)) @@ -119,8 +126,84 @@ dbus libadwaita pulseaudio - bluez)) + bluez + gtk)) (home-page "https://github.com/kaii-lb/overskride") (synopsis "A simple yet powerful bluetooth client.") (description "todo") (license license:gpl3+))) + + +(define-public blueberry + (package + (name "blueberry") + (version "1.4.8") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/linuxmint/blueberry" + "/archive/refs/tags/" version ".tar.gz")) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0cksdbxl55jm30inbiz5ryb675p2lab936r04pkcxg3w7jyb199p")))) + (build-system python-build-system) + (native-inputs + (modify-inputs (package-native-inputs gnome-bluetooth) + (append gnu-make) + (append gettext-minimal) + (append sed))) + (inputs + (modify-inputs (package-inputs gnome-bluetooth) + (append bash) + (append gnome-bluetooth) + (append python-pygobject) + (append python-setproctitle))) + (propagated-inputs + (package-propagated-inputs gnome-bluetooth)) + (arguments + `(#:phases + (modify-phases %standard-phases + (replace 'unpack + (lambda* (#:key source #:allow-other-keys) + (invoke "tar" "xf" source "--strip-components=1"))) + (add-after 'unpack 'patch + (lambda* (#:key inputs outputs #:allow-other-keys) + (substitute* (append + (find-files "usr/bin" ".*") + (find-files "usr/lib" ".*")) + ; fix python schbang + (("/usr/bin/python3") + (string-append + (assoc-ref inputs "python") "/bin/python3")) + ; fix sh schbang + (("/bin/sh") + (string-append + (assoc-ref inputs "bash") "/bin/sh")) + ; fix blueberry file locations + (("/usr/(bin|lib|share)" cmd path) + (string-append + (assoc-ref outputs "out") "/" path))))) + (delete 'build) + (delete 'check) + (replace 'install + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out"))) + (mkdir-p out) + (copy-recursively + (assoc-ref inputs "gnome-bluetooth") + out) + (for-each (lambda (file) + (let* ((src (string-append "usr/" file)) + (dst (string-append out "/" file))) + (mkdir-p dst) + (copy-recursively src dst))) + '("lib" + "share" + "bin")) + (invoke "make" "all")))) + ))) + (home-page "") + (synopsis "") + (description "") + (license license:gpl3+)))