nixos-server-config/nix-containers.nix
2019-11-10 08:41:19 +00:00

50 lines
1.0 KiB
Nix

{ config, pkgs, ... }:
{
containers = {
nginx = {
autoStart = false;
config = { config, pkgs, ... }: {
networking = {
firewall.allowedTCPPorts = [ 80 ];
};
services.nginx = {
enable = true;
virtualHosts = {
www = {
listen = [
{ addr = "0.0.0.0"; port = 80; }
{ addr = "[::]"; port = 80; }
];
serverName = "nixos-server";
locations = {
"/" = {
root = "/var/www";
};
};
};
};
};
};
};
ocd = {
autoStart = false;
bindMounts = {
"/go" = {
hostPath = "/home/michael/go";
isReadOnly = false;
};
};
config = { config, pkgs, ... }: {
networking = {
firewall.allowedTCPPorts = [ 8000 ];
};
environment.systemPackages = with pkgs; [
go_bootstrap
];
};
};
};
}