summaryrefslogtreecommitdiff
path: root/modules/tanelorn/packages/wm.scm
blob: 45a34e98b75cc64943fa870a2320039e92281ede (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
;;; Copyright © 2025 bdunahu <bdunahu@operationnull.com>
;;;
;;; SPDX-License-Identifier: GPL-3.0-or-later

(define-module (tanelorn packages wm)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system cargo)
  #:use-module (guix git-download)
  #:use-module (guix gexp)
  #:use-module (guix packages)
  #:use-module (guix utils)
  #:use-module (tanelorn packages)
  #:use-module (tanelorn packages rust-crates)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages pkg-config))

(define-public eww
  (let ((commit "fddb4a09b107237819e661151e007b99b5cab36d")
        (revision "1"))
    (package
      (name "eww")
      (version (git-version "0.6.0" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
                (url "https://github.com/elkowar/eww")
                (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "0ihgcxppywpcp24zhws1if6h7cxbrq2vd53wyh36j5mxylpbi59w"))
         (modules '((guix build utils)))
         ;; Remove the default features directly so that we can build
         ;; the x11 and wayland packages without all dependencies,
         ;; thus reducing the package size for those variants.
         (snippet '(substitute* "crates/eww/Cargo.toml"
                     (("^default =.*") "")))))
      (build-system cargo-build-system)
      (arguments
       `(#:install-source? #f
         #:features '("x11" "wayland")
         #:cargo-install-paths '("crates/eww")))
      (inputs (cons* glib
                     gdk-pixbuf
                     gtk+
                     gtk-layer-shell
                     libdbusmenu
                     (tanelorn-cargo-inputs 'eww)))
      (native-inputs (list pkg-config))
      (home-page "https://elkowar.github.io/eww")
      (synopsis "Widget system that works in any window manager")
      (description
       "Eww (Elkowars Wacky Widgets) is a standalone widget system made in Rust
that allows you to implement your own, custom widgets in any window manager.

Configured in yuck, a language based around S-expressions and themed using CSS,
it is easy to customize and provides all the flexibility you need.")
      (license license:expat))))

(define-public eww/x11
  (package/inherit eww
    (name "eww-x11")
    (inputs (modify-inputs (package-inputs eww)
              (delete "gtk-layer-shell")))
    (arguments
     (substitute-keyword-arguments (package-arguments eww)
       ((#:cargo-test-flags flags ''())
        `(cons* "--features=x11"
                ,flags))
       ((#:features _ ''())
        `(list "x11"))))))