File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414 PORT = toString cfg . port ;
1515 DATABASE_PATH = cfg . databasePath ;
1616 REENCODARR_DATA_DIR = toString cfg . dataDir ;
17+ REENCODARR_TMPDIR = toString cfg . cacheDir ;
1718 }
1819 // cfg . extraEnvironment ;
1920
@@ -138,6 +139,12 @@ in {
138139 default = "/var/lib/reencodarr" ;
139140 } ;
140141
142+ cacheDir = mkOption {
143+ type = types . path ;
144+ default = "/var/cache/reencodarr" ;
145+ description = "Directory for temporary working files and caches." ;
146+ } ;
147+
141148 databasePath = mkOption {
142149 type = types . str ;
143150 default = "/var/lib/reencodarr/reencodarr.db" ;
217224
218225 systemd . tmpfiles . rules = [
219226 "d ${ cfg . dataDir } 0750 ${ cfg . user } ${ cfg . group } - -"
227+ "d ${ cfg . cacheDir } 0750 ${ cfg . user } ${ cfg . group } - -"
220228 "d ${ builtins . dirOf cfg . databasePath } 0750 ${ cfg . user } ${ cfg . group } - -"
221229 ] ;
222230
239247 User = cfg . user ;
240248 Group = cfg . group ;
241249 WorkingDirectory = cfg . dataDir ;
250+ ReadWritePaths = [ cfg . cacheDir cfg . dataDir ( builtins . dirOf cfg . databasePath ) ] ;
242251 LoadCredential = lib . optional ( cfg . secretKeyBaseFile != null ) "secret_key_base:${ cfg . secretKeyBaseFile } " ;
243252 Nice = cfg . nice ;
244253 IOSchedulingClass = cfg . ioSchedulingClass ;
You can’t perform that action at this time.
0 commit comments