Skip to content

Commit c4fe435

Browse files
Merge pull request #382 from NuschtOS/postgres.target
grafana, home-assistant: add proper postgresql.target dependency, home-assistant: drop no longer required zha ota
2 parents 8367a8d + 577b0f6 commit c4fe435

2 files changed

Lines changed: 19 additions & 9 deletions

File tree

modules/grafana.nix

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,13 @@ in
161161
} ];
162162
};
163163

164+
config.systemd.services = lib.mkIf cfg.configurePostgres {
165+
grafana = {
166+
after = [ "postgresql.target" ];
167+
requires = [ "postgresql.target" ];
168+
};
169+
};
170+
164171
config.users.users = lib.mkIf (cfg.enable && cfg.configureNginx) {
165172
grafana.extraGroups = [ "nginx" ];
166173
};

modules/home-assistant.nix

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,6 @@ in
8585
event_types = [ "call_service" ];
8686
};
8787
};
88-
89-
# see https://github.com/zigpy/zigpy-ota#for-end-users and https://github.com/zigpy/zigpy/pull/1340
90-
# TODO: drop with 26.05
91-
zha.zigpy_config.ota.z2m_remote_index = lib.mkIf (lib.versionAtLeast cfg.package.version "2026.01") "https://raw.githubusercontent.com/Koenkk/zigbee-OTA/master/index.json";
9288
};
9389
})
9490

@@ -181,9 +177,16 @@ in
181177
} ];
182178
};
183179

184-
config.systemd.tmpfiles.rules = lib.mkIf (cfg.enable && cfg.recommendedDefaults) [
185-
"f ${cfg.configDir}/automations.yaml 0444 hass hass"
186-
"f ${cfg.configDir}/scenes.yaml 0444 hass hass"
187-
"f ${cfg.configDir}/scripts.yaml 0444 hass hass"
188-
];
180+
config.systemd = {
181+
services.home-assistant = lib.mkIf (cfg.enable && cfg.configurePostgres) {
182+
after = [ "postgresql.target" ];
183+
requires = [ "postgresql.target" ];
184+
};
185+
186+
tmpfiles.rules = lib.mkIf (cfg.enable && cfg.recommendedDefaults) [
187+
"f ${cfg.configDir}/automations.yaml 0444 hass hass"
188+
"f ${cfg.configDir}/scenes.yaml 0444 hass hass"
189+
"f ${cfg.configDir}/scripts.yaml 0444 hass hass"
190+
];
191+
};
189192
}

0 commit comments

Comments
 (0)