hbrainfuck: migrate to by-name

This commit is contained in:
Primrose 2025-05-20 17:27:18 +02:00
parent 2cc3e6e0fd
commit e17698a07d
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
2 changed files with 33 additions and 15 deletions

View file

@ -0,0 +1,33 @@
{
haskellPackages,
haskell,
fetchFromGitea,
installShellFiles,
}: let
inherit (haskell.lib.compose) justStaticExecutables overrideCabal;
drv =
haskellPackages.callCabal2nix "hbrainfuck"
(fetchFromGitea {
domain = "git.confusedcompiler.org";
owner = "leana8959";
repo = "hbrainfuck";
rev = "796aae9bdb222e8e0431627eb11a3e3a71c1ffef";
hash = "sha256-4OQ//QGzuPeOe1Zi9IjttUu4vLKufPCWXJzBk9v5zXc=";
})
{};
cabalOverrides = o: {
buildTools = o.buildTools or [] ++ [installShellFiles];
postInstall =
o.postInstall or ""
+ ''
installShellCompletion --cmd hbrainfuck \
--bash <("$out/bin/hbf" --bash-completion-script "$out/bin/hbf") \
--fish <("$out/bin/hbf" --fish-completion-script "$out/bin/hbf") \
--zsh <("$out/bin/hbf" --zsh-completion-script "$out/bin/hbf")
'';
};
in
justStaticExecutables
(overrideCabal cabalOverrides drv)

View file

@ -38,21 +38,6 @@ in rec {
];
};
# my repositories
hbrainfuck = mkHaskellPackage {
name = "hbrainfuck";
src = sources.hbrainfuck;
apply = infuse {
__output.nativeBuildInputs.__append = [pkgs.installShellFiles];
__output.postInstall.__append = ''
installShellCompletion --cmd hbrainfuck \
--bash <("$out/bin/hbrainfuck" --bash-completion-script "$out/bin/hbrainfuck") \
--fish <("$out/bin/hbrainfuck" --fish-completion-script "$out/bin/hbrainfuck") \
--zsh <("$out/bin/hbrainfuck" --zsh-completion-script "$out/bin/hbrainfuck")
'';
};
};
prop-solveur = mkHaskellPackage {
name = "prop-solveur";
src = sources.prop_solveur;