diff --git a/Makefile b/Makefile index 3f6b092..1a5f31b 100644 --- a/Makefile +++ b/Makefile @@ -11,8 +11,7 @@ # Since all targets are phony, all targets should be listed here # One target per line -.PHONY: boot-graphical-vm \ - boot-vm \ +.PHONY: boot-vm \ build-vm \ clean \ format-nix-files \ @@ -29,8 +28,8 @@ format-nix-files: ## Format nix files using the nixpkgs-fmt tool find . -name "*.nix" -exec nixpkgs-fmt {} \; clean: ## Clean build artifacts and shutdown running virtual machines - rm result - rm nixos.qcow2 + rm result > /dev/null 2>&1 + rm nixos.qcow2 > /dev/null 2>&1 pkill qemu exit 0 @@ -46,6 +45,3 @@ boot-vm: ## Run virtual machine in current terminal -nographic; \ reset -boot-graphical-vm: ## Run virtual machine in QEMU window - ./result/bin/run-nixos-vm - diff --git a/invoice-ninja.nix b/invoice-ninja.nix index cae48fc..0a3bf10 100644 --- a/invoice-ninja.nix +++ b/invoice-ninja.nix @@ -10,7 +10,7 @@ let cfg = config.services.invoice-ninja; user = cfg.user; group = cfg.group; - invoice-ninja = pkgs.callPackage ./default.nix { + invoice-ninja = pkgs.callPackage ../../../../pkgs/by-name/in/invoice-ninja/package.nix { inherit (cfg) dataDir runtimeDir; }; configFormat = pkgs.formats.keyValue { }; diff --git a/tests/test-config.nix b/tests/test-config.nix index 6e98c4c..2c1e2b3 100644 --- a/tests/test-config.nix +++ b/tests/test-config.nix @@ -10,16 +10,40 @@ nixpkgs.config.allowUnfree = true; + environment.etc."msmtp-password" = { + enable = true; + user = "invoiceninja"; + group = "invoiceninja"; + mode = "0440"; + text = '' + 3t5h638t3a7y7275 + + ''; + }; + users.users.test = { isNormalUser = true; extraGroups = [ "wheel" ]; - initialPassword = "testing"; + initialPassword = "test"; }; services.invoice-ninja = { enable = true; database.createLocally = true; - nginx = { }; + webserver.caddy.enable = true; + webserver.nginx.enable = false; + mail.mailFromName = "Andrew Bryant"; + adminEmail = "billing@allpawcare.com"; + msmtp.accounts.invoice-ninja = { + auth = true; + tls = true; + tls_starttls = false; + from = "billing@allpawcare.com"; + host = "smtp.fastmail.com"; + port = 465; + user = "awkawb@awkawb.cloud"; + passwordeval = "cat /etc/msmtp-password"; + }; secretFile = ./test-secrets.env; }; diff --git a/tests/test-password b/tests/test-password new file mode 100644 index 0000000..9daeafb --- /dev/null +++ b/tests/test-password @@ -0,0 +1 @@ +test diff --git a/tests/test-secrets.env b/tests/test-secrets.env index 4ba6327..e82a373 100644 --- a/tests/test-secrets.env +++ b/tests/test-secrets.env @@ -1 +1,2 @@ APP_KEY=base64:gJnNI8pOx4c0/Z6kl9mIjn0X9XkbJUWjtqnDFl9prvo= +API_KEY=test-api-token