diff options
Diffstat (limited to 'nix')
| -rw-r--r-- | nix/module.nix | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/nix/module.nix b/nix/module.nix index 0dff2d0..e615561 100644 --- a/nix/module.nix +++ b/nix/module.nix @@ -5,9 +5,21 @@ ... }: let cfg = config.services.guzzle-api; - inherit (lib) mkDefault mkEnableOption mkIf; + inherit (lib) mkDefault mkEnableOption mkOption mkIf types; in { - options.services.guzzle-api.enable = mkEnableOption "enable guzzle-api"; + options.services.guzzle-api = { + enable = mkEnableOption "enable guzzle-api"; + url = mkOption { + type = types.string; + default = ""; + description = "url string for guzzle-api"; + }; + port = mkOption { + type = types.int; + default = 8080; + description = "port for guzzle-api"; + }; + }; config.systemd.services.guzzle-api = mkIf cfg.enable { guzzle-api = { @@ -16,7 +28,7 @@ in { wantedBy = ["multi-user.target"]; after = ["network.target"]; script = '' - ${pkgs.guzzle-api-server} --host 0.0.0.0 --port 8000 + URL=${cfg.url} ${pkgs.guzzle-api-server} --host 0.0.0.0 --port "${cfg.port}" ''; serviceConfig = mkDefault { Restart = "always"; |
