diff options
| author | lassulus <lass@aidsballs.de> | 2015-07-27 10:09:13 +0200 |
|---|---|---|
| committer | lassulus <lass@aidsballs.de> | 2015-07-27 10:09:13 +0200 |
| commit | bfc33453e972d643a5f78187812add30550c8f3f (patch) | |
| tree | f2c86d609106856ef92c605dc11da222132d1aaa /3modules/tv/nginx.nix | |
| parent | 09031485dcea56d5207f7c668c5cec6830a588d5 (diff) | |
| parent | dc9b0d7ce100c1286353e1ce3a8b11c42e48738d (diff) | |
Merge branch 'tv' into master
Diffstat (limited to '3modules/tv/nginx.nix')
| -rw-r--r-- | 3modules/tv/nginx.nix | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/3modules/tv/nginx.nix b/3modules/tv/nginx.nix deleted file mode 100644 index a58c495..0000000 --- a/3modules/tv/nginx.nix +++ /dev/null @@ -1,71 +0,0 @@ -{ config, pkgs, lib, ... }: - -with builtins; -with lib; -let - cfg = config.tv.nginx; - - out = { - options.tv.nginx = api; - config = mkIf cfg.enable imp; - }; - - api = { - enable = mkEnableOption "tv.nginx"; - - servers = mkOption { - type = with types; attrsOf optionSet; - options = singleton { - server-names = mkOption { - type = with types; listOf str; - default = [ - "${config.networking.hostName}" - "${config.networking.hostName}.retiolum" - ]; - }; - locations = mkOption { - type = with types; listOf (attrsOf str); - }; - }; - default = {}; - }; - }; - - imp = { - services.nginx = { - enable = true; - httpConfig = '' - include ${pkgs.nginx}/conf/mime.types; - default_type application/octet-stream; - sendfile on; - keepalive_timeout 65; - gzip on; - server { - listen 80 default_server; - server_name _; - return 404; - } - ${concatStrings (mapAttrsToList (_: to-server) cfg.servers)} - ''; - }; - }; - - - indent = replaceChars ["\n"] ["\n "]; - - to-location = { name, value }: '' - location ${name} { - ${indent value} - } - ''; - - to-server = { server-names, locations, ... }: '' - server { - listen 80; - server_name ${toString server-names}; - ${indent (concatStrings (map to-location locations))} - } - ''; - -in -out |
