.files/nix/packages/by-name/ruler/package.nix

28 lines
915 B
Nix

{
haskellPackages,
haskell,
fetchFromGitea,
installShellFiles,
}:
let
inherit (haskell.lib.compose) justStaticExecutables overrideCabal;
drv = haskellPackages.callCabal2nix "ruler" (fetchFromGitea {
domain = "git.confusedcompiler.org";
owner = "leana8959";
repo = "ruler";
rev = "2556b4985065d093b1db3a14a2c5c37115871c78";
hash = "sha256-OvNhDpyAbZp+d0rSXLE55BvM5jT3OI8q79D6aVaA2FI=";
}) { };
cabalOverrides = o: {
buildTools = o.buildTools or [ ] ++ [ installShellFiles ];
postInstall = o.postInstall or "" + ''
installShellCompletion --cmd ruler \
--bash <("$out/bin/ruler" --bash-completion-script "$out/bin/ruler") \
--fish <("$out/bin/ruler" --fish-completion-script "$out/bin/ruler") \
--zsh <("$out/bin/ruler" --zsh-completion-script "$out/bin/ruler")
'';
};
in
justStaticExecutables (overrideCabal cabalOverrides drv)