Add podman and home assistant
This commit is contained in:
parent
8d1ad43eea
commit
261fea477e
1 changed files with 41 additions and 0 deletions
|
|
@ -154,6 +154,46 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Container virtualization with Podman
|
||||||
|
virtualisation = {
|
||||||
|
podman = {
|
||||||
|
enable = true;
|
||||||
|
# Create a `docker` alias for podman, to use it as a drop-in replacement
|
||||||
|
dockerCompat = true;
|
||||||
|
# Required for containers under podman-compose to be able to talk to each other
|
||||||
|
defaultNetwork.settings.dns_enabled = true;
|
||||||
|
# Create macvlan network for Home Assistant
|
||||||
|
extraPackages = [ pkgs.netavark pkgs.aardvark-dns ];
|
||||||
|
};
|
||||||
|
# Enable OCI container support
|
||||||
|
oci-containers = {
|
||||||
|
backend = "podman";
|
||||||
|
|
||||||
|
containers.homeassistant = {
|
||||||
|
image = "ghcr.io/home-assistant/home-assistant:stable";
|
||||||
|
|
||||||
|
volumes = [
|
||||||
|
"/home/yanlin/deploy/data/home/config:/config"
|
||||||
|
"/etc/localtime:/etc/localtime:ro"
|
||||||
|
"/run/dbus:/run/dbus:ro"
|
||||||
|
];
|
||||||
|
|
||||||
|
environment = {
|
||||||
|
TZ = "Europe/Copenhagen";
|
||||||
|
};
|
||||||
|
|
||||||
|
extraOptions = [
|
||||||
|
"--privileged" # Required for USB device access
|
||||||
|
"--network=host" # Use host networking
|
||||||
|
"--device=/dev/ttyUSB0:/dev/ttyUSB0" # Sky Connect Zigbee dongle
|
||||||
|
"--device=/dev/dri:/dev/dri" # Hardware acceleration
|
||||||
|
];
|
||||||
|
|
||||||
|
autoStart = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# SnapRAID configuration for parity protection
|
# SnapRAID configuration for parity protection
|
||||||
services.snapraid = {
|
services.snapraid = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
@ -201,6 +241,7 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
# Enable smartd for disk health monitoring
|
# Enable smartd for disk health monitoring
|
||||||
services.smartd = {
|
services.smartd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue