summaryrefslogtreecommitdiffstats
path: root/nix/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nix/default.nix')
-rw-r--r--nix/default.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/nix/default.nix b/nix/default.nix
index 60e1981..ca449c8 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -1,6 +1,7 @@
{ lib
, stdenv
, rustPlatform
+, installShellFiles
, darwin
, version ? "git"
}:
@@ -22,6 +23,15 @@ rustPlatform.buildRustPackage rec {
darwin.apple_sdk.frameworks.Foundation
];
+ nativeBuildInputs = [ installShellFiles ];
+
+ postInstall = ''
+ installShellCompletion --cmd joshuto \
+ --bash <($out/bin/joshuto completions bash) \
+ --zsh <($out/bin/joshuto completions zsh) \
+ --fish <($out/bin/joshuto completions fish)
+ '';
+
patchPhase = ''
sed -i 's/env!("CARGO_PKG_VERSION")/\"${version}\"/g' src/main.rs
'';