diff --git a/flake.nix b/flake.nix index 81ee54ea..b0e92180 100644 --- a/flake.nix +++ b/flake.nix @@ -134,10 +134,13 @@ outputs = { self, nixpkgs, flake-utils, ... }@inputs: ]; makePackages = pkgs: - pkgs.lib.mapAttrs + let ps = pkgs.lib.mapAttrs (_name: packagePostOverrides) # we can't apply overrides inside our overlay because it will remove linking info (pkgs.lib.getAttrs packageNames (ourHaskellPackages pkgs)) ; + in ps // { + bf6-git-hbs2 = pkgs.callPackage ./nix/bf6-hbs2-git.nix { inherit (ps) suckless-conf; }; + }; packagesDynamic = makePackages pkgs; packagesStatic = makePackages pkgs.pkgsStatic; diff --git a/hbs2-git/hbs2-git.cabal b/hbs2-git/hbs2-git.cabal index 8c44ebe0..73400c33 100644 --- a/hbs2-git/hbs2-git.cabal +++ b/hbs2-git/hbs2-git.cabal @@ -127,47 +127,47 @@ library hs-source-dirs: hbs2-git-client-lib -executable hbs2-git-subscribe - import: shared-properties - main-is: Main.hs - -- other-modules: - -- other-extensions: - build-depends: - base, hbs2-git - , binary - , vector - , optparse-applicative +-- executable hbs2-git-subscribe +-- import: shared-properties +-- main-is: Main.hs +-- -- other-modules: +-- -- other-extensions: +-- build-depends: +-- base, hbs2-git +-- , binary +-- , vector +-- , optparse-applicative - hs-source-dirs: git-hbs2-subscribe - default-language: GHC2021 +-- hs-source-dirs: git-hbs2-subscribe +-- default-language: GHC2021 -executable git-hbs2 - import: shared-properties - main-is: Main.hs - -- other-modules: - -- other-extensions: - build-depends: - base, hbs2-git - , binary - , vector - , optparse-applicative +-- executable git-hbs2 +-- import: shared-properties +-- main-is: Main.hs +-- -- other-modules: +-- -- other-extensions: +-- build-depends: +-- base, hbs2-git +-- , binary +-- , vector +-- , optparse-applicative - hs-source-dirs: git-hbs2 - default-language: GHC2021 +-- hs-source-dirs: git-hbs2 +-- default-language: GHC2021 -executable git-remote-hbs2 - import: shared-properties - main-is: Main.hs - -- other-modules: - -- other-extensions: - build-depends: - base, hbs2-git - , binary - , vector - , optparse-applicative +-- executable git-remote-hbs2 +-- import: shared-properties +-- main-is: Main.hs +-- -- other-modules: +-- -- other-extensions: +-- build-depends: +-- base, hbs2-git +-- , binary +-- , vector +-- , optparse-applicative - hs-source-dirs: git-remote-hbs2 - default-language: GHC2021 +-- hs-source-dirs: git-remote-hbs2 +-- default-language: GHC2021 diff --git a/nix/bf6-hbs2-git.nix b/nix/bf6-hbs2-git.nix new file mode 100644 index 00000000..401de2ed --- /dev/null +++ b/nix/bf6-hbs2-git.nix @@ -0,0 +1,31 @@ +{ + lib, + writeTextFile, + stdenv, + suckless-conf, +}: +stdenv.mkDerivation { + pname = "bf6-git-hbs2"; + version = "1.0"; + + dontUnpack = true; + dontConfigure = true; + doCheck = false; + + installPhase = let + name = "git-hbs2"; + withLines = f: s: lib.strings.concatStringsSep "\n" (f (lib.strings.splitString "\n" s)); + p = writeTextFile { + inherit name; + text = lib.strings.concatStringsSep "\n" [ + ''#! ${suckless-conf}/bin/bf6 file'' + (withLines (lib.lists.drop 1) (builtins.readFile ../hbs2-git3/bf6/git-hbs2)) + ]; + executable = true; + destination = "/bin/${name}"; + }; + in '' + mkdir -p $out/bin + cp ${p}/bin/${name} $out/bin + ''; +}