mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-25 09:36:14 +01:00
Add new store path variable to home assistant
Signed-off-by: Magic_RB <magic_rb@redalder.org>
This commit is contained in:
parent
c177ed0be9
commit
58641c2cc4
|
@ -1,4 +1,4 @@
|
|||
{ elib, vars, ... }:
|
||||
{ elib, vars, config', ... }:
|
||||
let
|
||||
inherit (elib)
|
||||
nfsVolume
|
||||
|
@ -74,6 +74,12 @@ in
|
|||
vars = {
|
||||
flake_ref = "${vars.flake_host}?rev=${vars.flake_rev}&ref=${vars.flake_ref}";
|
||||
flake_sha = vars.flake_sha;
|
||||
store_path = builtins.toJSON (builtins.mapAttrs (_: builtins.unsafeDiscardStringContext) {
|
||||
mosquitto = config'.flake.nixngConfigurations.mosquitto.config.system.build.toplevel;
|
||||
postgresql = config'.flake.nixngConfigurations.homeAssistantPostgresql.config.system.build.toplevel;
|
||||
homeAssistant = config'.flake.nixngConfigurations.homeAssistant.config.system.build.toplevel;
|
||||
zigbee2mqtt = config'.flake.nixngConfigurations.zigbee2mqtt.config.system.build.toplevel;
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -6,6 +6,15 @@ variable "flake_sha" {
|
|||
type = string
|
||||
}
|
||||
|
||||
variable "store_path" {
|
||||
type = object({
|
||||
mosquitto = string
|
||||
postgresql = string
|
||||
homeAssistant = string
|
||||
zigbee2mqtt = string
|
||||
})
|
||||
}
|
||||
|
||||
job "home-assistant" {
|
||||
datacenters = [ "homelab-1" ]
|
||||
type = "service"
|
||||
|
@ -68,6 +77,7 @@ job "home-assistant" {
|
|||
config {
|
||||
nix_flake_ref = "${var.flake_ref}#nixngConfigurations.zigbee2mqtt.config.system.build.toplevel"
|
||||
nix_flake_sha = var.flake_sha
|
||||
nix_flake_store_path = var.store_path.zigbee2mqtt
|
||||
entrypoint = [ "init" ]
|
||||
|
||||
devices = [
|
||||
|
@ -147,6 +157,7 @@ EOF
|
|||
config {
|
||||
nix_flake_ref = "${var.flake_ref}#nixngConfigurations.mosquitto.config.system.build.toplevel"
|
||||
nix_flake_sha = var.flake_sha
|
||||
nix_flake_store_path = var.store_path.mosquitto
|
||||
entrypoint = [ "init" ]
|
||||
}
|
||||
|
||||
|
@ -244,6 +255,7 @@ EOF
|
|||
config {
|
||||
nix_flake_ref = "${var.flake_ref}#nixngConfigurations.homeAssistantPostgresql.config.system.build.toplevel"
|
||||
nix_flake_sha = var.flake_sha
|
||||
nix_flake_store_path = var.store_path.postgresql
|
||||
entrypoint = [ "init" ]
|
||||
}
|
||||
|
||||
|
@ -275,6 +287,7 @@ EOF
|
|||
config {
|
||||
nix_flake_ref = "${var.flake_ref}#nixngConfigurations.homeAssistant.config.system.build.toplevel"
|
||||
nix_flake_sha = var.flake_sha
|
||||
nix_flake_store_path = var.store_path.homeAssistant
|
||||
entrypoint = [ "init" ]
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue