Compare commits
No commits in common. "fe057f88e5d61a9841880494dd6943cd35cc9a50" and "ecdfd5867e849e794a563c784ce99035665adfa1" have entirely different histories.
fe057f88e5
...
ecdfd5867e
@ -24,10 +24,12 @@
|
|||||||
nixos = {
|
nixos = {
|
||||||
httpd = {
|
httpd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
bridge = "br0";
|
||||||
ip = "192.168.1.201/24";
|
ip = "192.168.1.201/24";
|
||||||
};
|
};
|
||||||
unbound = {
|
unbound = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
bridge = "br0";
|
||||||
ip = "192.168.1.202/24";
|
ip = "192.168.1.202/24";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./httpd.nix
|
./httpd.nix
|
||||||
./traefik.nix
|
|
||||||
./unbound.nix
|
./unbound.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,6 +11,10 @@ in
|
|||||||
default = false;
|
default = false;
|
||||||
description = "httpd nixos ct";
|
description = "httpd nixos ct";
|
||||||
};
|
};
|
||||||
|
bridge = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
description = "the bridge to use e.g. (br0)";
|
||||||
|
};
|
||||||
ip = mkOption {
|
ip = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
description = "ip addr e.g. (192.168.1.20)";
|
description = "ip addr e.g. (192.168.1.20)";
|
||||||
@ -21,7 +25,7 @@ in
|
|||||||
containers.httpd = {
|
containers.httpd = {
|
||||||
autoStart = true;
|
autoStart = true;
|
||||||
privateNetwork = true;
|
privateNetwork = true;
|
||||||
hostBridge = net.bridge;
|
hostBridge = cfg.bridge;
|
||||||
localAddress = cfg.ip;
|
localAddress = cfg.ip;
|
||||||
config = { ... }: {
|
config = { ... }: {
|
||||||
system.stateVersion = "25.11";
|
system.stateVersion = "25.11";
|
||||||
|
|||||||
@ -1,94 +0,0 @@
|
|||||||
{ lib, config, ... }:
|
|
||||||
let
|
|
||||||
inherit (lib) mkIf mkOption types;
|
|
||||||
cfg = config.smayzy.containers.nixos.traefik;
|
|
||||||
net = config.smayzy.containers.networking;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.smayzy.containers.nixos.traefik = {
|
|
||||||
enable = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = "traefik nixos ct";
|
|
||||||
};
|
|
||||||
ip = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
description = "ip addr e.g. (192.168.1.20)";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
age.secrets.traefik-cf-tk = {
|
|
||||||
file = ../../../../secrets/traefik-cf-tk.age;
|
|
||||||
owner = "root";
|
|
||||||
group = "root";
|
|
||||||
mode = "0400";
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
containers.traefik = {
|
|
||||||
bindMounts."/run/secrets/traefik-cf-tk" = {
|
|
||||||
hostPath = config.age.secrets.traefik-cf-tk.path;
|
|
||||||
isReadOnly = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
autoStart = true;
|
|
||||||
privateNetwork = true;
|
|
||||||
hostBridge = net.bridge;
|
|
||||||
localAddress = cfg.ip;
|
|
||||||
config = { ... }: {
|
|
||||||
system.stateVersion = "25.11";
|
|
||||||
|
|
||||||
networking.defaultGateway = net.gateway;
|
|
||||||
networking.nameservers = net.dns;
|
|
||||||
networking.firewall.allowedTCPPorts = [ 8080 80 443 880 4443 ];
|
|
||||||
|
|
||||||
systemd.services.traefik.serviceConfig.EnvironmentFile = [
|
|
||||||
"/run/secrets/traefik-cf-tk"
|
|
||||||
];
|
|
||||||
|
|
||||||
services.traefik = {
|
|
||||||
enable = true;
|
|
||||||
staticConfigOptions = {
|
|
||||||
log = {
|
|
||||||
level = "WARN";
|
|
||||||
};
|
|
||||||
api = {
|
|
||||||
dashboard = true;
|
|
||||||
insecure = true;
|
|
||||||
};
|
|
||||||
entryPoints = {
|
|
||||||
local = {
|
|
||||||
address = ":80";
|
|
||||||
};
|
|
||||||
localSec = {
|
|
||||||
address = ":443";
|
|
||||||
};
|
|
||||||
ext = {
|
|
||||||
address = ":880";
|
|
||||||
};
|
|
||||||
extSec = {
|
|
||||||
address = ":4443";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
certificatesResolvers = {
|
|
||||||
cloudflare = {
|
|
||||||
acme = {
|
|
||||||
email = "smayzy@smayzy.ovh";
|
|
||||||
dnsChallenge = {
|
|
||||||
provider = "cloudflare";
|
|
||||||
resolvers = [ "192.168.1.202" ];
|
|
||||||
propagation.delayBeforeChecks = 15;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
dynamicConfigOptions = {
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@ -11,6 +11,10 @@ in
|
|||||||
default = false;
|
default = false;
|
||||||
description = "unbound nixos ct";
|
description = "unbound nixos ct";
|
||||||
};
|
};
|
||||||
|
bridge = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
description = "the bridge to use e.g. (br0)";
|
||||||
|
};
|
||||||
ip = mkOption {
|
ip = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
description = "ip addr e.g. (192.168.1.20)";
|
description = "ip addr e.g. (192.168.1.20)";
|
||||||
@ -21,7 +25,7 @@ in
|
|||||||
containers.unbound = {
|
containers.unbound = {
|
||||||
autoStart = true;
|
autoStart = true;
|
||||||
privateNetwork = true;
|
privateNetwork = true;
|
||||||
hostBridge = net.bridge;
|
hostBridge = cfg.bridge;
|
||||||
localAddress = cfg.ip;
|
localAddress = cfg.ip;
|
||||||
config = { ... }: {
|
config = { ... }: {
|
||||||
system.stateVersion = "25.11";
|
system.stateVersion = "25.11";
|
||||||
|
|||||||
@ -46,6 +46,4 @@ in
|
|||||||
"servers.age" = mkKey servers;
|
"servers.age" = mkKey servers;
|
||||||
|
|
||||||
"systems.age" = mkKey systems;
|
"systems.age" = mkKey systems;
|
||||||
|
|
||||||
"traefik-cf-tk.age" = mkKey desktop1;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +0,0 @@
|
|||||||
-----BEGIN AGE ENCRYPTED FILE-----
|
|
||||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IExwTFA3dyBaZTRB
|
|
||||||
UmhMWGEzTXVsbVg1cEI4a2NGOG01bDZINUtNWlhyemFRUUZWYjI4Cjh0b1ladXli
|
|
||||||
dmV6d0d6V1hmTk02YU8wVHpMNFNQMW1uVlNYeEx0SE1nUjAKLT4gc3NoLWVkMjU1
|
|
||||||
MTkgR3Q0b2R3IFZCUUdKcGY2TTRSSWhqWllkd2RsVmw1M2h4RllZU0ZSM1N6eThG
|
|
||||||
UXVleXcKRUp0V0h2djdEMnpVVUlwUThXMENYWFhlM1I0R1FBcVNuWDRUNDFKazho
|
|
||||||
bwotLS0gTXJCQ2dDZkJod2Ezc3Y3VThXNGhpVHlkbHZGUlJOU1Q0SDZVTGFnZ1FB
|
|
||||||
awpkI4uVSv1v7+/Ad7Up8Uo6v7O8NRmLClI/08IzXPL0RrTvj55SO3Adct1qnknW
|
|
||||||
GPsNHiMUgWxAfYMAKjsoz95zxPmzLJrV6Fm5penyyRC8X3ssZgH8HLoBueQ=
|
|
||||||
-----END AGE ENCRYPTED FILE-----
|
|
||||||
Loading…
Reference in New Issue
Block a user