Urgent.News

One page, thousands of outlets. See who else covered it.

Editions

Tech

Build-time systemd schedule

The System and Service Manager, systemd, is the default for Linux systems on NixOS, though there are alternative options like finix and sixos. It is a constant in the toolkit for someone like the author, who self-hosts various services on NixOS servers. When the author performed upgrades and maintenance on a server running Immich, they wanted to check the current job schedule to ensure it was configured correctly in their timezone.

As the number of jobs grows, it becomes increasingly difficult to keep track. However, the information is available in the NixOS configuration from the build time, not just the runtime. The author created a Mermaid flow diagram to visualize each server's schedule using a Python script that fetches the core information from the NixOS configuration.

The script evaluates the data in a specific order and defaults to UTC if both values are absent. Multiple timezones can be set individually on each service unit, but this feature is not currently needed. Another useful tool is generating a diagram of systemd dependencies, which can help quickly analyze specific units instead of all of them.

The author discovered that all of this information is available in the NixOS configuration blueprint, allowing for build-time checks instead of runtime checks. This revelation made the author appreciate NixOS even more and learn new things while enjoying the process of running these servers.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at gvolpe.com →

More in Tech

More from Monday 17 August →