diff --git a/nixos/tests/home-assistant.nix b/nixos/tests/home-assistant.nix index e06c52a5f41c..b7deb95b2c19 100644 --- a/nixos/tests/home-assistant.nix +++ b/nixos/tests/home-assistant.nix @@ -9,13 +9,13 @@ in { nodes.hass = { pkgs, ... }: { services.postgresql = { enable = true; - ensureDatabases = [ "hass" ]; - ensureUsers = [{ - name = "hass"; - ensurePermissions = { - "DATABASE hass" = "ALL PRIVILEGES"; - }; - }]; + + # FIXME: hack for https://github.com/NixOS/nixpkgs/issues/216989 + # Should be replaced with ensureUsers again when a solution for that is found + initialScript = pkgs.writeText "hass-setup-db.sql" '' + CREATE ROLE hass WITH LOGIN; + CREATE DATABASE hass WITH OWNER hass; + ''; }; services.home-assistant = {