diff options
author | tv <tv@krebsco.de> | 2015-07-13 17:48:58 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2015-07-13 17:48:58 +0200 |
commit | 9cdb2dbb7246f90a8663cb31004d121eefe065f2 (patch) | |
tree | 0f406c572220097be8a9a53865450f64c5119fe3 /3modules/tv/urlwatch.nix | |
parent | 5eb2a9be177c685643e63ac5da19dff78e733e46 (diff) |
3 tv.urlwatch: normalize (use out attribute)
Diffstat (limited to '3modules/tv/urlwatch.nix')
-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 aed2478..05a0b0f 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 |