From 2e86faf11a830fa12d210d5f0591359c9253106f Mon Sep 17 00:00:00 2001 From: Sofi Date: Thu, 21 Jul 2022 01:01:17 +0200 Subject: [PATCH] ferium: add shell completions --- pkgs/games/ferium/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/games/ferium/default.nix b/pkgs/games/ferium/default.nix index d84b1c556153..f72ce4da7eeb 100644 --- a/pkgs/games/ferium/default.nix +++ b/pkgs/games/ferium/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, rustPlatform, Security }: +{ lib, stdenv, fetchFromGitHub, rustPlatform, Security, installShellFiles }: rustPlatform.buildRustPackage rec { pname = "ferium"; @@ -21,6 +21,15 @@ rustPlatform.buildRustPackage rec { # Requires an internet connection doCheck = false; + nativeBuildInputs = [ installShellFiles ]; + + postInstall = '' + for shell in bash fish zsh; do + $out/bin/ferium complete $shell > ferium.$shell + installShellCompletion ferium.$shell + done + ''; + meta = with lib; { description = "Fast and multi-source CLI program for managing Minecraft mods and modpacks from Modrinth, CurseForge, and GitHub Releases"; homepage = "https://github.com/gorilla-devs/ferium";