2020-12-26 23:36:34 +00:00
|
|
|
# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2022-01-23 16:57:20 +00:00
|
|
|
{ depot, lib, pkgs, config, ... }:
|
2023-07-11 11:01:46 +00:00
|
|
|
{
|
2020-12-26 23:36:34 +00:00
|
|
|
imports = [
|
|
|
|
../lib/bgp.nix
|
|
|
|
../lib/zfs.nix
|
2024-03-12 01:43:08 +00:00
|
|
|
../totoro/barf.nix # eww
|
2020-12-26 23:36:34 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
boot.initrd = {
|
|
|
|
availableKernelModules = [
|
|
|
|
"ehci_pci"
|
|
|
|
"ahci"
|
|
|
|
"usbhid"
|
|
|
|
"usb_storage"
|
|
|
|
"sd_mod"
|
|
|
|
"sr_mod"
|
|
|
|
"bnx2" # ethernet
|
|
|
|
];
|
|
|
|
network = {
|
|
|
|
enable = true;
|
|
|
|
ssh = {
|
|
|
|
enable = true;
|
|
|
|
hostKeys = ["/persist/etc/ssh/ssh_host_ed25519_key"];
|
|
|
|
authorizedKeys = map builtins.readFile config.users.users.lukegb.openssh.authorizedKeys.keyFiles;
|
|
|
|
};
|
|
|
|
postCommands = ''
|
|
|
|
echo "zfs load-key -a; killall zfs" >> /root/.profile
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
boot.kernelParams = [
|
2023-03-16 10:32:09 +00:00
|
|
|
"ip=103.141.25.50::103.141.25.49:255.255.255.252:etheroute-lon01:eno1:none"
|
2020-12-26 23:36:34 +00:00
|
|
|
];
|
|
|
|
boot.kernelModules = [ "kvm-intel" ];
|
2021-12-07 15:48:50 +00:00
|
|
|
boot.kernel.sysctl = {
|
|
|
|
"net.ipv4.conf.all.forwarding" = true;
|
|
|
|
"net.ipv4.conf.default.forwarding" = true;
|
|
|
|
};
|
2020-12-26 23:36:34 +00:00
|
|
|
|
|
|
|
# Use the systemd-boot EFI boot loader.
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
|
|
|
|
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
|
|
|
|
services.zfs.rollbackOnBoot = {
|
|
|
|
enable = true;
|
|
|
|
snapshot = "tank/local/root@blank";
|
|
|
|
};
|
|
|
|
|
2024-03-12 02:22:13 +00:00
|
|
|
systemd.services."systemd-networkd-wait-online".wantedBy = lib.mkForce [];
|
|
|
|
|
2020-12-26 23:36:34 +00:00
|
|
|
fileSystems = let
|
|
|
|
zfs = device: {
|
|
|
|
device = device;
|
|
|
|
fsType = "zfs";
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
"/" = zfs "tank/local/root";
|
|
|
|
"/nix" = zfs "tank/local/nix";
|
|
|
|
"/tmp" = zfs "tank/local/tmp";
|
|
|
|
|
|
|
|
"/persist" = zfs "tank/safe/persist";
|
|
|
|
"/home" = zfs "tank/safe/home";
|
|
|
|
|
|
|
|
"/boot" = {
|
|
|
|
device = "/dev/disk/by-partlabel/ESP";
|
|
|
|
fsType = "vfat";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-01-30 20:30:20 +00:00
|
|
|
nix.settings.max-jobs = lib.mkDefault 8;
|
2020-12-26 23:36:34 +00:00
|
|
|
|
|
|
|
# Networking!
|
|
|
|
networking = {
|
|
|
|
hostName = "etheroute-lon01";
|
|
|
|
domain = "as205479.net";
|
|
|
|
hostId = "420bee1b";
|
2023-07-11 11:01:46 +00:00
|
|
|
useNetworkd = true;
|
2020-12-26 23:36:34 +00:00
|
|
|
|
|
|
|
nameservers = [
|
|
|
|
"2001:4860:4860::8888"
|
|
|
|
"2001:4860:4860::8844"
|
|
|
|
"8.8.8.8"
|
|
|
|
"8.8.4.4"
|
|
|
|
];
|
2023-10-24 22:51:25 +00:00
|
|
|
defaultGateway = {
|
|
|
|
address = "103.141.25.49";
|
|
|
|
interface = "eno1";
|
|
|
|
};
|
|
|
|
defaultGateway6 = {
|
|
|
|
address = "2a07:242:800:64::1";
|
|
|
|
interface = "eno1";
|
|
|
|
};
|
2020-12-26 23:36:34 +00:00
|
|
|
interfaces.eno1 = {
|
2023-03-16 10:32:09 +00:00
|
|
|
ipv4.addresses = [{ address = "103.141.25.50"; prefixLength = 30; }];
|
2020-12-26 23:36:34 +00:00
|
|
|
ipv6.addresses = [{ address = "2a07:242:800:64::68"; prefixLength = 64; }];
|
|
|
|
};
|
2023-07-11 11:01:46 +00:00
|
|
|
#interfaces.quadv1-4 = {
|
|
|
|
# ipv4.addresses = [{ address = "92.118.31.254"; prefixLength = 24; }];
|
|
|
|
# virtual = true;
|
|
|
|
#};
|
2020-12-28 15:27:18 +00:00
|
|
|
firewall.allowedTCPPorts = [ 80 443 ];
|
2023-07-15 11:09:18 +00:00
|
|
|
firewall.allowedUDPPorts = [ 51820 ];
|
2021-12-07 17:25:59 +00:00
|
|
|
firewall.extraCommands = ''
|
|
|
|
# Flush old rules.
|
|
|
|
ip46tables -D FORWARD -j lukegb-forward 2>/dev/null || true
|
|
|
|
for chain in lukegb-forward lukegb-fwd-accept lukegb-fwd-reject; do
|
|
|
|
ip46tables -F "$chain" 2>/dev/null || true
|
|
|
|
ip46tables -X "$chain" 2>/dev/null || true
|
|
|
|
done
|
|
|
|
|
|
|
|
ip46tables -N lukegb-fwd-accept
|
|
|
|
ip46tables -A lukegb-fwd-accept -j ACCEPT
|
|
|
|
|
|
|
|
ip46tables -N lukegb-fwd-reject
|
|
|
|
ip46tables -A lukegb-fwd-reject -p tcp ! --syn -j REJECT --reject-with tcp-reset
|
|
|
|
ip46tables -A lukegb-fwd-reject -j REJECT
|
|
|
|
|
|
|
|
ip46tables -N lukegb-forward
|
|
|
|
|
2023-07-15 11:09:18 +00:00
|
|
|
# Accept from "trusted" quadv1 interface
|
|
|
|
ip46tables -A lukegb-forward -i quadv1 -j lukegb-fwd-accept
|
2021-12-07 17:25:59 +00:00
|
|
|
|
2023-09-30 01:14:36 +00:00
|
|
|
# Accept to quadv1 interface if we're multipathing.
|
|
|
|
ip46tables -A lukegb-forward -o quadv1 -j lukegb-fwd-accept
|
|
|
|
|
2021-12-07 17:25:59 +00:00
|
|
|
# Accept from established/related connections.
|
|
|
|
ip46tables -A lukegb-forward -m conntrack --ctstate ESTABLISHED,RELATED -j lukegb-fwd-accept
|
|
|
|
|
|
|
|
# Set up the firewall.
|
|
|
|
ip46tables -A lukegb-forward -j lukegb-fwd-reject
|
|
|
|
ip46tables -A FORWARD -j lukegb-forward
|
|
|
|
'';
|
2020-12-26 23:36:34 +00:00
|
|
|
};
|
2023-04-18 20:59:21 +00:00
|
|
|
my.ip.tailscale = "100.99.227.112";
|
|
|
|
my.ip.tailscale6 = "fd7a:115c:a1e0:ab12:4843:cd96:6263:e370";
|
2020-12-26 23:36:34 +00:00
|
|
|
|
2023-07-15 11:09:18 +00:00
|
|
|
systemd.network.netdevs.quadv1 = {
|
|
|
|
netdevConfig = {
|
|
|
|
Name = "quadv1";
|
|
|
|
Kind = "wireguard";
|
|
|
|
};
|
|
|
|
|
|
|
|
wireguardConfig = {
|
|
|
|
PrivateKeyFile = pkgs.writeText "etheroute-lon01-quadv" depot.ops.secrets.wireguard.quadv1.lukegb.privateKey;
|
|
|
|
ListenPort = 51820;
|
|
|
|
RouteTable = "off";
|
|
|
|
};
|
|
|
|
|
|
|
|
wireguardPeers = [{
|
2024-06-08 23:53:59 +00:00
|
|
|
PublicKey = depot.ops.secrets.wireguard.quadv1.quadv.publicKey;
|
|
|
|
AllowedIPs = "0.0.0.0/0,::/0";
|
2023-07-15 11:09:18 +00:00
|
|
|
}];
|
|
|
|
};
|
|
|
|
systemd.network.networks.quadv1 = {
|
|
|
|
matchConfig.Name = "quadv1";
|
|
|
|
networkConfig.Address = "169.254.111.0/31";
|
|
|
|
|
|
|
|
routes = [{
|
2024-06-08 23:53:59 +00:00
|
|
|
Gateway = "169.254.111.1";
|
|
|
|
Destination = "92.118.31.0/24";
|
2023-07-15 11:09:18 +00:00
|
|
|
}];
|
|
|
|
};
|
|
|
|
|
2020-12-26 23:36:34 +00:00
|
|
|
services.openssh.hostKeys = [
|
|
|
|
{
|
|
|
|
path = "/persist/etc/ssh/ssh_host_ed25519_key";
|
|
|
|
type = "ed25519";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
path = "/persist/etc/ssh/ssh_host_rsa_key";
|
|
|
|
type = "rsa";
|
|
|
|
bits = 4096;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
users.users = {
|
|
|
|
lukegb.extraGroups = [ "bird2" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
services.lukegbgp = let local = {
|
|
|
|
asn = 205479;
|
|
|
|
}; in {
|
|
|
|
enable = true;
|
|
|
|
config = {
|
|
|
|
local = {
|
2023-03-16 10:32:09 +00:00
|
|
|
routerID = "103.141.25.50";
|
2020-12-26 23:36:34 +00:00
|
|
|
};
|
|
|
|
peering = {
|
|
|
|
etheroute = {
|
|
|
|
local = local // {
|
2023-03-16 10:32:09 +00:00
|
|
|
v4 = "103.141.25.50";
|
2020-12-26 23:36:34 +00:00
|
|
|
v6 = "2a07:242:800:64::68";
|
|
|
|
};
|
|
|
|
remote = {
|
2021-06-11 12:28:30 +00:00
|
|
|
asn = 3170;
|
2020-12-26 23:36:34 +00:00
|
|
|
export_community = 4000;
|
|
|
|
routers = [{
|
2023-03-16 10:32:09 +00:00
|
|
|
v4 = "103.141.25.49";
|
2020-12-26 23:36:34 +00:00
|
|
|
v6 = "2a07:242:800:64::1";
|
|
|
|
}];
|
|
|
|
};
|
|
|
|
};
|
2022-04-30 15:48:01 +00:00
|
|
|
bgptoolscollector = {
|
|
|
|
local = local // {
|
2023-03-16 10:32:09 +00:00
|
|
|
v4 = "103.141.25.50";
|
2022-04-30 15:48:01 +00:00
|
|
|
v6 = "2a07:242:800:64::68";
|
|
|
|
};
|
|
|
|
remote = {
|
|
|
|
asn = 212232;
|
|
|
|
export_community = 5000;
|
|
|
|
is_route_collector = true;
|
|
|
|
routers = [{
|
2022-08-26 20:00:43 +00:00
|
|
|
v4 = "185.230.223.48";
|
|
|
|
v6 = "2a0c:2f07:9459::b6";
|
2022-04-30 15:48:01 +00:00
|
|
|
multihop = 64;
|
|
|
|
}];
|
|
|
|
prefix_limit.v4 = 0;
|
|
|
|
prefix_limit.v6 = 0;
|
|
|
|
};
|
|
|
|
};
|
2023-09-30 01:14:36 +00:00
|
|
|
quadv = {
|
|
|
|
local = local // {
|
|
|
|
v4 = "169.254.111.0";
|
|
|
|
};
|
|
|
|
remote = {
|
|
|
|
asn = 197753;
|
|
|
|
export_community = 4099;
|
|
|
|
routers = [{
|
|
|
|
v4 = "169.254.111.1";
|
|
|
|
}];
|
|
|
|
prefix_limit.v4 = 10;
|
|
|
|
prefix_limit.v6 = 10;
|
|
|
|
};
|
|
|
|
};
|
2020-12-26 23:36:34 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.mounts = let
|
|
|
|
bindMount' = dir: {
|
|
|
|
unitConfig.RequiresMountsFor = dir;
|
|
|
|
options = "bind";
|
|
|
|
what = "/persist${dir}";
|
|
|
|
where = dir;
|
|
|
|
};
|
|
|
|
bindMountSvc = dir: svc: (bindMount' dir) // {
|
|
|
|
bindsTo = [svc];
|
|
|
|
partOf = [svc];
|
|
|
|
};
|
|
|
|
bindMountSvcDynamic = dir: svc: (bindMount' "/var/lib/private/${dir}") // {
|
|
|
|
requiredBy = [svc];
|
|
|
|
before = [svc];
|
|
|
|
wantedBy = ["multi-user.target"];
|
|
|
|
};
|
|
|
|
bindMount = dir: (bindMount' dir) // {
|
|
|
|
wantedBy = ["multi-user.target"];
|
|
|
|
};
|
|
|
|
in [
|
|
|
|
(bindMountSvc "/var/lib/tailscale" "tailscaled.service")
|
2024-03-12 01:43:08 +00:00
|
|
|
(bindMountSvcDynamic "barf-fe" "barf-fe.service")
|
2020-12-26 23:36:34 +00:00
|
|
|
];
|
|
|
|
|
2021-12-24 02:02:57 +00:00
|
|
|
services.redis.servers."" = {
|
2020-12-28 19:09:55 +00:00
|
|
|
enable = true;
|
|
|
|
bind = "127.0.0.1";
|
|
|
|
};
|
2020-12-28 14:08:24 +00:00
|
|
|
services.pomerium = {
|
|
|
|
enable = true;
|
2022-03-11 14:40:55 +00:00
|
|
|
secretsFile = config.my.vault.secrets.pomerium.path;
|
2020-12-28 18:54:00 +00:00
|
|
|
|
2021-04-07 00:46:15 +00:00
|
|
|
settings = {
|
2020-12-28 18:54:00 +00:00
|
|
|
address = ":443";
|
|
|
|
http_redirect_addr = ":80";
|
2023-08-24 19:41:02 +00:00
|
|
|
dns_lookup_family = "AUTO";
|
2020-12-28 18:54:00 +00:00
|
|
|
|
|
|
|
idp_provider = "google";
|
|
|
|
idp_client_id = "136257844546-qsa6hi1oqqoq2bnt93deo4e70ggbn1p8.apps.googleusercontent.com";
|
2020-12-28 19:26:39 +00:00
|
|
|
idp_request_params = {
|
|
|
|
hd = "lukegb.com";
|
|
|
|
login_hint = "lukegb@lukegb.com";
|
|
|
|
};
|
2020-12-28 18:54:00 +00:00
|
|
|
|
2020-12-29 20:00:52 +00:00
|
|
|
jwt_claims_headers = [
|
|
|
|
"email"
|
|
|
|
"user"
|
|
|
|
];
|
|
|
|
|
2021-03-14 13:00:37 +00:00
|
|
|
timeout_read = "0"; # We have some long-lived connections...
|
|
|
|
timeout_write = "0";
|
|
|
|
timeout_idle = "0";
|
|
|
|
|
2020-12-28 18:54:00 +00:00
|
|
|
forward_auth_url = "https://fwdauth.int.lukegb.com";
|
|
|
|
authenticate_service_url = "https://auth.int.lukegb.com";
|
2020-12-30 00:57:53 +00:00
|
|
|
signout_redirect_url = "https://logged-out.int.lukegb.com";
|
2020-12-28 18:54:00 +00:00
|
|
|
|
2022-03-07 00:52:03 +00:00
|
|
|
certificates = [
|
|
|
|
{ cert = "/var/lib/acme/lukegb.com/fullchain.pem"; key = "/var/lib/acme/lukegb.com/privkey.pem"; }
|
|
|
|
];
|
|
|
|
|
2020-12-28 18:54:00 +00:00
|
|
|
policy = let
|
|
|
|
baseConfig = {
|
|
|
|
allowed_domains = [ "lukegb.com" ];
|
2020-12-29 20:00:52 +00:00
|
|
|
pass_identity_headers = true;
|
2021-03-18 23:50:54 +00:00
|
|
|
timeout = "30s";
|
2020-12-28 18:54:00 +00:00
|
|
|
};
|
2020-12-29 20:11:41 +00:00
|
|
|
service = server: hostName: extraConfig: baseConfig // {
|
2020-12-28 18:54:00 +00:00
|
|
|
from = "https://${hostName}";
|
|
|
|
to = "http://${server}";
|
|
|
|
preserve_host_header = true;
|
2020-12-29 20:11:41 +00:00
|
|
|
} // extraConfig;
|
|
|
|
secureService = server: hostName: extraConfig: service server hostName ({
|
|
|
|
to = "https://${server}";
|
|
|
|
tls_server_name = hostName;
|
|
|
|
} // extraConfig);
|
2020-12-30 00:57:53 +00:00
|
|
|
public = extraConfig: {
|
|
|
|
allow_public_unauthenticated_access = true;
|
|
|
|
allowed_domains = null;
|
|
|
|
} // extraConfig;
|
2020-12-29 20:11:41 +00:00
|
|
|
in [
|
2024-03-12 01:43:08 +00:00
|
|
|
(service "localhost:12001" "barf.lukegb.com" (public {}))
|
2023-03-12 03:15:34 +00:00
|
|
|
(service "cofractal-ams01.int.as205479.net" "int.lukegb.com" {})
|
|
|
|
(service "cofractal-ams01.int.as205479.net" "logged-out.int.lukegb.com" (public {}))
|
|
|
|
(service "cofractal-ams01.int.as205479.net" "sonarr.int.lukegb.com" {})
|
|
|
|
(service "cofractal-ams01.int.as205479.net" "radarr.int.lukegb.com" {})
|
|
|
|
(service "cofractal-ams01.int.as205479.net" "deluge.int.lukegb.com" {})
|
2023-07-21 16:47:47 +00:00
|
|
|
(service "cofractal-ams01.int.as205479.net" "content.int.lukegb.com" (public {
|
|
|
|
timeout = "0"; # Downloads can take a while; bump the timeout.
|
|
|
|
}))
|
2022-03-11 16:20:24 +00:00
|
|
|
(service "totoro.int.as205479.net:9090" "prometheus.int.lukegb.com" {})
|
|
|
|
(service "totoro.int.as205479.net:9093" "alertmanager.int.lukegb.com" {})
|
|
|
|
(service "totoro.int.as205479.net:3000" "grafana.int.lukegb.com" {})
|
2023-04-18 20:05:51 +00:00
|
|
|
(service "totoro.int.as205479.net:10908" "tumblrandom.int.lukegb.com" {})
|
2022-03-11 16:20:24 +00:00
|
|
|
(secureService "swann.int.as205479.net:8443" "unifi.int.lukegb.com" {
|
2021-01-03 15:32:00 +00:00
|
|
|
tls_skip_verify = true;
|
2021-01-04 21:15:43 +00:00
|
|
|
allow_websockets = true;
|
2021-03-18 23:50:54 +00:00
|
|
|
timeout = "0";
|
2021-01-03 15:32:00 +00:00
|
|
|
})
|
2022-03-11 16:20:24 +00:00
|
|
|
(service "blade-tuvok.int.as205479.net:7480" "objdump.zxcvbnm.ninja" (public {
|
2021-03-18 23:50:54 +00:00
|
|
|
timeout = "30m"; # Uploads can take a while; bump the timeout.
|
2021-03-14 13:00:37 +00:00
|
|
|
}))
|
2022-03-11 16:20:24 +00:00
|
|
|
(secureService "totoro.int.as205479.net" "invoices.lukegb.com" (public {
|
2020-12-29 20:11:41 +00:00
|
|
|
regex = "^/((third_party|ajax|client_area|pdf)/.*|[a-zA-Z0-9]{8})$";
|
2022-01-07 15:23:43 +00:00
|
|
|
tls_skip_verify = true;
|
2020-12-30 00:57:53 +00:00
|
|
|
}))
|
2022-03-11 16:20:24 +00:00
|
|
|
(secureService "totoro.int.as205479.net" "invoices.lukegb.com" {
|
2022-01-07 15:23:43 +00:00
|
|
|
tls_skip_verify = true;
|
|
|
|
})
|
2020-12-28 18:54:00 +00:00
|
|
|
(baseConfig // {
|
|
|
|
from = "https://httpbin.int.lukegb.com";
|
|
|
|
to = "https://verify.pomerium.com";
|
|
|
|
})
|
2022-03-11 16:20:24 +00:00
|
|
|
(service "bvm-twitterchiver.int.as205479.net:8080" "twitterchiver.int.lukegb.com" {})
|
|
|
|
(service "bvm-twitterchiver.int.as205479.net:8080" "twitterchiver.lukegb.com" {})
|
|
|
|
(service "bvm-nixosmgmt.int.as205479.net:4440" "rundeck.int.lukegb.com" {
|
2021-04-10 19:22:54 +00:00
|
|
|
set_request_headers = {
|
|
|
|
"X-Forwarded-Roles" = "pomerium";
|
|
|
|
};
|
|
|
|
})
|
2022-03-11 16:20:24 +00:00
|
|
|
(service "bvm-ipfs.int.as205479.net:5001" "ipfs.int.lukegb.com" {})
|
|
|
|
(service "bvm-ipfs.int.as205479.net:8080" "ipfs-gw.int.lukegb.com" {})
|
|
|
|
(service "bvm-netbox.int.as205479.net:80" "netbox.int.lukegb.com" {})
|
|
|
|
(service "localhost:9901" "envoy-debug.int.lukegb.com" {})
|
2022-04-05 23:57:22 +00:00
|
|
|
(service "bvm-paperless.int.as205479.net:28981" "paperless.int.lukegb.com" {
|
2022-04-06 10:49:52 +00:00
|
|
|
regex = "^/ws/.*";
|
|
|
|
allow_websockets = true;
|
|
|
|
timeout = "0";
|
|
|
|
})
|
|
|
|
(service "bvm-paperless.int.as205479.net:28981" "paperless.int.lukegb.com" {
|
|
|
|
regex = "^/api/.*";
|
|
|
|
timeout = "0";
|
2022-04-05 23:57:22 +00:00
|
|
|
})
|
2022-04-06 10:49:52 +00:00
|
|
|
(service "bvm-paperless.int.as205479.net:28981" "paperless.int.lukegb.com" {})
|
2022-08-14 17:10:49 +00:00
|
|
|
(service "totoro.int.as205479.net:1880" "nodered.int.lukegb.com" {
|
|
|
|
allow_websockets = true;
|
|
|
|
timeout = "0";
|
2023-08-19 22:43:34 +00:00
|
|
|
})
|
|
|
|
(service "totoro.int.as205479.net:3002" "code.int.lukegb.com" {
|
|
|
|
allow_websockets = true;
|
|
|
|
timeout = "0";
|
2024-10-13 13:42:52 +00:00
|
|
|
})
|
|
|
|
(service "totoro.int.as205479.net:8099" "zigbee2mqtt.int.lukegb.com" {
|
|
|
|
allow_websockets = true;
|
|
|
|
timeout = "0";
|
2022-08-14 17:10:49 +00:00
|
|
|
})
|
2020-12-28 18:54:00 +00:00
|
|
|
];
|
|
|
|
};
|
2020-12-28 14:08:24 +00:00
|
|
|
};
|
2021-04-07 00:46:15 +00:00
|
|
|
systemd.services.pomerium = {
|
|
|
|
wants = lib.mkAfter [ "redis.service" ];
|
|
|
|
after = lib.mkAfter [ "redis.service" ];
|
2022-03-07 00:52:03 +00:00
|
|
|
serviceConfig = {
|
|
|
|
SupplementaryGroups = [ "acme" ];
|
|
|
|
ReadOnlyPaths = [ "/var/lib/acme" ];
|
|
|
|
};
|
2020-12-28 14:08:24 +00:00
|
|
|
};
|
2022-03-07 00:52:03 +00:00
|
|
|
my.vault.acmeCertificates."lukegb.com" = {
|
2022-03-17 23:31:55 +00:00
|
|
|
hostnames = [
|
2022-01-04 14:00:45 +00:00
|
|
|
"lukegb.com"
|
|
|
|
"*.lukegb.com"
|
2022-03-11 03:27:58 +00:00
|
|
|
"*.int.lukegb.com"
|
2022-01-04 14:00:45 +00:00
|
|
|
"objdump.zxcvbnm.ninja"
|
|
|
|
];
|
2022-03-07 00:52:03 +00:00
|
|
|
reloadOrRestartUnits = [ "pomerium.service" ];
|
2020-12-28 14:08:24 +00:00
|
|
|
};
|
2022-03-11 14:40:55 +00:00
|
|
|
my.vault.secrets.pomerium = {
|
|
|
|
template = ''
|
|
|
|
{{ with secret "kv/apps/pomerium" }}
|
|
|
|
COOKIE_SECRET={{ .Data.data.cookieSecret }}
|
|
|
|
SHARED_SECRET={{ .Data.data.sharedSecret }}
|
|
|
|
IDP_CLIENT_SECRET={{ .Data.data.idpClientSecret }}
|
|
|
|
SIGNING_KEY={{ .Data.data.signingKey }}
|
2022-03-11 16:20:34 +00:00
|
|
|
IDP_SERVICE_ACCOUNT={{ .Data.data.googleServiceAccount }}
|
2022-03-11 14:40:55 +00:00
|
|
|
{{ end }}
|
|
|
|
'';
|
|
|
|
group = "root";
|
|
|
|
reloadOrRestartUnits = [ "pomerium.service" ];
|
|
|
|
};
|
2022-03-11 03:27:58 +00:00
|
|
|
users.groups.acme = {};
|
2020-12-28 14:08:24 +00:00
|
|
|
|
2022-08-26 20:00:43 +00:00
|
|
|
system.stateVersion = "22.11";
|
2020-12-26 23:36:34 +00:00
|
|
|
}
|