From 14976fdae9961141c087e455197508f9ce5ad029 Mon Sep 17 00:00:00 2001 From: awkawb Date: Mon, 30 Dec 2024 10:19:29 -0500 Subject: [PATCH] Added tests directory for testing in vm --- tests/default.nix | 27 +++++++++++++++++++++++++++ tests/invoice_ninja_test_password | 1 + tests/test.env | 2 ++ 3 files changed, 30 insertions(+) create mode 100644 tests/default.nix create mode 100644 tests/invoice_ninja_test_password create mode 100644 tests/test.env diff --git a/tests/default.nix b/tests/default.nix new file mode 100644 index 0000000..ef4757a --- /dev/null +++ b/tests/default.nix @@ -0,0 +1,27 @@ +{ modulesPath, ... }: + +{ + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; + + nixpkgs.config.allowUnfree = true; + + users.users.test = { + isNormalUser = true; + extraGroups = [ "wheel" ]; + initialPassword = "test"; + }; + + services.invoice-ninja = { + enable = true; + proxy.server = "caddy"; + adminAccount.passwordFile = .invoice_ninja_test_password; + secretFile = ./test.env; + }; + + networking.firewall.enable = false; + + services.resolved.enable = true; +} + diff --git a/tests/invoice_ninja_test_password b/tests/invoice_ninja_test_password new file mode 100644 index 0000000..f3097ab --- /dev/null +++ b/tests/invoice_ninja_test_password @@ -0,0 +1 @@ +password diff --git a/tests/test.env b/tests/test.env new file mode 100644 index 0000000..e82a373 --- /dev/null +++ b/tests/test.env @@ -0,0 +1,2 @@ +APP_KEY=base64:gJnNI8pOx4c0/Z6kl9mIjn0X9XkbJUWjtqnDFl9prvo= +API_KEY=test-api-token