nix: add package option to module

This commit is contained in:
eyjhb 2025-08-22 13:25:14 +02:00
parent ce83821e8a
commit a68a46419e
No known key found for this signature in database
GPG Key ID: 609F508E3239F920

View File

@ -131,6 +131,7 @@
{
options.services.drasl = {
enable = mkEnableOption (lib.mdDoc ''drasl'');
package = mkPackageOption { drasl = self.defaultPackage.${pkgs.system}; } "drasl" {};
settings = mkOption {
type = format.type;
default = { };
@ -154,11 +155,10 @@
serviceConfig =
let
pkg = self.defaultPackage.${pkgs.system};
config = format.generate "config.toml" cfg.settings;
in
{
ExecStart = "${pkg}/bin/drasl -config ${config}";
ExecStart = "${cfg.package}/bin/drasl -config ${config}";
DynamicUser = true;
StateDirectory = "drasl";
Restart = "always";