diff options
author | Hilton Chain <hako@ultrarare.space> | 2025-09-01 16:49:02 +0800 |
---|---|---|
committer | Hilton Chain <hako@ultrarare.space> | 2025-09-02 01:46:38 +0800 |
commit | db43751ec32eb2c38662947c0d34621a7b47cc7f (patch) | |
tree | 3efcf46b975e77da2d531f841b5abae727dea4d7 | |
parent | 6412cbf0d517fa62e956df0049e804638154f569 (diff) |
gnu: niri: Install completions.
* gnu/packages/wm.scm (niri) [arguments] <#:phases>: Install completions.
[native-inputs]: Add self when cross-compiling.
Change-Id: If9a6725ee13c87b5a76b959c3d6fe9804e884415
-rw-r--r-- | gnu/packages/wm.scm | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm index c6fab44607..63796fe5cd 100644 --- a/gnu/packages/wm.scm +++ b/gnu/packages/wm.scm @@ -1941,6 +1941,10 @@ limited size and a few external dependencies. It is configurable via (build-system cargo-build-system) (arguments (list #:install-source? #f + #:modules + '((ice-9 match) + (guix build utils) + (guix build cargo-build-system)) #:phases #~(modify-phases %standard-phases (add-after 'unpack 'use-guix-vendored-dependencies @@ -1977,9 +1981,31 @@ limited size and a few external dependencies. It is configurable via (in-vicinity #$output "share/wayland-sessions")) (install-file "resources/niri-portals.conf" - (in-vicinity #$output "share/xdg-desktop-portal"))))))) + (in-vicinity #$output "share/xdg-desktop-portal")))) + (add-after 'install 'install-completions + (lambda* (#:key native-inputs #:allow-other-keys) + (for-each + (match-lambda + ((shell . path) + (mkdir-p (in-vicinity #$output (dirname path))) + (let ((binary + (if #$(%current-target-system) + (search-input-file native-inputs "bin/nir") + (in-vicinity #$output "bin/niri")))) + (with-output-to-file (in-vicinity #$output path) + (lambda _ + (invoke binary "completions" shell)))))) + '(("bash" . "share/bash-completion/completions/niri") + ("elvish" . "share/elvish/lib/niri") + ("fish" . "share/fish/vendor_completions.d/niri.fish") + ("nushell" . "share/nushell/vendor/autoload/niri") + ("zsh" . "share/zsh/site-functions/_niri")))))))) (native-inputs - (list pkg-config)) + (append + (if (%current-target-system) + (list this-package) + '()) + (list pkg-config))) (inputs (cons* clang dbus |