test-vm: Add WHIB backend
This commit is contained in:
@@ -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 = {
|
||||
|
||||
89
hosts/test-vm/whib-backend.nix
Normal file
89
hosts/test-vm/whib-backend.nix
Normal file
@@ -0,0 +1,89 @@
|
||||
{
|
||||
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;
|
||||
|
||||
backend = {
|
||||
signingKey = "super-secret-key";
|
||||
domain = "whib-backend.local";
|
||||
};
|
||||
|
||||
postgres = {
|
||||
password = "postgrespassword";
|
||||
|
||||
backup = {
|
||||
interval = "*-*-* *:*:00 UTC"; # Every minute, for testing
|
||||
|
||||
# Set these for test runs
|
||||
gpgPassphraseFile = "";
|
||||
|
||||
backblazeBucket = "";
|
||||
backblazeKeyID = "";
|
||||
backblazeKey = "";
|
||||
};
|
||||
};
|
||||
|
||||
grafana = {
|
||||
password = "granfanapassword";
|
||||
};
|
||||
};
|
||||
|
||||
virtualisation.vmVariant = {
|
||||
virtualisation = {
|
||||
sharedDirectories = {
|
||||
my-shared = {
|
||||
source = "/home/alex/whib-backup";
|
||||
target = "/mnt/shared";
|
||||
};
|
||||
};
|
||||
|
||||
forwardPorts = [
|
||||
{
|
||||
# Service API
|
||||
from = "host";
|
||||
host.port = 8080;
|
||||
guest.port = 8080;
|
||||
}
|
||||
{
|
||||
# Service Metrics
|
||||
from = "host";
|
||||
host.port = 8181;
|
||||
guest.port = 8181;
|
||||
}
|
||||
{
|
||||
# Postgres
|
||||
from = "host";
|
||||
host.port = 5432;
|
||||
guest.port = 5432;
|
||||
}
|
||||
{
|
||||
# Grafana
|
||||
from = "host";
|
||||
host.port = 3000;
|
||||
guest.port = 3000;
|
||||
}
|
||||
{
|
||||
# Prometheus
|
||||
from = "host";
|
||||
host.port = 9090;
|
||||
guest.port = 9090;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user