1
0
Fork 0
selfhostblocks/test/services/grocy.nix

76 lines
1.3 KiB
Nix
Raw Normal View History

{ pkgs, lib, ... }:
let
2024-03-20 06:50:41 +01:00
pkgs' = pkgs;
2024-07-12 13:01:26 +02:00
testLib = pkgs.callPackage ../common.nix {};
2024-06-07 07:58:47 +02:00
subdomain = "g";
domain = "example.com";
fqdn = "${subdomain}.${domain}";
2024-07-16 10:38:26 +02:00
commonTestScript = lib.makeOverridable testLib.accessScript {
inherit subdomain domain;
2024-07-12 13:01:26 +02:00
hasSSL = { node, ... }: !(isNull node.config.shb.grocy.ssl);
waitForServices = { ... }: [
"phpfpm-grocy.service"
"nginx.service"
];
waitForUnixSocket = { node, ... }: [
node.config.services.phpfpm.pools.grocy.socket
];
# TODO: Test login
# extraScript = { ... }: ''
# '';
};
2024-06-07 07:58:47 +02:00
2024-07-16 10:38:26 +02:00
base = testLib.base pkgs' [
../../modules/services/grocy.nix
];
2024-06-07 07:58:47 +02:00
basic = { config, ... }: {
shb.grocy = {
enable = true;
inherit domain subdomain;
};
};
https = { config, ...}: {
shb.grocy = {
ssl = config.shb.certs.certs.selfsigned.n;
};
};
in
{
2024-03-20 06:50:41 +01:00
basic = pkgs.testers.runNixOSTest {
2024-07-16 10:38:26 +02:00
name = "grocy_basic";
2024-07-16 10:38:26 +02:00
nodes.server = {
imports = [
base
basic
];
};
nodes.client = {};
testScript = commonTestScript;
};
2024-06-07 07:58:47 +02:00
https = pkgs.testers.runNixOSTest {
2024-07-16 10:38:26 +02:00
name = "grocy_https";
nodes.server = {
imports = [
base
(testLib.certs domain)
basic
https
];
};
nodes.client = {};
testScript = commonTestScript;
};
}