Suppose I use nix-env
to install a package that uses SystemD, on a Ubuntu host. What needs to be done to make Ubuntu's SystemD aware of the SystemD modules that come from Nix packages?
Let's try finding the Nix installed .service
files, and symlinking them from /lib/systemd/system/
, for the Apache Kafka package.
nix-env -i apache-kafka
sudo systemctl start apache-kafka # Failed to start apache-kafka.service: Unit apache-kafka.service not found.
sudo updatedb && locate apache-kafka.service # No dice
locate kafka | grep service # Just a bunch of `.nix` files
Here, I'm guessing the service name based on the service configuration's name in the Nix package definition. I haven't been able to find any documentation describing how and where that config becomes a SystemD service file.
When that didn't work, I started really digging around, on the assumption that somewhere, Nix must have created this service file. But now, I am starting to doubt that it exists. So, are SystemD modules installed by the Nix package manager supposed to work outside of NixOS, and if so, how do we make them work?
.service
files instead of.system
files?