diff options
author | tv <tv@shackspace.de> | 2015-07-13 17:48:58 +0200 |
---|---|---|
committer | tv <tv@shackspace.de> | 2015-07-13 17:48:58 +0200 |
commit | 34cd2c1402cf4b69ce48904c85fbb09521bce751 (patch) | |
tree | 0f406c572220097be8a9a53865450f64c5119fe3 | |
parent | 0345c30b1b3c3b01ba5455a7fc6bee338c36052a (diff) |
3 tv.urlwatch: normalize (use out attribute)
-rw-r--r-- | 3modules/tv/urlwatch.nix | 24 |
1 files changed, 8 insertions, 16 deletions
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 |