From 0328496a14be97bac8c91394f7b8f63fef06b394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sun, 28 Aug 2022 08:28:54 +0100 Subject: [PATCH] add home assistant --- nixos/boxes/bolty/default.nix | 8 +------- nixos/boxes/bolty/home-assistant.nix | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 nixos/boxes/bolty/home-assistant.nix diff --git a/nixos/boxes/bolty/default.nix b/nixos/boxes/bolty/default.nix index 4eef2ef3..7c28c483 100644 --- a/nixos/boxes/bolty/default.nix +++ b/nixos/boxes/bolty/default.nix @@ -7,14 +7,8 @@ ./nextcloud.nix ./print-server.nix ./restic-server.nix + ./home-assistant.nix ]; - services.syncthing = { - enable = true; - dataDir = "/data/syncthing"; - openDefaultPorts = true; - package = - inputs.nixpkgs-nixos-unstable.legacyPackages."x86_64-linux".syncthing; - }; boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; networking = { hostName = "bolty"; diff --git a/nixos/boxes/bolty/home-assistant.nix b/nixos/boxes/bolty/home-assistant.nix new file mode 100644 index 00000000..0eeec5fe --- /dev/null +++ b/nixos/boxes/bolty/home-assistant.nix @@ -0,0 +1,14 @@ +{ config, pkgs, inputs, lib, ... }: { + imports = [ ]; + + virtualisation.oci-containers = { + backend = "podman"; + containers.homeassistant = { + volumes = [ "home-assistant:/config" ]; + environment.TZ = "Europe/London"; + image = + "ghcr.io/home-assistant/home-assistant:stable"; # Warning: if the tag does not change, the image will not be updated + extraOptions = [ "--network=host" ]; + }; + }; +}