nixos-config/machines/frigate/configuration.nix

96 lines
1.7 KiB
Nix
Raw Normal View History

2024-08-14 14:33:32 +02:00
{
self,
nixos-hardware,
caddy-with-plugins,
...
}:
{ pkgs, modulesPath, ... }:
2024-02-05 11:46:52 +01:00
{
2023-03-21 17:20:22 +01:00
imports = [
(modulesPath + "/virtualisation/lxc-container.nix")
nixos-hardware.nixosModules.common-cpu-intel
2023-03-21 17:20:22 +01:00
../../users/root
../../users/erwin
./frigate
2023-03-21 17:20:22 +01:00
];
eboskma = {
2023-04-09 23:20:58 +02:00
users.erwin = {
enable = true;
server = true;
};
2023-03-21 17:20:22 +01:00
nix-common = {
enable = true;
remote-builders = true;
};
podman.enable = true;
tailscale.enable = true;
2024-08-14 14:33:32 +02:00
caddy-proxy = {
enable = true;
package = caddy-with-plugins.packages.${pkgs.system}.caddy-with-cloudflare;
proxyHosts = [
{
externalHostname = "frigate.datarift.nl";
proxyAddress = "localhost:8971";
}
];
};
2023-03-21 17:20:22 +01:00
};
time.timeZone = "Europe/Amsterdam";
system.configurationRevision = self.inputs.nixpkgs.lib.mkIf (self ? rev) self.rev;
networking = {
hostName = "frigate";
useDHCP = false;
useHostResolvConf = false;
networkmanager.enable = false;
useNetworkd = true;
# nftables.enable = true;
2023-03-21 17:20:22 +01:00
firewall.trustedInterfaces = [ "tailscale0" ];
2023-03-21 17:20:22 +01:00
};
systemd.network = {
enable = true;
wait-online.anyInterface = true;
networks = {
"40-eth0" = {
matchConfig = {
Name = "eth0";
};
2023-03-21 17:20:22 +01:00
networkConfig = {
Address = "10.0.0.205/24";
Gateway = "10.0.0.1";
DNS = "10.0.0.206";
DHCP = "no";
};
};
};
};
security = {
sudo-rs = {
enable = true;
execWheelOnly = true;
wheelNeedsPassword = false;
};
sudo.enable = false;
};
2023-03-21 17:20:22 +01:00
sops.defaultSopsFile = ./secrets.yaml;
sops.secrets = {
frigate = { };
2024-08-14 14:33:32 +02:00
caddy-env = { };
2023-03-21 17:20:22 +01:00
};
system.stateVersion = "24.05";
2023-03-21 17:20:22 +01:00
}