Ludovic Courtès writes: Hi! > The ‘rottlog-configuration’ is actually a macro. So at every call site > where a default value is used, the default value code is duplicated, > leading to code bloat if that default value is a big expression. Ah, ok. >> I'm not sure if we should export the %default-rotations or if we should >> describe their contents in the manual. > > Probably worth exporting and documenting, so people can ‘cons’ on it. Ok. >> +(define (syslog-rotation-config file) >> + (let ((coreutils >> "/gnu/store/56x9fvx59i300wav3c193h84cp80bslr-coreutils-8.25")) ;; >> FIXME > > Good point… Hmm... :-) > I think we cannot use ‘plain-file’ here because of the computed ‘kill’ > file name. So instead, this would be something along the lines of > (moving ‘string-append’ from the host side to the build side): > > (define (syslog-rotation-config file) > #~(string-append #$file " {\n" … > #$coreutils "/bin/kill -HUP …" > "}\n")) > > and: > > (define %default-rotations > `(("weekly" ,(computed-file "rottlog.weekly" > #~(call-with-output-file #$output > (lambda (port) > (display #$(syslog-rotation-file …) > port))))))) > HTH! Yes, that helps a lot. Attached a working version...I still feel like fighting a bit with #~ and '#$...IWBN to get rid of `(apply append '#$(map', usually append-map works for that, but the gexp boundary seems a bit too tricksy for me here. > Thanks again for taking the time and coping with half-baked advice! Rotating my logs for quite some time already here, and learning quite a bit about guix and scheme in the process too ;-) Thanks! Greetings, Jan