diff --git a/nix/packages/by-name/hbrainfuck/package.nix b/nix/packages/by-name/hbrainfuck/package.nix new file mode 100644 index 00000000..0e8f9204 --- /dev/null +++ b/nix/packages/by-name/hbrainfuck/package.nix @@ -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) diff --git a/nix/packages/top-level.nix b/nix/packages/top-level.nix index 8fb9cfe8..22c34116 100644 --- a/nix/packages/top-level.nix +++ b/nix/packages/top-level.nix @@ -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;