bruh
This commit is contained in:
46
modules/nixos/homeassistant/services/govee2mqtt/default.nix
Normal file
46
modules/nixos/homeassistant/services/govee2mqtt/default.nix
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.${namespace}.services.home-assistant;
|
||||
in
|
||||
{
|
||||
config = mkIf cfg.enable {
|
||||
sops = {
|
||||
secrets = {
|
||||
"jallen-nas/govee2mqtt/govee-email" = {
|
||||
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml");
|
||||
};
|
||||
"jallen-nas/govee2mqtt/govee-password" = {
|
||||
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml");
|
||||
};
|
||||
"jallen-nas/govee2mqtt/govee-api" = {
|
||||
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml");
|
||||
};
|
||||
};
|
||||
templates = {
|
||||
"govee2mqtt.env" = {
|
||||
mode = "660";
|
||||
restartUnits = [ "govee2mqtt.service" ];
|
||||
content = ''
|
||||
GOVEE_EMAIL=${config.sops.placeholder."jallen-nas/govee2mqtt/govee-email"}
|
||||
GOVEE_PASSWORD=${config.sops.placeholder."jallen-nas/govee2mqtt/govee-password"}
|
||||
GOVEE_API_KEY=${config.sops.placeholder."jallen-nas/govee2mqtt/govee-api"}
|
||||
GOVEE_MQTT_HOST=localhost
|
||||
GOVEE_MQTT_PORT=1883
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
services = {
|
||||
govee2mqtt = {
|
||||
enable = true;
|
||||
environmentFile = config.sops.templates."govee2mqtt.env".path;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -11,19 +11,19 @@ let
|
||||
cfg = config.${namespace}.services.home-assistant;
|
||||
in
|
||||
{
|
||||
disabledModules = [
|
||||
"services/home-automation/home-assistant.nix"
|
||||
];
|
||||
# disabledModules = [
|
||||
# "services/home-automation/home-assistant.nix"
|
||||
# ];
|
||||
|
||||
imports = [
|
||||
"${inputs.nixpkgs-unstable}/nixos/modules/services/home-automation/home-assistant.nix"
|
||||
];
|
||||
# imports = [
|
||||
# "${inputs.nixpkgs-unstable}/nixos/modules/services/home-automation/home-assistant.nix"
|
||||
# ];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
services.home-assistant = {
|
||||
enable = true;
|
||||
package = pkgs.unstable.home-assistant;
|
||||
package = pkgs.home-assistant;
|
||||
openFirewall = true;
|
||||
configDir = "/var/lib/homeassistant";
|
||||
configWritable = true; # todo
|
||||
@@ -252,6 +252,7 @@ in
|
||||
ha-bambulab
|
||||
ha-bedjet
|
||||
ha-gehome
|
||||
# ha-govee
|
||||
ha-icloud3
|
||||
ha-local-llm
|
||||
ha-mail-and-packages
|
||||
|
||||
Reference in New Issue
Block a user