diff --git a/nixos/access/kitchencam.nix b/nixos/access/kitchencam.nix index b413e9e0..ebce44d2 100644 --- a/nixos/access/kitchencam.nix +++ b/nixos/access/kitchencam.nix @@ -50,8 +50,8 @@ in { }; }; virtualHosts = let - printerCams = [ 2 ]; - kitchenCams = [ 1 3 ]; + printerCams = [2]; + kitchenCams = [1 3]; mkSubFilter = port: path: '' sub_filter '${port.protocol}://$host:${toString port.port}/' '${path}'; ''; @@ -79,35 +79,37 @@ in { streamLocations = map (mkStreamLocation upstreamNamePrinter) printerCams ++ map (mkStreamLocation upstreamNameKitchen) kitchenCams; - locations = { - "/" = { - return = "302 /kitchen/"; - }; - "/kitchen" = { - proxy = { - enable = true; - upstream = mkDefault upstreamNameKitchen; - path = "/"; + locations = + { + "/" = { + return = "302 /kitchen/"; }; - extraConfig = subFilterConfig "/kitchen/"; - }; - "/printer" = { - proxy = { - enable = true; - upstream = mkDefault upstreamNamePrinter; - path = "/"; + "/kitchen" = { + proxy = { + enable = true; + upstream = mkDefault upstreamNameKitchen; + path = "/"; + }; + extraConfig = subFilterConfig "/kitchen/"; }; - extraConfig = subFilterConfig "/printer/"; - }; - "~ ^/(stream|motion|substream|current|source|cameras\\.json|status\\.json)$" = { - proxy = { - enable = true; - upstream = mkDefault "${upstreamNameKitchen}'stream"; - path = ""; + "/printer" = { + proxy = { + enable = true; + upstream = mkDefault upstreamNamePrinter; + path = "/"; + }; + extraConfig = subFilterConfig "/printer/"; }; - extraConfig = streamConfig; - }; - } // mergeAttrsList streamLocations; + "~ ^/(stream|motion|substream|current|source|cameras\\.json|status\\.json)$" = { + proxy = { + enable = true; + upstream = mkDefault "${upstreamNameKitchen}'stream"; + path = ""; + }; + extraConfig = streamConfig; + }; + } + // mergeAttrsList streamLocations; listen' = { http = {}; https.ssl = true; @@ -130,9 +132,15 @@ in { locations = mapAttrs (name: location: location // { - ${if location ? proxy then "proxy" else null} = location.proxy // (mapDefaults { - inherit (nginx.virtualHosts.kitchencam.locations.${name}.proxy) upstream path; - }); + ${ + if location ? proxy + then "proxy" + else null + } = + location.proxy + // (mapDefaults { + inherit (nginx.virtualHosts.kitchencam.locations.${name}.proxy) upstream path; + }); }) locations; }; diff --git a/nixos/unifi.nix b/nixos/unifi.nix index ba62e650..157b83aa 100644 --- a/nixos/unifi.nix +++ b/nixos/unifi.nix @@ -41,12 +41,13 @@ in { }; systemd.services.unifi = let restartConfig = { - restartTriggers = mkForce [ ]; + restartTriggers = mkForce []; restartIfChanged = false; }; conf.gensokyo-zone.sharedMounts.unifi.path = mkDefault "/var/lib/unifi"; - in mkIf cfg.enable (mkMerge [ - conf - (mkIf delayRestart restartConfig) - ]); + in + mkIf cfg.enable (mkMerge [ + conf + (mkIf delayRestart restartConfig) + ]); }