1 import ./make-test-python.nix ({ pkgs, lib, ... }:
5 meta = with lib.maintainers; {
6 maintainers = [ willibutz ];
10 hedgedocSqlite = { ... }: {
14 settings.dbURL = "sqlite:///var/lib/hedgedoc/hedgedoc.db";
19 hedgedocPostgres = { ... }: {
20 systemd.services.hedgedoc.after = [ "postgresql.service" ];
24 settings.dbURL = "postgres://hedgedoc:\${DB_PASSWORD}@localhost:5432/hedgedocdb";
27 * Do not use pkgs.writeText for secrets as
28 * they will end up in the world-readable Nix store.
30 environmentFile = pkgs.writeText "hedgedoc-env" ''
31 DB_PASSWORD=snakeoilpassword
36 initialScript = pkgs.writeText "pg-init-script.sql" ''
37 CREATE ROLE hedgedoc LOGIN PASSWORD 'snakeoilpassword';
38 CREATE DATABASE hedgedocdb OWNER hedgedoc;
48 with subtest("HedgeDoc sqlite"):
49 hedgedocSqlite.wait_for_unit("hedgedoc.service")
50 hedgedocSqlite.wait_for_open_port(3000)
51 hedgedocSqlite.wait_until_succeeds("curl -sSf http://localhost:3000/new")
53 with subtest("HedgeDoc postgres"):
54 hedgedocPostgres.wait_for_unit("postgresql.service")
55 hedgedocPostgres.wait_for_unit("hedgedoc.service")
56 hedgedocPostgres.wait_for_open_port(5432)
57 hedgedocPostgres.wait_for_open_port(3000)
58 hedgedocPostgres.wait_until_succeeds("curl -sSf http://localhost:3000/new")