Skip to content

Commit 847624a

Browse files
committed
clean up flake config
1 parent 2a65a22 commit 847624a

File tree

2 files changed

+21
-17
lines changed

2 files changed

+21
-17
lines changed

flake.nix

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
in {
3535
devShells.default = pkgsWithOverlays.mkShell {
3636
packages = (with pkgsWithOverlays; [
37-
# Includes cargo, clippy, cargo-fmt, rustdoc, rustfmt, and other tools.
3837
rust-toolchain
3938
foundry-bin
4039
solc
@@ -91,6 +90,13 @@
9190
anvil
9291
];
9392

93+
cli = {
94+
# environment.PC_DISABLE_TUI = true;
95+
options = {
96+
port = 8881;
97+
};
98+
};
99+
94100
services.postgres."postgres-unit" = mkPostgresConfig {
95101
name = "graph-test";
96102
port = 5432;
@@ -103,9 +109,8 @@
103109
services.ipfs."ipfs-unit" = {
104110
enable = true;
105111
dataDir = "./.data/unit/ipfs";
106-
apiPort = 5001;
112+
port = 5001;
107113
gatewayPort = 8080;
108-
swarmPort = 4001;
109114
};
110115
};
111116

@@ -117,6 +122,13 @@
117122
anvil
118123
];
119124

125+
cli = {
126+
# environment.PC_DISABLE_TUI = true;
127+
options = {
128+
port = 8882;
129+
};
130+
};
131+
120132
services.postgres."postgres-integration" = mkPostgresConfig {
121133
name = "graph-node";
122134
port = 3011;
@@ -129,9 +141,8 @@
129141
services.ipfs."ipfs-integration" = {
130142
enable = true;
131143
dataDir = "./.data/integration/ipfs";
132-
apiPort = 3001;
144+
port = 3001;
133145
gatewayPort = 3002;
134-
swarmPort = 4001;
135146
};
136147

137148
services.anvil."anvil-integration" = {

nix/ipfs.nix

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
options = {
44
package = lib.mkPackageOption pkgs "kubo" { };
55

6-
apiPort = lib.mkOption {
6+
port = lib.mkOption {
77
type = lib.types.port;
88
default = 5001;
99
description = "Port for IPFS API";
@@ -14,12 +14,6 @@
1414
default = 8080;
1515
description = "Port for IPFS gateway";
1616
};
17-
18-
swarmPort = lib.mkOption {
19-
type = lib.types.port;
20-
default = 4001;
21-
description = "Port for IPFS swarm";
22-
};
2317
};
2418

2519
config = {
@@ -29,11 +23,10 @@
2923
if [ ! -f "${config.dataDir}/config" ]; then
3024
mkdir -p "${config.dataDir}"
3125
${lib.getExe config.package} init
32-
${lib.getExe config.package} config Addresses.API /ip4/127.0.0.1/tcp/${toString config.apiPort}
26+
${lib.getExe config.package} config Addresses.API /ip4/127.0.0.1/tcp/${toString config.port}
3327
${lib.getExe config.package} config Addresses.Gateway /ip4/127.0.0.1/tcp/${toString config.gatewayPort}
34-
${lib.getExe config.package} config Addresses.Swarm '["/ip4/0.0.0.0/tcp/${toString config.swarmPort}", "/ip6/::/tcp/${toString config.swarmPort}"]' --json
3528
fi
36-
${lib.getExe config.package} daemon
29+
${lib.getExe config.package} daemon --offline
3730
'';
3831

3932
environment = {
@@ -47,8 +40,8 @@
4740
readiness_probe = {
4841
http_get = {
4942
host = "localhost";
50-
port = config.apiPort;
51-
path = "/ipfs/bafybeibfd5kbebqqruouji6ct5qku3tay273g7mt24mmrfzrsfeewaal5y";
43+
port = config.port;
44+
path = "/version";
5245
};
5346
initial_delay_seconds = 5;
5447
period_seconds = 3;

0 commit comments

Comments
 (0)