feat(hosts): add NaroMk3 to the existing hosts
This commit is contained in:
@@ -9,5 +9,6 @@
|
||||
./printing.nix
|
||||
./ssh.nix
|
||||
./sunshine.nix
|
||||
./traefik.nix
|
||||
];
|
||||
}
|
||||
|
||||
@@ -18,9 +18,14 @@ in {
|
||||
example = true;
|
||||
default = false;
|
||||
};
|
||||
port = mkOption {
|
||||
type = types.int;
|
||||
default = 22;
|
||||
};
|
||||
};
|
||||
config.services.openssh = mkIf cfg.enable {
|
||||
inherit (cfg) enable;
|
||||
ports = [cfg.port];
|
||||
settings = {
|
||||
AllowUsers = cfg.allowedUsers;
|
||||
PermitRootLogin = "no";
|
||||
|
||||
60
system/services/traefik.nix
Normal file
60
system/services/traefik.nix
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.mySystem.services.traefik;
|
||||
in {
|
||||
options.mySystem.services.traefik = {
|
||||
enable = mkEnableOption "Enable Traefik";
|
||||
dataDir = mkOption {
|
||||
type = types.path;
|
||||
default = "/tank/traefik";
|
||||
};
|
||||
email = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
config.services.traefik = {
|
||||
inherit (cfg) enable;
|
||||
dynamicConfigFile = "${cfg.dataDir}/dynamic_config.toml";
|
||||
staticConfigOptions = {
|
||||
api.dashboard = true;
|
||||
log = {
|
||||
level = "INFO";
|
||||
filePath = "${cfg.dataDir}/traefik.log";
|
||||
format = "json";
|
||||
};
|
||||
accessLog.filePath = "${cfg.dataDir}/access.log";
|
||||
entryPoints = {
|
||||
http = {
|
||||
address = ":80";
|
||||
asDefault = true;
|
||||
http.redirections.entrypoint = {
|
||||
to = "https";
|
||||
scheme = "https";
|
||||
};
|
||||
};
|
||||
https = {
|
||||
address = ":443";
|
||||
asDefault = true;
|
||||
httpChallenge.entryPoint = "https";
|
||||
};
|
||||
};
|
||||
providers.docker = {
|
||||
endpoint = "unix:///var/run/docker.sock";
|
||||
exposedByDefault = false;
|
||||
};
|
||||
certificatesResolvers.cloudflare.acme = {
|
||||
inherit (cfg) email;
|
||||
storage = "${cfg.dataDir}/acme.json";
|
||||
dnsChallenge = {
|
||||
provider = "cloudflare";
|
||||
resolvers = ["1.1.1.1:53" "1.0.0.1:53"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user