1 { config, pkgs, lib, ... }:
3 cfg = config.services.leaps;
4 stateDir = "/var/lib/leaps/";
9 enable = lib.mkEnableOption "leaps, a pair programming service";
11 type = lib.types.port;
13 description = "A port where leaps listens for incoming http requests";
15 address = lib.mkOption {
18 example = "127.0.0.1";
19 description = "Hostname or IP-address to listen to. By default it will listen on all interfaces.";
23 type = lib.types.path;
24 description = "Subdirectory used for reverse proxy setups";
29 config = lib.mkIf cfg.enable {
32 uid = config.ids.uids.leaps;
33 description = "Leaps server user";
40 gid = config.ids.gids.leaps;
44 systemd.services.leaps = {
45 description = "leaps service";
46 wantedBy = [ "multi-user.target" ];
47 after = [ "network.target" ];
52 Restart = "on-failure";
53 WorkingDirectory = stateDir;
55 ExecStart = "${pkgs.leaps}/bin/leaps -path ${toString cfg.path} -address ${cfg.address}:${toString cfg.port}";