1diff --git a/dolphin/mat2.desktop b/dolphin/mat2.desktop
2index e623962..5d69ae2 100644
3--- a/dolphin/mat2.desktop
4+++ b/dolphin/mat2.desktop
5@@ -7,5 +7,5 @@ Type=Service
6 [Desktop Action cleanMetadata]
7 Name=Clean metadata
8 Name[es]=Limpiar metadatos
9-Icon=/usr/share/icons/hicolor/scalable/apps/mat2.svg
10-Exec=kdialog --yesno "$( mat2 -s %U )" --title "Clean Metadata?" && mat2 %U
11+Icon=@mat2svg@
12+Exec=@kdialog@ --yesno "$( @mat2@ -s %U )" --title "Clean Metadata?" && @mat2@ %U
13diff --git a/libmat2/bubblewrap.py b/libmat2/bubblewrap.py
14index 970d5dd..5d3c0b7 100644
15--- a/libmat2/bubblewrap.py
16+++ b/libmat2/bubblewrap.py
17@@ -22,11 +22,7 @@ CalledProcessError = subprocess.CalledProcessError
18
19
20 def _get_bwrap_path() -> str:
21- which_path = shutil.which('bwrap')
22- if which_path:
23- return which_path
24-
25- raise RuntimeError("Unable to find bwrap") # pragma: no cover
26+ return '@bwrap@'
27
28
29 def _get_bwrap_args(tempdir: str,
30@@ -37,16 +33,11 @@ def _get_bwrap_args(tempdir: str,
31
32 # XXX: use --ro-bind-try once all supported platforms
33 # have a bubblewrap recent enough to support it.
34- ro_bind_dirs = ['/usr', '/lib', '/lib64', '/bin', '/sbin', '/etc/alternatives', cwd]
35+ ro_bind_dirs = ['/nix/store', cwd]
36 for bind_dir in ro_bind_dirs:
37 if os.path.isdir(bind_dir): # pragma: no cover
38 ro_bind_args.extend(['--ro-bind', bind_dir, bind_dir])
39
40- ro_bind_files = ['/etc/ld.so.cache']
41- for bind_file in ro_bind_files:
42- if os.path.isfile(bind_file): # pragma: no cover
43- ro_bind_args.extend(['--ro-bind', bind_file, bind_file])
44-
45 args = ro_bind_args + \
46 ['--dev', '/dev',
47 '--proc', '/proc',
48diff --git a/libmat2/exiftool.py b/libmat2/exiftool.py
49index eb65b2a..51a0fa1 100644
50--- a/libmat2/exiftool.py
51+++ b/libmat2/exiftool.py
52@@ -1,8 +1,6 @@
53-import functools
54 import json
55 import logging
56 import os
57-import shutil
58 import subprocess
59 from typing import Dict, Union, Set
60
61@@ -70,14 +68,5 @@ class ExiftoolParser(abstract.AbstractParser):
62 return False
63 return True
64
65-@functools.lru_cache()
66 def _get_exiftool_path() -> str: # pragma: no cover
67- which_path = shutil.which('exiftool')
68- if which_path:
69- return which_path
70-
71- # Exiftool on Arch Linux has a weird path
72- if os.access('/usr/bin/vendor_perl/exiftool', os.X_OK):
73- return '/usr/bin/vendor_perl/exiftool'
74-
75- raise RuntimeError("Unable to find exiftool")
76+ return '@exiftool@'
77diff --git a/libmat2/parser_factory.py b/libmat2/parser_factory.py
78index 9965432..bd45179 100644
79--- a/libmat2/parser_factory.py
80+++ b/libmat2/parser_factory.py
81@@ -8,6 +8,7 @@ from . import abstract, UNSUPPORTED_EXTENSIONS
82
83 T = TypeVar('T', bound='abstract.AbstractParser')
84
85+mimetypes.init(['@mimetypes@'])
86 mimetypes.add_type('application/epub+zip', '.epub')
87 mimetypes.add_type('application/x-dtbncx+xml', '.ncx') # EPUB Navigation Control XML File
88
89diff --git a/libmat2/video.py b/libmat2/video.py
90index b4a3232..3dd7ee5 100644
91--- a/libmat2/video.py
92+++ b/libmat2/video.py
93@@ -1,6 +1,4 @@
94 import subprocess
95-import functools
96-import shutil
97 import logging
98
99 from typing import Dict, Union
100@@ -135,10 +133,5 @@ class MP4Parser(AbstractFFmpegParser):
101 }
102
103
104-@functools.lru_cache()
105 def _get_ffmpeg_path() -> str: # pragma: no cover
106- which_path = shutil.which('ffmpeg')
107- if which_path:
108- return which_path
109-
110- raise RuntimeError("Unable to find ffmpeg")
111+ return '@ffmpeg@'