flake/systems/etna/default.nix

80 lines
1.7 KiB
Nix
Raw Normal View History

2024-03-03 16:57:20 +01:00
{
lib,
2024-03-03 16:57:20 +01:00
config,
2024-04-13 14:26:07 +02:00
pkgs, # required for fudgeMyShitIn
2024-03-03 16:57:20 +01:00
...
2024-04-13 14:26:07 +02:00
} @ args: let
tunnelId = "57f51ad7-25a0-45f3-b113-0b6ae0b2c3e5";
2024-04-13 14:26:07 +02:00
secretsPath = ../../secrets/etna;
mkSecrets = builtins.mapAttrs (name: value: value // {file = "${secretsPath}/${name}.age";});
mkSecret = name: other: mkSecrets {${name} = other;};
fudgeMyShitIn = builtins.map (file: import file (args // {inherit mkSecret;}));
in {
2024-04-13 14:26:07 +02:00
imports =
[
(lib.mkAliasOptionModule ["cfTunnels"] ["services" "cloudflared" "tunnels" tunnelId "ingress"])
]
++ fudgeMyShitIn [
./minecraft.nix
./attic.nix
./dendrite.nix
./nextcloud.nix
];
2024-04-13 14:26:07 +02:00
age.secrets = mkSecrets {
apiRsEnv = {};
ukubotRsEnv = {};
2024-02-02 15:20:48 +01:00
tunnelCreds = {
owner = "cloudflared";
group = "cloudflared";
};
};
2024-01-18 17:28:47 +01:00
boot.loader.systemd-boot.enable = true;
2024-02-02 15:20:48 +01:00
services = {
api-rs = {
enable = true;
environmentFile = config.age.secrets.apiRsEnv.path;
};
2024-02-02 16:20:46 +01:00
ukubot-rs = {
enable = true;
environmentFile = config.age.secrets.ukubotRsEnv.path;
};
2024-02-03 21:55:58 +01:00
reposilite.enable = true;
2024-02-14 15:59:20 +01:00
tailscale.extraUpFlags = ["--advertise-exit-node"];
2024-02-03 16:19:55 +01:00
vaultwarden = {
enable = true;
config = {
DOMAIN = "https://bw.uku3lig.net";
SIGNUPS_ALLOWED = false;
ROCKET_ADDRESS = "::1";
ROCKET_PORT = 8222;
};
};
2024-02-02 15:20:48 +01:00
cloudflared = {
enable = true;
tunnels.${tunnelId} = {
2024-02-02 15:20:48 +01:00
credentialsFile = config.age.secrets.tunnelCreds.path;
ingress = {
"api.uku3lig.net" = "http://localhost:5000";
2024-02-03 16:19:55 +01:00
"bw.uku3lig.net" = "http://localhost:8222";
2024-02-03 21:55:58 +01:00
"maven.uku3lig.net" = "http://localhost:8080";
2024-02-02 15:20:48 +01:00
};
default = "http_status:404";
};
};
2024-03-06 22:50:31 +01:00
};
2024-01-18 15:15:14 +01:00
}