nixos/ipfs: always expose sockets

This commit is contained in:
Matthew Bauer 2020-06-11 16:59:38 -05:00
parent fa06d8f961
commit 982a17a48e
2 changed files with 10 additions and 2 deletions

View file

@ -249,12 +249,13 @@ in {
# Note the upstream service assumes default host / port
# we should override it when a custom is provided above.
systemd.sockets.ipfs-gateway = mkIf cfg.startWhenNeeded {
systemd.sockets.ipfs-gateway = {
wantedBy = [ "sockets.target" ];
};
systemd.sockets.ipfs-api = mkIf cfg.startWhenNeeded {
systemd.sockets.ipfs-api = {
wantedBy = [ "sockets.target" ];
socketConfig.ListenStream = [ "%t/ipfs.sock" ];
};
};

View file

@ -21,5 +21,12 @@ import ./make-test-python.nix ({ pkgs, ...} : {
)
machine.succeed(f"ipfs cat /ipfs/{ipfs_hash.strip()} | grep fnord")
ipfs_hash = machine.succeed(
"echo fnord2 | ipfs --api /unix/run/ipfs.sock add | awk '{ print $2 }'"
)
machine.succeed(
f"ipfs --api /unix/run/ipfs.sock cat /ipfs/{ipfs_hash.strip()} | grep fnord2"
)
'';
})