File tree Expand file tree Collapse file tree 1 file changed +28
-2
lines changed
nixos/modules/system/boot/systemd Expand file tree Collapse file tree 1 file changed +28
-2
lines changed Original file line number Diff line number Diff line change 1818 inherit elemType placeholder ;
1919 } ;
2020
21+ escapeArgument = lib . strings . escapeC [
22+ "\t "
23+ "\n "
24+ "\r "
25+ " "
26+ "\\ "
27+ ] ;
28+
2129 settingsOption = {
2230 description = ''
2331 Declare systemd-tmpfiles rules to create, delete, and clean up volatile
126134
127135 # generates a single entry for a tmpfiles.d rule
128136 settingsEntryToRule = path : entry : ''
129- '${ entry . type } ' '${ path } ' '${ entry . mode } ' '${ entry . user } ' '${ entry . group } ' '${ entry . age } ' ${ entry . argument }
137+ '${ entry . type } ' '${ path } ' '${ entry . mode } ' '${ entry . user } ' '${ entry . group } ' '${ entry . age } ' ${ escapeArgument entry . argument }
130138 '' ;
131139
132140 # generates a list of tmpfiles.d rules from the attrs (paths) under tmpfiles.settings.<name>
199207 "boot.initrd.systemd.storePaths will lead to errors in the future."
200208 "Found these problematic files: ${ lib . concatStringsSep ", " paths } "
201209 ]
202- ) ;
210+ )
211+ ++ ( lib . flatten (
212+ lib . mapAttrsToList (
213+ name : paths :
214+ lib . mapAttrsToList (
215+ path : entries :
216+ lib . mapAttrsToList (
217+ type' : entry :
218+ lib . optional ( lib . match ''.*\\([nrt]|x[0-9A-Fa-f]{2}).*'' entry . argument != null ) (
219+ lib . concatStringsSep " " [
220+ "The argument option of ${ name } .${ type' } .${ path } appears to"
221+ "contain escape sequences, which will be escaped again."
222+ "Unescape them if this is not intended: \" ${ entry . argument } \" "
223+ ]
224+ )
225+ ) entries
226+ ) paths
227+ ) cfg . settings
228+ ) ) ;
203229
204230 systemd . additionalUpstreamSystemUnits = [
205231 "systemd-tmpfiles-clean.service"
You can’t perform that action at this time.
0 commit comments