From 563bf764f0e6705ec0f5b6daf82585b8041e8056 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sun, 17 Feb 2019 14:02:06 -0800 Subject: Move ibb module --- ibb/module.nix | 42 ------------------------------------------ modules/ibb.nix | 42 ++++++++++++++++++++++++++++++++++++++++++ nixos.nix | 2 +- 3 files changed, 43 insertions(+), 43 deletions(-) delete mode 100644 ibb/module.nix create mode 100644 modules/ibb.nix diff --git a/ibb/module.nix b/ibb/module.nix deleted file mode 100644 index e2d4dd0..0000000 --- a/ibb/module.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ 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"; - }; - }; - }; -} diff --git a/modules/ibb.nix b/modules/ibb.nix new file mode 100644 index 0000000..e2d4dd0 --- /dev/null +++ b/modules/ibb.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"; + }; + }; + }; +} diff --git a/nixos.nix b/nixos.nix index deb0419..4a1257e 100644 --- a/nixos.nix +++ b/nixos.nix @@ -14,7 +14,7 @@ import "${nixpkgs}/nixos" { ./configuration.nix # our modules - ./ibb/module.nix + ./modules/ibb.nix # third party (builtins.fetchTarball { -- cgit v1.2.3