Added proxy container
This commit is contained in:
parent
8cdae32ac2
commit
a7b4214442
3 changed files with 80 additions and 0 deletions
46
machines/proxy/configuration.nix
Normal file
46
machines/proxy/configuration.nix
Normal 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";
|
||||
}
|
6
machines/proxy/hardware-configuration.nix
Normal file
6
machines/proxy/hardware-configuration.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/virtualisation/lxc-container.nix")
|
||||
];
|
||||
}
|
28
modules/nginx-proxy-manager/default.nix
Normal file
28
modules/nginx-proxy-manager/default.nix
Normal 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"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue