2024-08-09 20:12:31 +02:00
|
|
|
{
|
|
|
|
|
pkgs,
|
|
|
|
|
lib,
|
|
|
|
|
modulesPath,
|
|
|
|
|
...
|
|
|
|
|
}:
|
|
|
|
|
{
|
|
|
|
|
imports = [ "${modulesPath}/virtualisation/qemu-vm.nix" ];
|
|
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
|
hostName = "archtika";
|
|
|
|
|
firewall.enable = false;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
nix.settings.experimental-features = [ "nix-command flakes" ];
|
|
|
|
|
|
|
|
|
|
users.users.dev = {
|
|
|
|
|
isNormalUser = true;
|
|
|
|
|
extraGroups = [ "wheel" ];
|
|
|
|
|
password = "dev";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
systemd.tmpfiles.rules = [ "d /var/www/archtika-websites 0777 root root -" ];
|
|
|
|
|
|
|
|
|
|
virtualisation = {
|
|
|
|
|
graphics = false;
|
|
|
|
|
sharedDirectories = {
|
|
|
|
|
websites = {
|
|
|
|
|
source = "/var/www/archtika-websites";
|
|
|
|
|
target = "/var/www/archtika-websites";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
# Alternatively a bridge network for QEMU could be setup, but requires much more effort
|
|
|
|
|
forwardPorts = [
|
|
|
|
|
{
|
|
|
|
|
from = "host";
|
|
|
|
|
host.port = 15432;
|
|
|
|
|
guest.port = 5432;
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
from = "host";
|
2024-08-14 19:33:41 +02:00
|
|
|
host.port = 18000;
|
|
|
|
|
guest.port = 1800;
|
2024-08-09 20:12:31 +02:00
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
services = {
|
|
|
|
|
postgresql = {
|
|
|
|
|
enable = true;
|
|
|
|
|
package = pkgs.postgresql_16;
|
|
|
|
|
ensureDatabases = [ "archtika" ];
|
|
|
|
|
authentication = lib.mkForce ''
|
|
|
|
|
local all all trust
|
|
|
|
|
host all all all trust
|
|
|
|
|
'';
|
|
|
|
|
enableTCPIP = true;
|
|
|
|
|
extraPlugins = with pkgs.postgresql16Packages; [ pgjwt ];
|
|
|
|
|
};
|
|
|
|
|
nginx = {
|
|
|
|
|
enable = true;
|
|
|
|
|
virtualHosts."_" = {
|
|
|
|
|
listen = [
|
|
|
|
|
{
|
|
|
|
|
addr = "0.0.0.0";
|
2024-08-14 19:33:41 +02:00
|
|
|
port = 1800;
|
2024-08-09 20:12:31 +02:00
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
locations = {
|
|
|
|
|
"/" = {
|
2024-09-08 16:42:32 +02:00
|
|
|
root = "/var/www/archtika-websites/";
|
2024-08-09 20:12:31 +02:00
|
|
|
index = "index.html";
|
2024-09-07 18:22:58 +02:00
|
|
|
tryFiles = "$uri $uri/ $uri.html $uri/index.html index.html =404";
|
2024-08-09 20:12:31 +02:00
|
|
|
extraConfig = ''
|
|
|
|
|
autoindex on;
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2024-09-01 18:25:32 +02:00
|
|
|
services.getty.autologinUser = "dev";
|
|
|
|
|
|
2024-08-09 20:12:31 +02:00
|
|
|
system.stateVersion = "24.05";
|
|
|
|
|
}
|