-
Notifications
You must be signed in to change notification settings - Fork 846
Add NixOS support #7697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add NixOS support #7697
Conversation
| <Layout NixOS> | ||
| prefix: /opt/trafficserver | ||
| exec_prefix: ${prefix} | ||
| bindir: ${exec_prefix}/bin | ||
| sbindir: ${exec_prefix}/sbin | ||
| libdir: ${exec_prefix}/lib | ||
| libexecdir: ${exec_prefix}/libexec | ||
| infodir: ${prefix}/share/info | ||
| mandir: ${prefix}/share/man | ||
| sysconfdir: /etc+ | ||
| datadir: ${prefix}/share+ | ||
| docdir: ${prefix}/share/doc+ | ||
| installbuilddir: ${datadir}/build | ||
| includedir: ${prefix}/include | ||
| localstatedir: /var/lib+ | ||
| runtimedir: /run+ | ||
| logdir: /var/log+ | ||
| cachedir: /var/cache+ | ||
| </Layout> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About half of these are replaced through configure flags when building with Nix, but I still added them for the sake of consistency.
| if [[ "$INSTALLDIR" = /nix/store* ]]; then | ||
| bail "unsupported option: -i is disabled on Nix" | ||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/nix/store is where packages are installed and is non-writable.
| [Unit] | ||
| Description=Apache Traffic Server is a fast, scalable and extensible caching proxy server. | ||
| After=syslog.target network.target | ||
| After=network.target |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syslog.target is removed from recent versions of systemd.
| export TM_PIDFILE=$(@exp_bindir@/traffic_layout 2>/dev/null | grep RUNTIMEDIR | cut -d: -f2)/manager.lock ; \ | ||
| /bin/rm $TM_PIDFILE ; \ | ||
| if [[ $? -ne 0 ]]; then echo "ERROR: Unable to delete PID"; exit 1; fi' | ||
| PIDFile=@exp_runtimedir@/manager.lock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using PIDFile to clean up PID files is slightly more portable, as some distros don't have /bin/rm.
This PR is part of an attempt to package Traffic Server in Nixpkgs.