summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorfigsoda <figsoda@pm.me>2023-04-06 14:14:01 -0400
committerGitHub <noreply@github.com>2023-04-06 20:14:01 +0200
commit1c324765e92c23826dff4f37d3b01761a3ac6ef4 (patch)
tree1c84390a6ff58545374b7cbfa3c74f82af306558 /flake.nix
parent75461675c4e57675174d98060124c9e13beaf7e4 (diff)
Add shell completions and man pages (#582)
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix15
1 files changed, 14 insertions, 1 deletions
diff --git a/flake.nix b/flake.nix
index 9d95aa82..0e2bf47c 100644
--- a/flake.nix
+++ b/flake.nix
@@ -10,6 +10,7 @@
;
inherit (nixpkgs.lib)
genAttrs
+ importTOML
optionals
;
@@ -39,11 +40,23 @@
allowBuiltinFetchGit = true;
};
+ nativeBuildInputs = [
+ pkgs.installShellFiles
+ ];
+
buildInputs = optionals pkgs.stdenv.isDarwin [
pkgs.darwin.apple_sdk.frameworks.CoreServices
];
- TYPST_VERSION = rev "(unknown version)";
+ postInstall = ''
+ installManPage cli/artifacts/*.1
+ installShellCompletion \
+ cli/artifacts/typst.{bash,fish} \
+ --zsh cli/artifacts/_typst
+ '';
+
+ GEN_ARTIFACTS = "artifacts";
+ TYPST_VERSION = "${(importTOML ./cli/Cargo.toml).package.version} (${rev "unknown hash"})";
};
in
{