From d7f6929e2d7040b36d7ce6016aaa1776cbafd4c9 Mon Sep 17 00:00:00 2001 From: Ahwx Date: Sat, 19 Apr 2025 00:13:35 +0200 Subject: [PATCH 1/5] feat: adds home-assistant to dandelion --- modules/services/dandelion.nix | 12 +++++++----- modules/services/home-assistant.nix | 16 ++++++++++++++++ 2 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 modules/services/home-assistant.nix diff --git a/modules/services/dandelion.nix b/modules/services/dandelion.nix index 2383c3d..e048365 100644 --- a/modules/services/dandelion.nix +++ b/modules/services/dandelion.nix @@ -1,7 +1,9 @@ -{ ... }: { +{ ... }: +{ imports = - [(import ./docker.nix)] - ++ [(import ./immich.nix)] - ++ [(import ./nextcloud.nix)] - ++ [(import ./scrutiny.nix)]; + [ (import ./docker.nix) ] + ++ [ (import ./immich.nix) ] + ++ [ (import ./nextcloud.nix) ] + ++ [ (import ./home-assistant.nix) ] + ++ [ (import ./scrutiny.nix) ]; } diff --git a/modules/services/home-assistant.nix b/modules/services/home-assistant.nix new file mode 100644 index 0000000..d978f91 --- /dev/null +++ b/modules/services/home-assistant.nix @@ -0,0 +1,16 @@ +{ + services.home-assistant = { + enable = true; + extraComponents = [ + # Components required to complete the onboarding + "esphome" + "met" + "radio_browser" + ]; + config = { + # Includes dependencies for a basic setup + # https://www.home-assistant.io/integrations/default_config/ + default_config = { }; + }; + }; +} From 6e989f6d29ad0e4550860bbaa559103ff0357f42 Mon Sep 17 00:00:00 2001 From: Ahwx Date: Sun, 20 Apr 2025 19:50:11 +0200 Subject: [PATCH 2/5] fix: idc about variables anymore (they didn't work) --- modules/services/scrutiny.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/services/scrutiny.nix b/modules/services/scrutiny.nix index d249682..78c0e04 100644 --- a/modules/services/scrutiny.nix +++ b/modules/services/scrutiny.nix @@ -1,10 +1,12 @@ -{ config, ... }: { +{ config, ... }: +{ services.scrutiny = { enable = true; collector.enable = true; settings.web.listen.port = 8181; settings.notify.urls = [ - "ntfy://${config.liv.variables.ntfyURL}/${config.networking.hostName}" + # "ntfy://${config.liv.variables.ntfyURL}/${config.networking.hostName}" + "ntfy://notify.liv.town/${config.networking.hostName}" ]; }; From 75d23f5ca980de186599090b14a9ea110fe0217e Mon Sep 17 00:00:00 2001 From: Ahwx Date: Sun, 20 Apr 2025 19:50:39 +0200 Subject: [PATCH 3/5] chore: disable nextcloud as it doesn't work yet since, well, no domain yet --- modules/services/nextcloud.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/services/nextcloud.nix b/modules/services/nextcloud.nix index 9c3edc2..62c7877 100644 --- a/modules/services/nextcloud.nix +++ b/modules/services/nextcloud.nix @@ -1,6 +1,7 @@ -{ ... }: { +{ ... }: +{ services.nextcloud = { - enable = true; + enable = false; config.dbtype = "sqlite"; configureRedis = true; home = "/home/liv/nextcloud"; From ec6119f46cb55a513da40061e2c1acbb78046c95 Mon Sep 17 00:00:00 2001 From: Ahwx Date: Tue, 22 Apr 2025 19:49:03 +0200 Subject: [PATCH 4/5] feat: moves home-assistant to docker since otherwise it wouldn't work :p --- modules/services/home-assistant.nix | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/modules/services/home-assistant.nix b/modules/services/home-assistant.nix index d978f91..e5d1991 100644 --- a/modules/services/home-assistant.nix +++ b/modules/services/home-assistant.nix @@ -1,16 +1,15 @@ { - services.home-assistant = { - enable = true; - extraComponents = [ - # Components required to complete the onboarding - "esphome" - "met" - "radio_browser" - ]; - config = { - # Includes dependencies for a basic setup - # https://www.home-assistant.io/integrations/default_config/ - default_config = { }; + networking.firewall.allowedTCPPorts = [ 8123 ]; + virtualisation.oci-containers = { + backend = "docker"; + containers.homeassistant = { + volumes = [ "home-assistant:/config" ]; + environment.TZ = "Europe/Amsterdam"; + image = "ghcr.io/home-assistant/home-assistant:stable"; # Warning: if the tag does not change, the image will not be updated + extraOptions = [ + "--network=host" + # "--device=/dev/ttyACM0:/dev/ttyACM0" # Example, change this to match your own hardware + ]; }; }; } From 0514d04adf75e8b16addf95bbcd24c61eebb5a09 Mon Sep 17 00:00:00 2001 From: Ahwx Date: Tue, 22 Apr 2025 19:49:09 +0200 Subject: [PATCH 5/5] feat: adds vnstat for servers --- roles/server.nix | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/roles/server.nix b/roles/server.nix index 745a573..7eb2f8a 100644 --- a/roles/server.nix +++ b/roles/server.nix @@ -1,8 +1,16 @@ -{ lib, pkgs, config, username, home-manager, ... }: +{ + lib, + pkgs, + config, + username, + home-manager, + ... +}: with lib; let cfg = config.liv.server; -in { +in +{ options.liv.server = { enable = mkEnableOption "Enable server"; }; @@ -12,9 +20,10 @@ in { pkgs.kitty.terminfo powertop ]; - - services = { + + services = { thermald.enable = true; + vnstat.enable = true; # cpupower-gui.enable = true; # power-profiles-daemon.enable = true;