From 0c45cbe1f65cff864eb633d6c9e09fa9eb1430bc Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Sun, 19 May 2024 06:39:23 +0200 Subject: [PATCH] flake: add grzegorzctl-only package which installs shell-completions --- flake.nix | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index b00444f..e01309f 100644 --- a/flake.nix +++ b/flake.nix @@ -57,14 +57,28 @@ nativeBuildInputs = [ poetry-core ]; propagatedBuildInputs = [ setuptools flakes.self.pkgs.remi requests typer rich urllib3 ]; }; - default = flakes.self.pkgs.grzegorz-clients; + grzegorzctl = pkgs.runCommandNoCCLocal "grzegorzctl" ( + { + nativeBuildInputs = [ pkgs.installShellFiles ]; + } // + { inherit (flakes.self.pkgs.grzegorz-clients) meta; } // + { meta.mainProgram = "grzegorzctl"; } + )'' + mkdir -p $out/bin + ln -s "${flakes.self.pkgs.grzegorz-clients}/bin/grzegorzctl" $out/bin/grzegorzctl + installShellCompletion --cmd grzegorzctl \ + --bash <($out/bin/grzegorzctl --show-completion bash) \ + --zsh <($out/bin/grzegorzctl --show-completion zsh) \ + --fish <($out/bin/grzegorzctl --show-completion fish) + ''; + default = flakes.self.pkgs.grzegorzctl; }); apps = forAllSystems ({ system, ...}: rec { grzegorz-webui.type = "app"; grzegorz-webui.program = "${self.packages.${system}.grzegorz-clients}/bin/grzegorz-webui"; grzegorzctl.type = "app"; - grzegorzctl.program = "${self.packages.${system}.grzegorz-clients}/bin/grzegorzctl"; + grzegorzctl.program = "${self.packages.${system}.grzegorzctl}/bin/grzegorzctl"; default = grzegorzctl; });