summaryrefslogtreecommitdiff
path: root/ibb/module.nix
blob: b4f7609392159680dde22d594004365956ea007c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ options
, lib
, config
, pkgs
, modulesPath
}:

let
  cfg = config.services.ibb;
in {
   options.services.ibb.enable = lib.mkEnableOption "Enable the IBB service";
   config = lib.mkIf cfg.enable {
     systemd.services.ibb = {
       path = with pkgs; [ ibb bash ];
       wantedBy = [ "multi-user.target" ];
       script = ''
	 ./bin/ibb
       '';
       description = ''
         Influenced By Books website
       '';
       serviceConfig = {
         WorkingDirectory=pkgs.ibb;
         KillSignal="INT";
         Type = "simple";
         Restart = "on-abort";
         RestartSec = "10";
      };
    };
  };
}