aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-11-24 18:03:44 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-11-24 18:25:01 +0100
commite8159ce258ff8e422e985f6161dc9dfde5bbec4c (patch)
tree511eee51a250f7b96eead98694cf7f7b83adb109 /pkgs
parenttests(tests/nvim-checkhealth): Init (diff)
downloadnixos-config-e8159ce258ff8e422e985f6161dc9dfde5bbec4c.zip
fix(pkgs/ctpv): Override to support more than 16 extensions in preview
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/by-name/ct/ctpv/allow-up-to-64-types.patch26
-rw-r--r--pkgs/by-name/ct/ctpv/package.nix45
2 files changed, 71 insertions, 0 deletions
diff --git a/pkgs/by-name/ct/ctpv/allow-up-to-64-types.patch b/pkgs/by-name/ct/ctpv/allow-up-to-64-types.patch
new file mode 100644
index 00000000..fdecb754
--- /dev/null
+++ b/pkgs/by-name/ct/ctpv/allow-up-to-64-types.patch
@@ -0,0 +1,26 @@
+From 069059937741d9a10ac1bdf7cc15e16e26f5da99 Mon Sep 17 00:00:00 2001
+From: Benedikt Peetz <benedikt.peetz@b-peetz.de>
+Date: Sun, 24 Nov 2024 17:27:17 +0100
+Subject: [PATCH] fix(config): Allow up to 64 types
+
+The limit of 16 seems to harsh.
+---
+ src/config.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/config.c b/src/config.c
+index 3556ccf..444fe29 100644
+--- a/src/config.c
++++ b/src/config.c
+@@ -274,7 +274,7 @@ static enum Status cmd_preview(Parser *ctx)
+ Token name = ctx->token;
+ EXPECT(ctx, TOK_STR);
+
+- struct TypeSet types[16];
++ struct TypeSet types[64];
+ unsigned int types_len = 0;
+
+ while (accept(ctx, TOK_BLK_OPEN) == STAT_NULL) {
+--
+2.47.0
+
diff --git a/pkgs/by-name/ct/ctpv/package.nix b/pkgs/by-name/ct/ctpv/package.nix
new file mode 100644
index 00000000..48798518
--- /dev/null
+++ b/pkgs/by-name/ct/ctpv/package.nix
@@ -0,0 +1,45 @@
+{
+ lib,
+ stdenv,
+ fetchFromGitHub,
+ makeWrapper,
+ file,
+ openssl,
+}:
+stdenv.mkDerivation rec {
+ pname = "ctpv";
+ version = "1.1";
+
+ src = fetchFromGitHub {
+ owner = "NikitaIvanovV";
+ repo = pname;
+ rev = "v${version}";
+ hash = "sha256-3BQi4m44hBmPkJBFNCg6d9YKRbDZwLxdzBb/NDWTQP4=";
+ };
+
+ nativeBuildInputs = [makeWrapper];
+
+ buildInputs = [
+ file # libmagic
+ openssl
+ ];
+
+ patches = [
+ ./allow-up-to-64-types.patch
+ ];
+
+ makeFlags = ["PREFIX=$(out)"];
+
+ preFixup = ''
+ wrapProgram $out/bin/ctpv \
+ --set PATH "${lib.makeBinPath []}";
+ '';
+
+ meta = with lib; {
+ description = "File previewer for a terminal";
+ homepage = "https://github.com/NikitaIvanovV/ctpv";
+ license = licenses.mit;
+ platforms = platforms.linux;
+ maintainers = [maintainers.wesleyjrz];
+ };
+}