2 ms·
NixOS needs to handle generating the config to make service configurations composable. If you don't want that, you might as well write your own systemd unit. T
by jbboehr 4y ago
NixOS needs to handle generating the config to make service configurations composable. If you don't want that, you might as well write your own systemd unit.
That being said, most services have an option to use verbatim configuration files[0] or fragments[1][2][3].
[0]: https://search.nixos.org/options?show=services.yggdrasil.configFile https://search.nixos.org/options?show=services.yggdrasil.con...
[1]: https://search.nixos.org/options?show=services.nginx.config https://search.nixos.org/options?show=services.nginx.config
[2]: https://search.nixos.org/options?show=services.bind.extraConfig https://search.nixos.org/options?show=services.bind.extraCon...
[3]: https://search.nixos.org/options?show=services.nginx.appendConfig https://search.nixos.org/options?show=services.nginx.appendC...
- pxc 4y ago> If you don't want that, you might as well write your own systemd unit. This might sound glib, but it's a great idea for a simple workaround for users who want to use some other system to template their config files. Wouldn't take much boilerplate at all.
- jbboehr 4y agoI was dead serious :) Although it seems nginx is bit complicated[0], in general, it's fairly easy to set up new systemd services. [0]: https://github.com/NixOS/nixpkgs/blob/nixos-22.11/nixos/modules/services/web-servers/nginx/default.nix#L883-L953 https://github.com/NixOS/nixpkgs/blob/nixos-22.11/nixos/modu...