Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 symlinkJoin,
3 lib,
4 makeWrapper,
5 folder-color-switcher,
6 nemo,
7 nemo-emblems,
8 nemo-fileroller,
9 nemo-python,
10 python3,
11 extensions ? [ ],
12 useDefaultExtensions ? true,
13}:
14
15let
16 selectedExtensions =
17 extensions
18 ++ lib.optionals useDefaultExtensions [
19 # We keep this in sync with a default Mint installation
20 # Right now (only) nemo-share is missing
21 folder-color-switcher
22 nemo-emblems
23 nemo-fileroller
24 nemo-python
25 ];
26 nemoPythonExtensionsDeps = lib.concatMap (x: x.nemoPythonExtensionDeps or [ ]) selectedExtensions;
27in
28symlinkJoin {
29 name = "nemo-with-extensions-${nemo.version}";
30
31 paths = [ nemo ] ++ selectedExtensions;
32
33 nativeBuildInputs = [ makeWrapper ];
34
35 postBuild = ''
36 for f in $(find $out/bin/ $out/libexec/ -type l -not -path "*/.*"); do
37 wrapProgram "$f" \
38 --set "NEMO_EXTENSION_DIR" "$out/${nemo.extensiondir}" \
39 --set "NEMO_PYTHON_EXTENSION_DIR" "$out/share/nemo-python/extensions" \
40 --set "NEMO_PYTHON_SEARCH_PATH" "${python3.pkgs.makePythonPath nemoPythonExtensionsDeps}"
41 done
42
43 # Don't populate the same nemo actions twice when having this globally installed
44 # https://github.com/NixOS/nixpkgs/issues/190781#issuecomment-1365601853
45 rm -r $out/share/nemo/actions
46
47 # Point to wrapped binary in all service files
48 for file in "share/dbus-1/services/nemo.FileManager1.service" \
49 "share/dbus-1/services/nemo.service"
50 do
51 rm "$out/$file"
52 substitute "${nemo}/$file" "$out/$file" \
53 --replace "${nemo}" "$out"
54 done
55 '';
56
57 meta = builtins.removeAttrs nemo.meta [
58 "name"
59 "outputsToInstall"
60 "position"
61 ];
62}