juspay / services-flake

NixOS-like services for Nix flakes
https://community.flake.parts/services-flake
MIT License
299 stars 28 forks source link

Question: How to use `systemd.service` ? #239

Open usmcamp0811 opened 1 month ago

usmcamp0811 commented 1 month ago

Has anyone thought of a good way to share the same code that creates a systemd.service in a NixOS system configuration with a service in a flake? I want to have a NixOS system configuration with many services running across all the systems I manage. Additionally, I want to create a process-compose package in my system flake that can set up a development environment with the exact same services.

One idea I had was to rework my services into writeShellApplication scripts that get executed by the systemd.service. However, this seems laborious and there might be a better way to achieve this.

shivaraj-bh commented 1 month ago

One idea is to export homeModules with systemd and launchd configurations and these can be imported and activated using home-manager in your configuration.

srid commented 2 weeks ago

Relevant? https://github.com/NixOS/nixpkgs/pull/267111

cc @roberth