From daa67bc3e6f01e2fc6dc6a209ac49515f9cabe06 Mon Sep 17 00:00:00 2001 From: uttarayan21 Date: Wed, 30 Jul 2025 06:58:25 +0530 Subject: [PATCH] feat: Remove older traces of homeassistant --- darwin/shiro/services/homeassistant.nix | 28 ---------------- nixos/tsuba/configuration.nix | 5 +++ nixos/tsuba/services/homeassistant.nix | 44 +------------------------ nixos/tsuba/services/jellyfin.nix | 25 ++++++++++++-- 4 files changed, 28 insertions(+), 74 deletions(-) delete mode 100644 darwin/shiro/services/homeassistant.nix diff --git a/darwin/shiro/services/homeassistant.nix b/darwin/shiro/services/homeassistant.nix deleted file mode 100644 index 5a912340..00000000 --- a/darwin/shiro/services/homeassistant.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ - pkgs, - lib, - ... -}: { - environment.systemPackages = [pkgs.arion pkgs.docker-client]; - virtualisation.docker.enable = lib.mkForce false; - virtualisation.podman.enable = true; - virtualisation.podman.dockerSocket.enable = true; - # users.extraUsers.servius.extraGroups = ["podman"]; - # networking.firewall.allowedTCPPorts = [21063 21064]; - # networking.firewall.allowedUDPPorts = [5353]; - - virtualisation.arion = { - backend = "docker"; - projects = { - homeassistant.settings.services = { - homeassistant = { - service.image = "ghcr.io/home-assistant/home-assistant:stable"; - service.volumes = ["/etc/localtime:/etc/localtime:ro" "/run/dbus:/run/dbus:ro" "/var/lib/homeassistant:/config"]; - service.privileged = true; - service.network_mode = "host"; - service.restart = "unless-stopped"; - }; - }; - }; - }; -} diff --git a/nixos/tsuba/configuration.nix b/nixos/tsuba/configuration.nix index 82b718c2..560eb349 100644 --- a/nixos/tsuba/configuration.nix +++ b/nixos/tsuba/configuration.nix @@ -5,6 +5,11 @@ device, ... }: { + virtualisation.docker.enable = true; + virtualisation.oci-containers.backend = "docker"; + users.extraUsers.servius.extraGroups = ["docker"]; + networking.firewall.enable = false; + nixpkgs.config.allowUnfree = true; security.sudo.wheelNeedsPassword = false; sops = { diff --git a/nixos/tsuba/services/homeassistant.nix b/nixos/tsuba/services/homeassistant.nix index e0e3f72c..1d99448c 100644 --- a/nixos/tsuba/services/homeassistant.nix +++ b/nixos/tsuba/services/homeassistant.nix @@ -4,6 +4,7 @@ ... }: { virtualisation.docker.enable = true; + virtualisation.oci-containers.backend = "docker"; users.extraUsers.servius.extraGroups = ["docker"]; networking.firewall.enable = false; services.caddy = { @@ -12,47 +13,4 @@ reverse_proxy localhost:8123 ''; }; - - # environment.systemPackages = [pkgs.arion pkgs.docker pkgs.podman]; - # virtualisation.podman.enable = true; - # virtualisation.podman.dockerSocket.enable = true; - # # networking.firewall.allowedTCPPorts = [21063 21064]; - # # networking.firewall.allowedUDPPorts = [5353]; - # - # virtualisation.arion = { - # backend = "podman-socket"; - # projects = { - # homeassistant.settings.services = { - # homeassistant = { - # service.image = "ghcr.io/home-assistant/home-assistant:stable"; - # service.volumes = ["/etc/localtime:/etc/localtime:ro" "/run/dbus:/run/dbus:ro" "/var/lib/homeassistant:/config"]; - # service.privileged = true; - # service.network_mode = "host"; - # service.restart = "unless-stopped"; - # }; - # }; - # }; - # }; } -# { -# virtualisation.podman.enable = true; -# virtualisation.podman.dockerSocket.enable = true; -# users.extraUsers.servius.extraGroups = ["podman"]; -# networking.firewall.enable = false; -# virtualisation.oci-containers = { -# backend = "podman"; -# containers.homeassistant = { -# # environment.TZ = "Asia/Kolkata"; -# # Note: The image will not be updated on rebuilds, unless the version label changes -# image = "ghcr.io/home-assistant/home-assistant:stable"; -# volumes = ["/etc/localtime:/etc/localtime:ro" "/run/dbus:/run/dbus:ro" "/var/lib/homeassistant:/config"]; -# extraOptions = [ -# # Use the host network namespace for all sockets -# "--network=host" -# # Pass devices into the container, so Home Assistant can discover and make use of them -# "--device=/dev/ttyACM0:/dev/ttyACM0" -# ]; -# }; -# }; -# } - diff --git a/nixos/tsuba/services/jellyfin.nix b/nixos/tsuba/services/jellyfin.nix index bd41a72f..b1a97cf3 100644 --- a/nixos/tsuba/services/jellyfin.nix +++ b/nixos/tsuba/services/jellyfin.nix @@ -3,14 +3,33 @@ config, ... }: { + virtualisation.oci-containers = { + containers = { + jellyfin = { + image = "jellyfin/jellyfin:latest"; + ports = ["127.0.0.1:8097:8096"]; + volumes = ["/var/lib/jellyfin:/config"]; + user = "jellyfin:jellyfin"; + environment = { + TZ = config.time.timeZone; + }; + }; + }; + }; + users.users.jellyfin = { + isSystemUser = true; + home = "/var/lib/jellyfin"; + createHome = true; + group = "jellyfin"; + }; + users.extraUsers.jellyfin.extraGroups = ["media"]; + users.groups.jellyfin = {}; + services = { jellyseerr = { enable = true; package = unstablePkgs.jellyseerr; }; - jellyfin = { - enable = true; - }; caddy = { virtualHosts."jellyseerr.tsuba.darksailor.dev".extraConfig = '' import hetzner