Compare commits
	
		
			2 Commits
		
	
	
		
			8e288a9e2a
			...
			05074a1fd9
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 05074a1fd9 | |||
| 69060dfbff | 
@@ -13,6 +13,7 @@ in
 | 
				
			|||||||
    assignments = {
 | 
					    assignments = {
 | 
				
			||||||
      hi = {
 | 
					      hi = {
 | 
				
			||||||
        name = "hass-ctr";
 | 
					        name = "hass-ctr";
 | 
				
			||||||
 | 
					        altNames = [ "frigate" ];
 | 
				
			||||||
        inherit domain;
 | 
					        inherit domain;
 | 
				
			||||||
        mtu = hiMTU;
 | 
					        mtu = hiMTU;
 | 
				
			||||||
        ipv4 = {
 | 
					        ipv4 = {
 | 
				
			||||||
@@ -68,7 +69,7 @@ in
 | 
				
			|||||||
          };
 | 
					          };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          firewall = {
 | 
					          firewall = {
 | 
				
			||||||
            tcp.allowed = [ ];
 | 
					            tcp.allowed = [ "http" 1883 ];
 | 
				
			||||||
          };
 | 
					          };
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -87,6 +88,61 @@ in
 | 
				
			|||||||
        };
 | 
					        };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        services = {
 | 
					        services = {
 | 
				
			||||||
 | 
					          mosquitto = {
 | 
				
			||||||
 | 
					            enable = true;
 | 
				
			||||||
 | 
					            listeners = [
 | 
				
			||||||
 | 
					              {
 | 
				
			||||||
 | 
					                omitPasswordAuth = true;
 | 
				
			||||||
 | 
					                settings = {
 | 
				
			||||||
 | 
					                  allow_anonymous = true;
 | 
				
			||||||
 | 
					                };
 | 
				
			||||||
 | 
					              }
 | 
				
			||||||
 | 
					            ];
 | 
				
			||||||
 | 
					          };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					          go2rtc = {
 | 
				
			||||||
 | 
					            enable = true;
 | 
				
			||||||
 | 
					            settings = {
 | 
				
			||||||
 | 
					              streams = {
 | 
				
			||||||
 | 
					                reolink_living_room = [
 | 
				
			||||||
 | 
					                  # "http://reolink-living-room.${domain}/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin#video=copy#audio=copy#audio=opus"
 | 
				
			||||||
 | 
					                  "rtsp://admin:@reolink-living-room:554/h264Preview_01_main"
 | 
				
			||||||
 | 
					                ];
 | 
				
			||||||
 | 
					              };
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					          };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					          frigate = {
 | 
				
			||||||
 | 
					            enable = true;
 | 
				
			||||||
 | 
					            hostname = "frigate.${domain}";
 | 
				
			||||||
 | 
					            settings = {
 | 
				
			||||||
 | 
					              mqtt = {
 | 
				
			||||||
 | 
					                enabled = true;
 | 
				
			||||||
 | 
					                host = "localhost";
 | 
				
			||||||
 | 
					                topic_prefix = "frigate";
 | 
				
			||||||
 | 
					              };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					              cameras = {
 | 
				
			||||||
 | 
					                reolink_living_room = {
 | 
				
			||||||
 | 
					                  ffmpeg.inputs = [
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                      path = "rtsp://127.0.0.1:8554/reolink_living_room";
 | 
				
			||||||
 | 
					                      input_args = "preset-rtsp-restream";
 | 
				
			||||||
 | 
					                      roles = [ "record" "detect" ];
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                  ];
 | 
				
			||||||
 | 
					                  detect = {
 | 
				
			||||||
 | 
					                    enabled = false;
 | 
				
			||||||
 | 
					                  };
 | 
				
			||||||
 | 
					                  record = {
 | 
				
			||||||
 | 
					                    enabled = true;
 | 
				
			||||||
 | 
					                    retain.days = 1;
 | 
				
			||||||
 | 
					                  };
 | 
				
			||||||
 | 
					                };
 | 
				
			||||||
 | 
					              };
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					          };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          home-assistant =
 | 
					          home-assistant =
 | 
				
			||||||
          let
 | 
					          let
 | 
				
			||||||
            cfg = config.services.home-assistant;
 | 
					            cfg = config.services.home-assistant;
 | 
				
			||||||
@@ -120,6 +176,7 @@ in
 | 
				
			|||||||
              "webostv"
 | 
					              "webostv"
 | 
				
			||||||
              "androidtv_remote"
 | 
					              "androidtv_remote"
 | 
				
			||||||
              "heos"
 | 
					              "heos"
 | 
				
			||||||
 | 
					              "mqtt"
 | 
				
			||||||
            ];
 | 
					            ];
 | 
				
			||||||
            extraPackages = python3Packages: with python3Packages; [
 | 
					            extraPackages = python3Packages: with python3Packages; [
 | 
				
			||||||
              zlib-ng
 | 
					              zlib-ng
 | 
				
			||||||
@@ -130,6 +187,7 @@ in
 | 
				
			|||||||
            ];
 | 
					            ];
 | 
				
			||||||
            customComponents = with pkgs.home-assistant-custom-components; [
 | 
					            customComponents = with pkgs.home-assistant-custom-components; [
 | 
				
			||||||
              alarmo
 | 
					              alarmo
 | 
				
			||||||
 | 
					              frigate
 | 
				
			||||||
            ];
 | 
					            ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            configWritable = false;
 | 
					            configWritable = false;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -225,6 +225,8 @@ in
 | 
				
			|||||||
            ups IN A ${net.cidr.host 20 prefixes.lo.v4}
 | 
					            ups IN A ${net.cidr.host 20 prefixes.lo.v4}
 | 
				
			||||||
            palace-kvm IN A ${net.cidr.host 21 prefixes.lo.v4}
 | 
					            palace-kvm IN A ${net.cidr.host 21 prefixes.lo.v4}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            reolink-living-room IN A ${net.cidr.host 45 prefixes.lo.v4}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            ${lib.my.dns.fwdRecords {
 | 
					            ${lib.my.dns.fwdRecords {
 | 
				
			||||||
              inherit allAssignments names;
 | 
					              inherit allAssignments names;
 | 
				
			||||||
              domain = config.networking.domain;
 | 
					              domain = config.networking.domain;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -148,6 +148,16 @@ in
 | 
				
			|||||||
                  hw-address = "b8:7b:d4:95:c6:74";
 | 
					                  hw-address = "b8:7b:d4:95:c6:74";
 | 
				
			||||||
                  ip-address = net.cidr.host 43 prefixes.lo.v4;
 | 
					                  ip-address = net.cidr.host 43 prefixes.lo.v4;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                  # hass-panel
 | 
				
			||||||
 | 
					                  hw-address = "80:30:49:cd:d7:51";
 | 
				
			||||||
 | 
					                  ip-address = net.cidr.host 44 prefixes.lo.v4;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                  # reolink-living-room
 | 
				
			||||||
 | 
					                  hw-address = "ec:71:db:30:69:a4";
 | 
				
			||||||
 | 
					                  ip-address = net.cidr.host 45 prefixes.lo.v4;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
              ];
 | 
					              ];
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
          ];
 | 
					          ];
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -571,6 +571,22 @@ in
 | 
				
			|||||||
          }
 | 
					          }
 | 
				
			||||||
        ];
 | 
					        ];
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
 | 
					      (mkIf config.services.frigate.enable {
 | 
				
			||||||
 | 
					        my.tmproot.persistence.config.directories = [
 | 
				
			||||||
 | 
					          {
 | 
				
			||||||
 | 
					            directory = "/var/lib/frigate";
 | 
				
			||||||
 | 
					            mode = "0755";
 | 
				
			||||||
 | 
					            user = "frigate";
 | 
				
			||||||
 | 
					            group = "frigate";
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					          {
 | 
				
			||||||
 | 
					            directory = "/var/cache/frigate";
 | 
				
			||||||
 | 
					            mode = "0755";
 | 
				
			||||||
 | 
					            user = "frigate";
 | 
				
			||||||
 | 
					            group = "frigate";
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					        ];
 | 
				
			||||||
 | 
					      })
 | 
				
			||||||
    ]))
 | 
					    ]))
 | 
				
			||||||
  ]);
 | 
					  ]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user