lol

cinnamon.nemo-with-extensions: init

+90 -2
+5
pkgs/desktops/cinnamon/default.nix
··· 12 12 installPhase = "mv svg $out/share/iso-flags-svg"; 13 13 }); 14 14 15 + # Extensions added here will be shipped by default 16 + nemoExtensions = [ 17 + ]; 18 + 15 19 # blueberry -> pkgs/tools/bluetooth/blueberry/default.nix 16 20 bulky = callPackage ./bulky { }; 17 21 cinnamon-common = callPackage ./cinnamon-common { }; ··· 25 29 cinnamon-settings-daemon = callPackage ./cinnamon-settings-daemon { }; 26 30 cjs = callPackage ./cjs { }; 27 31 nemo = callPackage ./nemo { }; 32 + nemo-with-extensions = callPackage ./nemo/wrapper.nix { }; 28 33 mint-artwork = callPackage ./mint-artwork { }; 29 34 mint-cursor-themes = callPackage ./mint-cursor-themes { }; 30 35 mint-themes = callPackage ./mint-themes { };
+8 -2
pkgs/desktops/cinnamon/nemo/default.nix
··· 25 25 pname = "nemo"; 26 26 version = "5.6.1"; 27 27 28 - # TODO: add plugins support (see https://github.com/NixOS/nixpkgs/issues/78327) 29 - 30 28 src = fetchFromGitHub { 31 29 owner = "linuxmint"; 32 30 repo = pname; ··· 35 33 }; 36 34 37 35 patches = [ 36 + # Load extensions from NEMO_EXTENSION_DIR environment variable 37 + # https://github.com/NixOS/nixpkgs/issues/78327 38 + ./load-extensions-from-env.patch 39 + 38 40 # Don't populate nemo actions from /run/current-system/sw/share 39 41 # They should only be loaded exactly once from $out/share 40 42 # https://github.com/NixOS/nixpkgs/issues/190781 ··· 70 72 "--localedir=${cinnamon-translations}/share/locale" 71 73 ]; 72 74 75 + # Taken from libnemo-extension.pc. 76 + passthru.extensiondir = "lib/nemo/extensions-3.0"; 77 + 73 78 meta = with lib; { 74 79 homepage = "https://github.com/linuxmint/nemo"; 75 80 description = "File browser for Cinnamon"; 76 81 license = [ licenses.gpl2 licenses.lgpl2 ]; 77 82 platforms = platforms.linux; 78 83 maintainers = teams.cinnamon.members; 84 + mainProgram = "nemo"; 79 85 }; 80 86 } 81 87
+40
pkgs/desktops/cinnamon/nemo/load-extensions-from-env.patch
··· 1 + diff --git a/libnemo-private/nemo-module.c b/libnemo-private/nemo-module.c 2 + index 92bcff5..ecadcd8 100644 3 + --- a/libnemo-private/nemo-module.c 4 + +++ b/libnemo-private/nemo-module.c 5 + @@ -209,11 +209,16 @@ void 6 + nemo_module_setup (void) 7 + { 8 + static gboolean initialized = FALSE; 9 + + const gchar *extensiondir = NULL; 10 + 11 + if (!initialized) { 12 + initialized = TRUE; 13 + 14 + - load_module_dir (NEMO_EXTENSIONDIR); 15 + + extensiondir = g_getenv ("NEMO_EXTENSION_DIR"); 16 + + if (extensiondir == NULL) { 17 + + extensiondir = NEMO_EXTENSIONDIR; 18 + + } 19 + + load_module_dir (extensiondir); 20 + 21 + eel_debug_call_at_shutdown (free_module_objects); 22 + } 23 + diff --git a/src/nemo-extensions-list.c b/src/nemo-extensions-list.c 24 + index 944fc5f..983c396 100644 25 + --- a/src/nemo-extensions-list.c 26 + +++ b/src/nemo-extensions-list.c 27 + @@ -129,7 +129,12 @@ module_get_extensions_for_type (GType type) 28 + int 29 + main (int argc, char *argv[]) 30 + { 31 + - populate_from_directory (NEMO_EXTENSIONDIR); 32 + + const gchar *extensiondir = NULL; 33 + + extensiondir = g_getenv ("NEMO_EXTENSION_DIR"); 34 + + if (extensiondir == NULL) { 35 + + extensiondir = NEMO_EXTENSIONDIR; 36 + + } 37 + + populate_from_directory (extensiondir); 38 + 39 + GList *nd_providers; 40 + GList *l;
+37
pkgs/desktops/cinnamon/nemo/wrapper.nix
··· 1 + { symlinkJoin 2 + , lib 3 + , makeWrapper 4 + , nemo 5 + , nemoExtensions 6 + , extensions ? [ ] 7 + , useDefaultExtensions ? true 8 + }: 9 + 10 + let 11 + selectedExtensions = extensions ++ (lib.optionals useDefaultExtensions nemoExtensions); 12 + in 13 + symlinkJoin { 14 + name = "nemo-with-extensions-${nemo.version}"; 15 + 16 + paths = [ nemo ] ++ selectedExtensions; 17 + 18 + nativeBuildInputs = [ makeWrapper ]; 19 + 20 + postBuild = '' 21 + for f in $(find $out/bin/ $out/libexec/ -type l -not -path "*/.*"); do 22 + wrapProgram "$f" \ 23 + --set "NEMO_EXTENSION_DIR" "$out/${nemo.extensiondir}" 24 + done 25 + 26 + # Point to wrapped binary in all service files 27 + for file in "share/dbus-1/services/nemo.FileManager1.service" \ 28 + "share/dbus-1/services/nemo.service" 29 + do 30 + rm "$out/$file" 31 + substitute "${nemo}/$file" "$out/$file" \ 32 + --replace "${nemo}" "$out" 33 + done 34 + ''; 35 + 36 + inherit (nemo) meta; 37 + }