incus: install all shell completions

This commit is contained in:
Adam Stephens 2024-01-03 08:46:27 -05:00
parent d120d30762
commit 21b45f7167
No known key found for this signature in database

View File

@ -1,6 +1,7 @@
{ lib
, buildGoModule
, fetchFromGitHub
, fetchpatch
, acl
, cowsql
, hwdata
@ -27,6 +28,14 @@ buildGoModule rec {
vendorHash = "sha256-YfUvkN1qUS3FFKb1wysg40WcJA8fT9SGDChSdT+xnkc=";
patches = [
# remove with > 0.4.0
(fetchpatch {
url = "https://github.com/lxc/incus/commit/c0200b455a1468685d762649120ce7e2bb25adc9.patch";
hash = "sha256-4fiSv6GcsKpdLh3iNbw3AGuDzcw1EadUvxtSjxRjtTA=";
})
];
postPatch = ''
substituteInPlace internal/usbid/load.go \
--replace "/usr/share/misc/usb.ids" "${hwdata}/share/hwdata/usb.ids"
@ -77,9 +86,15 @@ buildGoModule rec {
'';
postInstall = ''
# use custom bash completion as it has extra logic for e.g. instance names
installShellCompletion --bash --name incus ./scripts/bash/incus
installShellCompletion --cmd incus \
--fish <($out/bin/incus completion fish) \
--zsh <($out/bin/incus completion zsh)
'';
passthru = {
tests.incus = nixosTests.incus;