File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 103103 } ;
104104 in
105105 {
106+ hydraJobs = {
107+ vps = self . nixosConfigurations . vps . config . system . build . toplevel ;
108+ } ;
109+
106110 nixosConfigurations = {
107111 "vps" = nixpkgs . lib . nixosSystem (
108112 let
Original file line number Diff line number Diff line change @@ -129,6 +129,7 @@ https://*.polyfrost.org {
129129 @dex host dex.polyfrost.org
130130 @plus-staging host plus-staging.polyfrost.org
131131 @plus-admin host plus-admin.polyfrost.org
132+ @hydra host hydra.polyfrost.org
132133
133134 # Handle all other containers
134135 handle @grafana {
@@ -166,6 +167,10 @@ https://*.polyfrost.org {
166167 }
167168 }
168169
170+ handle @hydra {
171+ reverse_proxy host.containers:3000
172+ }
173+
169174 # Handle all unmatched requests as a 404
170175 handle {
171176 error "Not Found" 404
Original file line number Diff line number Diff line change 1313 containerIps :
1414 lib . mapAttrs' ( name : value : lib . attrsets . nameValuePair value [ "${ name } .containers" ] ) containerIps ;
1515 in
16- ( mkHosts ips . v4 . containers ) // ( mkHosts ips . v6 . containers ) ;
16+ ( mkHosts ips . v4 . containers ) // ( mkHosts ips . v6 . containers ) // {
17+ "${ ips . v4 . host } " = [ "host.containers" ] ;
18+ "${ ips . v6 . host } " = [ "host.containers" ] ;
19+ } ;
1720
1821 services . caddy = {
1922 enable = true ;
2326 "github.com/caddy-dns/cloudflare@v0.2.2-0.20250506153119-35fb8474f57d"
2427 "github.com/WeidiDeng/caddy-cloudflare-ip@v0.0.0-20231130002422-f53b62aa13cb"
2528 ] ;
26- hash = "sha256-MhLXRQd6EjQ/yfOpMbr6X/sIXgdhQwXaxkIBmUKAK2I =" ;
29+ hash = "sha256-ldD2gIlEthnLbRckH+BPKKde95gNPEJbXHTQEjBnE0Q =" ;
2730 } ;
2831
2932 configFile = ./Caddyfile ;
Original file line number Diff line number Diff line change 55
66 ./backend
77 ./caddy
8+ ./hydra
89 ./monitoring
910 ./plus
1011 ./polyhelper
Original file line number Diff line number Diff line change 1+ { config , ... } :
2+ {
3+ services . hydra = {
4+ enable = true ;
5+ hydraURL = "https://hydra.polyfrost.org" ;
6+ useSubstitutes = true ;
7+ dbi = "dbi:Pg:dbname=hydra;host=${ config . custom . nixos-containers . networking . addresses . v6 . containers . postgres } ;user=hydra" ;
8+ port = 3000 ;
9+ listenHost = "*" ;
10+ notificationSender = "hydra@localhost" ;
11+ extraConfig = ''
12+ allow_import_from_derivation = true
13+ '' ;
14+ } ;
15+ }
Original file line number Diff line number Diff line change 3030 } ;
3131
3232 analytics . reporting_enabled = false ;
33+
34+ security . secret_key = "SW2YcwTIb9zpOOhoPsMm" ; # yes this is the default from nix. no i don't care. anyone can decrypt the database if they get access to it
3335 } ;
3436
3537 provision = {
Original file line number Diff line number Diff line change 3636 networking = {
3737 # Let containers access host ports conditionally
3838 firewall . extraInputRules = ''
39+ ip saddr ${ containerIps . v4 . containers . caddy } tcp dport 3000 accept comment "Allow caddy to access hydra"
40+ ip6 saddr ${ containerIps . v6 . containers . caddy } tcp dport 3000 accept comment "Allow caddy to access hydra"
41+
3942 ip saddr ${ containerIps . v4 . containers . monitoring } tcp dport 9100 accept comment "Allow monitoring to access node exporter"
4043 ip6 saddr ${ containerIps . v6 . containers . monitoring } tcp dport 9100 accept comment "Allow monitoring to access node exporter"
4144 '' ;
Original file line number Diff line number Diff line change 1111 "forgejo" = ips . v6 . containers . forgejo ;
1212 "dex" = ips . v6 . containers . dex ;
1313 "plus" = ips . v6 . containers . plus ;
14+ "hydra" = ips . v6 . host ;
1415 } ;
1516 mkAuthEntry =
1617 { name , value } :
Original file line number Diff line number Diff line change 3939 ( final : prev : {
4040 inherit ( prev . lixPackageSets . stable )
4141 nixpkgs-review
42- nix-eval-jobs
42+ # nix-eval-jobs
4343 nix-fast-build
4444 colmena
4545 ;
You can’t perform that action at this time.
0 commit comments