Skip to content

Instantly share code, notes, and snippets.

@kristianlm
Last active August 9, 2022 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kristianlm/d30a017e08f595a7d24cad969274422f to your computer and use it in GitHub Desktop.
Save kristianlm/d30a017e08f595a7d24cad969274422f to your computer and use it in GitHub Desktop.
guix i3status-rust: remove kdeconnect dependency
(define-public i3status-rust-no-kdeconnect
(package
(inherit i3status-rust)
(name "i3status-rust-no-kdeconnect")
(arguments
(substitute-keyword-arguments (package-arguments i3status-rust)
((#:phases old-phases)
#~(modify-phases #$old-phases
(replace 'wrap-i3status
(lambda* (#:key outputs inputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
(paths (map
(lambda (input)
(string-append (assoc-ref inputs input) "/bin"))
(list "alsa-utils" "coreutils" "curl" "dbus" "ibus"
"iproute" "lm-sensors" "pulseaudio" "openssl"
"setxkbmap" "speedtest-cli" "xdg-utils" "xrandr"
"zlib"))))
(wrap-program (string-append out "/bin/i3status-rs")
`("PATH" prefix ,paths)))))))))
(inputs (modify-inputs (package-inputs i3status-rust)
(delete "kdeconnect")))))

The kdeconnect dependency of i3status-rust is pretty big so I wanted to remove it. @unmatched-parenthesis on #guix was kind enough to help me with this.

The above snippet should make this work, even though it's a bit messy. It isn't enough to remove the kdeconnect package dependency because that fails when it comes to wrap-i3status. The "kdeconnect" string has been manually removed from the (list ...).

Doing this frees up a ton of space:

~ > guix size i3status-rust | tail -n1
total: 1756.3 MiB
~ > guix size /gnu/store/m6fi7avhbmwj93sqi1pfllyavzfqpbiq-i3status-rust-no-kdeconnect-0.20.1.drv | tail -n1
total: 13.1 MiB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment