diff options
author | Pol Dellaiera <pol.dellaiera@protonmail.com> | 2023-07-29 21:54:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-29 21:54:00 +0200 |
commit | f7907c1f09fb521cd3ae63172d1b5954268762cb (patch) | |
tree | 5d8e4c2961b98d136c8fcdd2dfbb8d526320f924 /pkgs/applications/file-managers | |
parent | 83203e154e754ec460c5e16b6f15cc2eca31fd46 (diff) | |
parent | 70680e8dc7369e643a482d11d01613d27f61a3cd (diff) |
Merge pull request #243519 from cueaz/nnn-mime
nnn: fix file mime opts on darwin
Diffstat (limited to 'pkgs/applications/file-managers')
-rw-r--r-- | pkgs/applications/file-managers/nnn/darwin-fix-file-mime-opts.patch | 15 | ||||
-rw-r--r-- | pkgs/applications/file-managers/nnn/default.nix | 4 |
2 files changed, 19 insertions, 0 deletions
diff --git a/pkgs/applications/file-managers/nnn/darwin-fix-file-mime-opts.patch b/pkgs/applications/file-managers/nnn/darwin-fix-file-mime-opts.patch new file mode 100644 index 0000000000000..f1bf71e6b9125 --- /dev/null +++ b/pkgs/applications/file-managers/nnn/darwin-fix-file-mime-opts.patch @@ -0,0 +1,15 @@ +diff --git a/src/nnn.c b/src/nnn.c +index b3c0f986..c74e1ec9 100644 +--- a/src/nnn.c ++++ b/src/nnn.c +@@ -508,9 +508,7 @@ alignas(max_align_t) static char g_pipepath[TMP_LEN_MAX]; + static runstate g_state; + + /* Options to identify file MIME */ +-#if defined(__APPLE__) +-#define FILE_MIME_OPTS "-bIL" +-#elif !defined(__sun) /* no MIME option for 'file' */ ++#if !defined(__sun) /* no MIME option for 'file' */ + #define FILE_MIME_OPTS "-biL" + #endif + diff --git a/pkgs/applications/file-managers/nnn/default.nix b/pkgs/applications/file-managers/nnn/default.nix index 4c3fab6484c94..6386018348a04 100644 --- a/pkgs/applications/file-managers/nnn/default.nix +++ b/pkgs/applications/file-managers/nnn/default.nix @@ -34,6 +34,10 @@ stdenv.mkDerivation (finalAttrs: { }; patches = [ + # Nix-specific: ensure nnn passes correct arguments to the Nix file command on Darwin. + # By default, nnn expects the macOS default file command, not the one provided by Nix. + # However, both commands use different arguments to obtain the MIME type. + ./darwin-fix-file-mime-opts.patch # FIXME: remove for next release (fetchpatch { url = "https://github.com/jarun/nnn/commit/20e944f5e597239ed491c213a634eef3d5be735e.patch"; |