forked from
lass.pds.lassul.us/superconfig
This repository has no description
1.5 kB
60 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
20 networking.firewall.allowedTCPPorts = [
21 8096
22 8920
23 ];
24 networking.firewall.allowedUDPPorts = [
25 1900
26 7359
27 ];
28 containers.yellow.forwardPorts = [
29 {
30 hostPort = 8096;
31 containerPort = 8096;
32 protocol = "tcp";
33 }
34 {
35 hostPort = 8920;
36 containerPort = 8920;
37 protocol = "tcp";
38 }
39 {
40 hostPort = 1900;
41 containerPort = 1900;
42 protocol = "udp";
43 }
44 {
45 hostPort = 7359;
46 containerPort = 7359;
47 protocol = "udp";
48 }
49 ];
50
51 clan.core.vars.generators.yellow-container = {
52 files."yellow.sync.key" = { };
53 prompts.key.description = ''
54 copy or reference the secret key from the container into here, so we can actually start/sync the container
55 '';
56 script = ''
57 cat "$prompts"/key > "$out"/yellow.sync.key
58 '';
59 };
60}