This repository has no description
1.7 kB
68 lines
1{ config, pkgs, ... }:
2{
3 krebs.sync-containers3.containers.yellow = {
4 sshKey = "${config.krebs.secret.directory}/yellow.sync.key";
5 startCommand = ''
6 export PATH=$PATH:${pkgs.git}/bin
7 until ${pkgs.dig.host}/bin/host github.com; do sleep 1; done
8 ${pkgs.nixos-rebuild}/bin/nixos-rebuild --refresh --flake github:lassulus/superconfig#yellow switch --no-write-lock-file
9 '';
10 };
11 containers.yellow.bindMounts."/var/lib" = {
12 hostPath = "/var/lib/sync-containers3/yellow/state";
13 isReadOnly = false;
14 };
15 containers.yellow.bindMounts."/var/download" = {
16 hostPath = "/var/download";
17 isReadOnly = false;
18 };
19 networking.firewall.allowedTCPPorts = [
20 8096
21 8920
22 ];
23 networking.firewall.allowedUDPPorts = [
24 1900
25 7359
26 ];
27 containers.yellow.forwardPorts = [
28 {
29 hostPort = 8096;
30 containerPort = 8096;
31 protocol = "tcp";
32 }
33 {
34 hostPort = 8920;
35 containerPort = 8920;
36 protocol = "tcp";
37 }
38 {
39 hostPort = 1900;
40 containerPort = 1900;
41 protocol = "udp";
42 }
43 {
44 hostPort = 7359;
45 containerPort = 7359;
46 protocol = "udp";
47 }
48 ];
49
50 services.nginx.virtualHosts."flix.lassul.us" = {
51 # forceSSL = true;
52 # enableACME = true;
53 locations."/" = {
54 proxyPass = "http://yellow.r:8096";
55 proxyWebsockets = true;
56 recommendedProxySettings = true;
57 };
58 };
59 clan.core.vars.generators.yellow-container = {
60 files."yellow.sync.key" = { };
61 prompts.key.description = ''
62 copy or reference the secret key from the container into here, so we can actually start/sync the container
63 '';
64 script = ''
65 cat "$prompts"/key > "$out"/yellow.sync.key
66 '';
67 };
68}