From 5f5aa3234148b6e12f946479cbbdec3eaf4d53b7 Mon Sep 17 00:00:00 2001 From: Stephan Maka Date: Mon, 13 May 2019 16:23:48 +0200 Subject: [PATCH] nixbld: move services.redis into notifico/nixos-module --- nixbld-etc-nixos/configuration.nix | 5 ----- nixbld-etc-nixos/notifico/nixos-module.nix | 10 ++++++++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/nixbld-etc-nixos/configuration.nix b/nixbld-etc-nixos/configuration.nix index 236cd8f..af6eba9 100644 --- a/nixbld-etc-nixos/configuration.nix +++ b/nixbld-etc-nixos/configuration.nix @@ -255,11 +255,6 @@ ACTION=="add", SUBSYSTEM=="tty", \ enable = true; config = "/etc/nixos/secret/notifico.py"; }; - # Required by notifico - services.redis = { - enable = true; - bind = "127.0.0.1"; - }; # This value determines the NixOS release with which your system is to be # compatible, in order to avoid breaking some software such as database diff --git a/nixbld-etc-nixos/notifico/nixos-module.nix b/nixbld-etc-nixos/notifico/nixos-module.nix index 361ee73..535450d 100644 --- a/nixbld-etc-nixos/notifico/nixos-module.nix +++ b/nixbld-etc-nixos/notifico/nixos-module.nix @@ -22,6 +22,11 @@ in default = false; description = "Enable the commit notification service"; }; + enableLocalRedis = mkOption { + type = types.bool; + default = true; + description = "Enable a local Redis server"; + }; dbDir = mkOption { type = types.str; default = "/var/db/notifico"; @@ -41,6 +46,11 @@ in }; users.groups.notifico = {}; + services.redis = mkIf cfg.enableLocalRedis { + enable = true; + bind = "127.0.0.1"; + }; + systemd.services = let User = "notifico";