test-vm: Add WHIB backend

This commit is contained in:
Alexander Heldt
2024-11-09 10:41:13 +01:00
parent 5697f190bc
commit 896d0c7d43
5 changed files with 97 additions and 8 deletions

View File

@@ -14,6 +14,8 @@
home.homeDirectory = "/home/alex";
home.packages = [
inputs.whib-backend.packages.${pkgs.system}.whib-import
pkgs.beekeeper-studio
pkgs.bitwarden-desktop
pkgs.gimp
pkgs.zip

View File

@@ -2,6 +2,7 @@
{
imports = [
./ppp.pm-site.nix
./whib-backend.nix
];
config = {
@@ -10,7 +11,8 @@
networking.hostName = "test-vm";
mod = {
pppdotpm-site.enable = true;
pppdotpm-site.enable = false;
whib-backend.enable = true;
};
users.users.a = {

View File

@@ -0,0 +1,54 @@
{
lib,
config,
...
}:
let
enabled = config.mod.whib-backend.enable;
in
{
options = {
mod.whib-backend = {
enable = lib.mkEnableOption "enable WHIB backend";
};
};
config = lib.mkIf enabled {
services.whib-backend = {
enable = true;
domain = "whib-backend.local";
backend = {
signingKey = "super-secret-key";
};
postgres = {
password = "postgrespassword";
};
};
virtualisation.vmVariant = {
virtualisation = {
sharedDirectories = {
my-shared = {
source = "/home/alex/whib-backup";
target = "/mnt/shared";
};
};
forwardPorts = [
{
from = "host";
host.port = 8080;
guest.port = 8080;
}
{
from = "host";
host.port = 5432;
guest.port = 5432;
}
];
};
};
};
}