dot_testing/builds/st.nix

60 lines
1.8 KiB
Nix
Raw Permalink Normal View History

2023-07-09 17:21:27 -05:00
{ stdenv
, lib
, fetchgit
, pkg-config
, libX11
, libXft
, fontconfig
, freetype
, ncurses
, extraLibs ? [ ]
2024-03-18 18:29:31 -05:00
, colorscheme ? null
2023-07-09 17:21:27 -05:00
}:
stdenv.mkDerivation rec {
pname = "st";
2024-03-18 18:29:31 -05:00
version = "1.03";
2023-07-09 17:21:27 -05:00
src = fetchgit {
url = "https://git.beepboop.systems/rndusr/st";
sha256 = "sha256-zdID1SUnTO/zl90EG8TguBNYYCnrnqFnSLz32kQZbng=";
};
2024-01-09 08:05:49 -06:00
nativeBuildInputs = [ pkg-config fontconfig freetype ncurses ];
2023-07-09 17:21:27 -05:00
buildInputs = [ libX11 libXft ] ++ extraLibs;
2024-03-18 18:29:31 -05:00
buildPhase = if colorscheme == null then ''
make
'' else ''
mv normal_colors.h colors.h
sed -i colors.h "s/base00/${colorscheme.palette.base00}/g"
sed -i colors.h "s/base01/${colorscheme.palette.base01}/g"
sed -i colors.h "s/base02/${colorscheme.palette.base02}/g"
sed -i colors.h "s/base03/${colorscheme.palette.base03}/g"
sed -i colors.h "s/base04/${colorscheme.palette.base04}/g"
sed -i colors.h "s/base05/${colorscheme.palette.base05}/g"
sed -i colors.h "s/base06/${colorscheme.palette.base06}/g"
sed -i colors.h "s/base07/${colorscheme.palette.base07}/g"
sed -i colors.h "s/base08/${colorscheme.palette.base08}/g"
sed -i colors.h "s/base09/${colorscheme.palette.base09}/g"
sed -i colors.h "s/base0A/${colorscheme.palette.base0A}/g"
sed -i colors.h "s/base0B/${colorscheme.palette.base0B}/g"
sed -i colors.h "s/base0C/${colorscheme.palette.base0C}/g"
sed -i colors.h "s/base0D/${colorscheme.palette.base0D}/g"
sed -i colors.h "s/base0E/${colorscheme.palette.base0E}/g"
sed -i colors.h "s/base0F/${colorscheme.palette.base0F}/g"
2023-07-09 17:21:27 -05:00
make
'';
installPhase = ''
mkdir -p $out/bin
cp ${pname} $out/bin
'';
meta = with lib; {
description = "Customized builds of the st terminal emulator";
homepage = "https://git.beepboop.systems/rndusr/st";
license = licenses.mit;
};
}