This repository has no description
1.9 kB
72 lines
1{ config, pkgs, ... }:
2{
3 krebs.sync-containers3.containers.yellow = {
4 sshKey = config.clan.core.vars.generators.yellow-container.files."yellow.sync.key".path;
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 containers.yellow.bindMounts."/var/lib/ipfs/cid-map.txt" = {
20 hostPath = "/var/lib/ipfs/cid-map.txt";
21 isReadOnly = true;
22 };
23 networking.firewall.allowedTCPPorts = [
24 8096
25 8920
26 ];
27 networking.firewall.allowedUDPPorts = [
28 1900
29 7359
30 ];
31 containers.yellow.forwardPorts = [
32 {
33 hostPort = 8096;
34 containerPort = 8096;
35 protocol = "tcp";
36 }
37 {
38 hostPort = 8920;
39 containerPort = 8920;
40 protocol = "tcp";
41 }
42 {
43 hostPort = 1900;
44 containerPort = 1900;
45 protocol = "udp";
46 }
47 {
48 hostPort = 7359;
49 containerPort = 7359;
50 protocol = "udp";
51 }
52 ];
53
54 services.nginx.virtualHosts."flix.lassul.us" = {
55 # forceSSL = true;
56 # enableACME = true;
57 locations."/" = {
58 proxyPass = "http://yellow.r:8096";
59 proxyWebsockets = true;
60 recommendedProxySettings = true;
61 };
62 };
63 clan.core.vars.generators.yellow-container = {
64 files."yellow.sync.key" = { };
65 prompts.key.description = ''
66 copy or reference the secret key from the container into here, so we can actually start/sync the container
67 '';
68 script = ''
69 cat "$prompts"/key > "$out"/yellow.sync.key
70 '';
71 };
72}