bf6-git-hbs2

This commit is contained in:
Snail 2025-02-19 16:47:37 +04:00 committed by voidlizard
parent da131c0110
commit 186d4c5f01
3 changed files with 71 additions and 37 deletions

View File

@ -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;

View File

@ -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

31
nix/bf6-hbs2-git.nix Normal file
View File

@ -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
'';
}