added homeassistant container

This commit is contained in:
willifan 2024-08-24 17:21:07 +02:00
parent 8c5df332c5
commit d05d19a10e
3 changed files with 53 additions and 1 deletions

View file

@ -9,6 +9,7 @@
./firewall.nix ./firewall.nix
./gitea.nix ./gitea.nix
./hardware-configuration.nix ./hardware-configuration.nix
./homeassistant.nix
./invidious.nix ./invidious.nix
./minecraft.nix ./minecraft.nix
./radicale.nix ./radicale.nix

View file

@ -2,7 +2,7 @@
{ {
networking.firewall = { networking.firewall = {
enable = true; enable = true;
allowedTCPPorts = [ 22 80 443 3000 3001 8384 ]; allowedTCPPorts = [ 22 80 443 3000 3001 8123 8384 ];
allowedUDPPorts = [ 22 80 443 ]; allowedUDPPorts = [ 22 80 443 ];
}; };
} }

View file

@ -0,0 +1,51 @@
# Auto-generated using compose2nix v0.2.3-pre.
{ pkgs, lib, ... }:
{
# Runtime
virtualisation.podman = {
enable = true;
autoPrune.enable = true;
dockerCompat = true;
defaultNetwork.settings = {
# Required for container networking to be able to use names.
dns_enabled = true;
};
};
virtualisation.oci-containers.backend = "podman";
# Containers
virtualisation.oci-containers.containers."homeassistant" = {
environment.TZ = "Europe/Berlin";
image = "ghcr.io/home-assistant/home-assistant:stable";
volumes = [
"/mnt/data/services/homeassistant/config:/config"
];
log-driver = "journald";
extraOptions = [
"--network=host"
"--privileged"
];
};
systemd.services."podman-homeassistant" = {
serviceConfig = {
Restart = lib.mkOverride 500 "always";
};
partOf = [
"podman-compose-homeassistant-root.target"
];
wantedBy = [
"podman-compose-homeassistant-root.target"
];
};
# Root service
# When started, this will automatically create all resources and start
# the containers. When stopped, this will teardown all resources.
systemd.targets."podman-compose-homeassistant-root" = {
unitConfig = {
Description = "Root target generated by compose2nix.";
};
wantedBy = [ "multi-user.target" ];
};
}