mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
nixos/tests/home-assistant: test module-based package loading
Passing psycopg2 for PostgreSQL support in the recorder component is one of the more popular use cases to pass an extra package.
This commit is contained in:
parent
918100f48f
commit
191fb818e6
@ -23,6 +23,17 @@ in {
|
||||
} ];
|
||||
};
|
||||
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
ensureDatabases = [ "hass" ];
|
||||
ensureUsers = [{
|
||||
name = "hass";
|
||||
ensurePermissions = {
|
||||
"DATABASE hass" = "ALL PRIVILEGES";
|
||||
};
|
||||
}];
|
||||
};
|
||||
|
||||
services.home-assistant = {
|
||||
enable = true;
|
||||
inherit configDir;
|
||||
@ -39,6 +50,11 @@ in {
|
||||
"wake_on_lan"
|
||||
];
|
||||
|
||||
# test extra package passing from the module
|
||||
extraPackages = python3Packages: with python3Packages; [
|
||||
psycopg2
|
||||
];
|
||||
|
||||
config = {
|
||||
homeassistant = {
|
||||
name = "Home";
|
||||
@ -48,6 +64,9 @@ in {
|
||||
elevation = 0;
|
||||
};
|
||||
|
||||
# configure the recorder component to use the postgresql db
|
||||
recorder.db_url = "postgresql://@/hass";
|
||||
|
||||
# we can't load default_config, because the updater requires
|
||||
# network access and would cause an error, so load frontend
|
||||
# here explicitly.
|
||||
|
Loading…
Reference in New Issue
Block a user