Added proxy container

This commit is contained in:
Erwin Boskma 2022-01-24 11:14:34 +01:00
parent 8cdae32ac2
commit a7b4214442
Signed by: erwin
GPG key ID: 270B20D17394F7E5
3 changed files with 80 additions and 0 deletions

View file

@ -0,0 +1,46 @@
{ self, ... }:
{
imports = [
./hardware-configuration.nix
../../users/root
../../users/erwin
];
eboskma = {
docker.enable = true;
nix-common.enable = true;
nginx-proxy-manager.enable = true;
};
boot.isContainer = true;
time.timeZone = "Europe/Amsterdam";
system.configurationRevision = self.inputs.nixpkgs.lib.mkIf (self ? rev) self.rev;
networking = {
hostName = "proxy";
useDHCP = false;
interfaces = {
eth0 = {
ipv4.addresses = [{
address = "10.0.0.251";
prefixLength = 24;
}];
};
};
defaultGateway = "10.0.0.1";
nameservers = [ "10.0.0.254" ];
};
environment.noXlibs = true;
services.openssh.enable = true;
sops.defaultSopsFile = ./secrets.yaml;
sops.secrets = { };
system.stateVersion = "21.11";
}

View file

@ -0,0 +1,6 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [
(modulesPath + "/virtualisation/lxc-container.nix")
];
}

View file

@ -0,0 +1,28 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.eboskma.nginx-proxy-manager;
in
{
options.eboskma.nginx-proxy-manager = { enable = mkEnableOption "Nginx Proxy Manager"; };
config = mkIf (cfg.enable) {
eboskma.docker.enable = true;
virtualisation.oci-containers.containers = {
nginx-proxy-manager = {
autoStart = true;
image = "jc21/nginx-proxy-manager:latest";
ports = [
"80:80"
"81:81"
"443:443"
];
volumes = [
"/var/lib/npm/data:/data"
"letsencrypt:/etc/letsencrypt"
];
};
};
};
}