File tree Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Original file line number Diff line number Diff line change 77 ./random-alerts
88 ./host-info.nix
99 ./secrets.nix
10+ ./pharos
1011 ] ;
1112}
Original file line number Diff line number Diff line change 1+ { ... } :
2+ {
3+ flake . modules . nixos . pharos =
4+ {
5+ config ,
6+ lib ,
7+ ...
8+ } :
9+ let
10+ cfg = config . services . pharos ;
11+ in
12+ {
13+ options . services . pharos = with lib ; {
14+ enable = mkEnableOption ( lib . mdDoc "Pharos" ) ;
15+ network = mkOption {
16+ type = types . enum [
17+ "testnet"
18+ "devnet"
19+ "mainnet"
20+ ] ;
21+ default = "testnet" ;
22+ description = "Network to connect to" ;
23+ } ;
24+ } ;
25+ config = {
26+ virtualisation . oci-containers . containers . "pharos-${ cfg . network } " = {
27+ image =
28+ {
29+ "testnet" = "public.ecr.aws/k2g7b7g1/pharos/testnet:63b85b6b" ;
30+ "devnet" = "public.ecr.aws/k2g7b7g1/pharos:latest" ;
31+ }
32+ . "${ cfg . testnet } " ;
33+ volumes = [
34+ "/var/lib/pharos-${ cfg . network } :/data"
35+ ] ;
36+ ports = [
37+ "18100:18100"
38+ "18200:18200"
39+ "19000:19000"
40+ ] ;
41+ } ;
42+ assertions = [
43+ {
44+ assertion = cfg . network == "mainnet" ;
45+ message = "Pharos is not available on mainnet yet" ;
46+ }
47+ ] ;
48+ system . activationScripts . "pharos-${ cfg . network } " = ''
49+ mkdir -p /var/lib/pharos-${ cfg . network }
50+ '' ;
51+ } ;
52+ } ;
53+ }
You can’t perform that action at this time.
0 commit comments