From 34cd2c1402cf4b69ce48904c85fbb09521bce751 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 13 Jul 2015 17:48:58 +0200 Subject: 3 tv.urlwatch: normalize (use out attribute) --- 3modules/tv/urlwatch.nix | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to '3modules/tv/urlwatch.nix') diff --git a/3modules/tv/urlwatch.nix b/3modules/tv/urlwatch.nix index aed247852..05a0b0faf 100644 --- a/3modules/tv/urlwatch.nix +++ b/3modules/tv/urlwatch.nix @@ -10,6 +10,12 @@ with lib; let cfg = config.tv.urlwatch; + # TODO assert sendmail's existence + out = { + options.tv.urlwatch = api; + config = mkIf cfg.enable imp; + }; + api = { enable = mkEnableOption "tv.urlwatch"; @@ -57,7 +63,7 @@ let urlsFile = toFile "urls" (concatStringsSep "\n" cfg.urls); - impl = { + imp = { systemd.timers.urlwatch = { wantedBy = [ "timers.target" ]; timerConfig = { @@ -131,18 +137,4 @@ let }; in - -{ - # TODO - #imports = [ - # ./exim - #]; - #config = mkIf cfg.enable - # (if config.tv.exim.enable - # then impl - # else throw "tv.exim must be enabled when enabling tv.urlwatch"); - - options.tv.urlwatch = api; - - config = impl; -} +out -- cgit v1.2.3