nixos/ipfs: always expose sockets

wip/yesman
Matthew Bauer 4 years ago
parent fa06d8f961
commit 982a17a48e
  1. 5
      nixos/modules/services/network-filesystems/ipfs.nix
  2. 7
      nixos/tests/ipfs.nix

@ -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" ];
};
};

@ -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"
)
'';
})

Loading…
Cancel
Save