1 import ./make-test-python.nix ({ lib, ... }:
4 db-pass = "Test2Test2";
5 app-key = "TestTestTestTestTestTestTestTest";
9 meta.maintainers = [ lib.maintainers.savyajha ];
11 nodes.fireflySqlite = { config, ... }: {
13 "firefly-iii-appkey".text = app-key;
15 services.firefly-iii = {
19 APP_KEY_FILE = "/etc/firefly-iii-appkey";
20 LOG_CHANNEL = "stdout";
21 SITE_OWNER = "mail@example.com";
26 nodes.fireflyPostgresql = { config, pkgs, ... }: {
28 "firefly-iii-appkey".text = app-key;
29 "postgres-pass".text = db-pass;
31 services.firefly-iii = {
35 APP_KEY_FILE = "/etc/firefly-iii-appkey";
36 LOG_CHANNEL = "stdout";
37 SITE_OWNER = "mail@example.com";
38 DB_CONNECTION = "pgsql";
39 DB_DATABASE = "firefly";
40 DB_USERNAME = "firefly";
41 DB_PASSWORD_FILE = "/etc/postgres-pass";
42 PGSQL_SCHEMA = "firefly";
46 services.postgresql = {
48 package = pkgs.postgresql_16;
50 local all postgres peer
51 local firefly firefly password
53 initialScript = pkgs.writeText "firefly-init.sql" ''
54 CREATE USER "firefly" WITH LOGIN PASSWORD '${db-pass}';
55 CREATE DATABASE "firefly" WITH OWNER "firefly";
57 CREATE SCHEMA AUTHORIZATION firefly;
62 nodes.fireflyMysql = { config, pkgs, ... }: {
64 "firefly-iii-appkey".text = app-key;
65 "mysql-pass".text = db-pass;
67 services.firefly-iii = {
71 APP_KEY_FILE = "/etc/firefly-iii-appkey";
72 LOG_CHANNEL = "stdout";
73 SITE_OWNER = "mail@example.com";
74 DB_CONNECTION = "mysql";
75 DB_DATABASE = "firefly";
76 DB_USERNAME = "firefly";
77 DB_PASSWORD_FILE = "/etc/mysql-pass";
78 DB_SOCKET = "/run/mysqld/mysqld.sock";
84 package = pkgs.mariadb;
85 initialScript = pkgs.writeText "firefly-init.sql" ''
86 create database firefly DEFAULT CHARACTER SET utf8mb4;
87 create user 'firefly'@'localhost' identified by '${db-pass}';
88 grant all on firefly.* to 'firefly'@'localhost';
90 settings.mysqld.character-set-server = "utf8mb4";
95 fireflySqlite.wait_for_unit("phpfpm-firefly-iii.service")
96 fireflySqlite.wait_for_unit("nginx.service")
97 fireflySqlite.succeed("curl -fvvv -Ls http://localhost/ | grep 'Firefly III'")
98 fireflySqlite.succeed("curl -fvvv -Ls http://localhost/v1/js/app.js")
99 fireflySqlite.succeed("systemctl start firefly-iii-cron.service")
100 fireflyPostgresql.wait_for_unit("phpfpm-firefly-iii.service")
101 fireflyPostgresql.wait_for_unit("nginx.service")
102 fireflyPostgresql.wait_for_unit("postgresql.service")
103 fireflyPostgresql.succeed("curl -fvvv -Ls http://localhost/ | grep 'Firefly III'")
104 fireflyPostgresql.succeed("systemctl start firefly-iii-cron.service")
105 fireflyMysql.wait_for_unit("phpfpm-firefly-iii.service")
106 fireflyMysql.wait_for_unit("nginx.service")
107 fireflyMysql.wait_for_unit("mysql.service")
108 fireflyMysql.succeed("curl -fvvv -Ls http://localhost/ | grep 'Firefly III'")
109 fireflyMysql.succeed("systemctl start firefly-iii-cron.service")