{ options , lib , config , pkgs , modulesPath }: let cfg = config.services.devalloc-host; in { options.services.devalloc-host = { enable = lib.mkEnableOption "Enable the devalloc-host service"; port = lib.mkOption { type = lib.types.int; default = 3000; description = '' The port on which devalloc-host will listen for incoming HTTP traffic. ''; }; package = lib.mkOption { type = lib.types.package; description = "devalloc-host package to use"; }; }; config = lib.mkIf cfg.enable { systemd.services.devalloc-host = { path = [ cfg.package ]; wantedBy = [ "multi-user.target" ]; script = '' ${cfg.package}/bin/devalloc-host ''; description = '' Devalloc.Host ''; serviceConfig = { Environment = ["PORT=${toString cfg.port}"]; KillSignal = "INT"; Type = "simple"; Restart = "on-abort"; RestartSec = "1"; }; }; }; }