File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -31,3 +31,24 @@ For such cases `pyproject.nix` provides a utility function [`mkApplication`](htt
3131 };
3232}
3333```
34+
35+ ## Additional data
36+
37+ When shipping an application you might want to ship additional data such as shell completions.
38+
39+ To ship additional data in the same derivation as the application derivation use an override:
40+
41+ ``` nix
42+ (mkApplication {
43+ venv = pythonSet.mkVirtualEnv "application-env" workspace.deps.default;
44+ package = pythonSet.hello-world;
45+ }).overrideAttrs(old: {
46+ nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.installShellFiles ];
47+ postInstall = ''
48+ installShellCompletion --cmd ${cmd} \
49+ --bash <($out/bin/${cmd} --show-completion bash) \
50+ --fish <($out/bin/${cmd} --show-completion fish) \
51+ --zsh <($out/bin/${cmd} --show-completion zsh)
52+ '';
53+ })
54+ ```
You can’t perform that action at this time.
0 commit comments