summaryrefslogtreecommitdiff
path: root/com/influencedbybooks.nix
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2019-10-27 09:48:52 -0700
committerBen Sima <ben@bsima.me>2019-10-27 12:14:40 -0700
commitc790672cc244ac4caba1bda3572829a6c6862891 (patch)
tree2706bb8044f7b14840c5f90f215b79b433e81045 /com/influencedbybooks.nix
parent44df4ba39f65c3afd84bee6b03f47d9b061e9038 (diff)
move everything to namespace directories
Diffstat (limited to 'com/influencedbybooks.nix')
-rw-r--r--com/influencedbybooks.nix42
1 files changed, 42 insertions, 0 deletions
diff --git a/com/influencedbybooks.nix b/com/influencedbybooks.nix
new file mode 100644
index 0000000..f9d0f36
--- /dev/null
+++ b/com/influencedbybooks.nix
@@ -0,0 +1,42 @@
+{ options
+, lib
+, config
+, pkgs
+, modulesPath
+}:
+
+let
+ cfg = config.services.ibb;
+in
+{
+ options.services.ibb = {
+ enable = lib.mkEnableOption "Enable the IBB service";
+ port = lib.mkOption {
+ type = lib.types.string;
+ default = "3000";
+ description = ''
+ The port on which IBB will listen for
+ incoming HTTP traffic.
+ '';
+ };
+ };
+ config = lib.mkIf cfg.enable {
+ systemd.services.ibb = {
+ path = with pkgs; [ ibb bash ];
+ wantedBy = [ "multi-user.target" ];
+ script = ''
+ PORT=${cfg.port} ./bin/ibb
+ '';
+ description = ''
+ Influenced By Books website
+ '';
+ serviceConfig = {
+ WorkingDirectory = pkgs.ibb;
+ KillSignal = "INT";
+ Type = "simple";
+ Restart = "on-abort";
+ RestartSec = "10";
+ };
+ };
+ };
+}