-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install py_mini_racer befora starting HA for my robot vacuum
- Loading branch information
1 parent
c25687a
commit ab0301f
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ lib, config, self, ... }: | ||
|
||
let | ||
cfg = config.modules.home-assistant; | ||
in | ||
{ | ||
options.modules.home-assistant.volumes = lib.mkOption { | ||
type = lib.types.listOf lib.types.str; | ||
description = "Volumes to mount (needs /config)"; | ||
}; | ||
|
||
options.modules.home-assistant.addDbusVolume = lib.mkOption { | ||
type = lib.types.bool; | ||
description = "D-Bus is optional but required if you plan to use the Bluetooth integration"; | ||
default = true; | ||
}; | ||
|
||
config = { | ||
virtualisation.oci-containers.containers."homeassistant" = { | ||
volumes = cfg.volumes ++ lib.optionals cfg.addDbusVolume [ "/run/dbus:/run/dbus:ro" ] ++ [ (builtins.toString ./. + ":/patches") ]; | ||
environment.TZ = config.time.timeZone; | ||
image = "ghcr.io/home-assistant/home-assistant:stable"; | ||
extraOptions = [ | ||
"--network=host" | ||
"--pull=newer" | ||
]; | ||
entrypoint ="/patches/start.sh"; | ||
}; | ||
|
||
networking.firewall.allowedTCPPorts = [ 8123 ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
pip install py_mini_racer && exec /init |