blob: 04bc1a79e32dd48a28a7d37e20433465a4007cb9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
{ config, pkgs, lib, inputs, ... }:
with lib;
let cfg = config.roles.web.test; in {
options.roles.web.test = {
enable = mkEnableOption "test webserver";
};
config = mkIf cfg.enable {
containers.web-test = {
autoStart = true;
privateNetwork = true;
hostAddress = "192.168.0.1";
localAddress = "192.168.0.2";
bindMounts = {
"/srv/web/test" = {
hostPath = "/srv/web/test";
isReadOnly = true;
};
};
config = { ... }: {
system.stateVersion = "23.11";
networking.firewall.allowedTCPPorts = [ 80 ];
services.nginx = {
enable = true;
virtualHosts = {
"192.168.0.2".root = "/srv/web/test";
};
};
};
};
};
}
|