summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2020-06-11 16:59:38 -0500
committerMatthew Bauer <mjbauer95@gmail.com>2020-06-12 17:15:34 -0500
commit982a17a48e454df80c5ab84de0e17948462f8970 (patch)
tree97c450b34ab8b995a4189dc32de4e753eece34af
parentfa06d8f96121daa8863b57dfd9f99e8237c07afe (diff)
downloadnixpkgs-982a17a48e454df80c5ab84de0e17948462f8970.tar
nixpkgs-982a17a48e454df80c5ab84de0e17948462f8970.tar.gz
nixpkgs-982a17a48e454df80c5ab84de0e17948462f8970.tar.bz2
nixpkgs-982a17a48e454df80c5ab84de0e17948462f8970.tar.lz
nixpkgs-982a17a48e454df80c5ab84de0e17948462f8970.tar.xz
nixpkgs-982a17a48e454df80c5ab84de0e17948462f8970.tar.zst
nixpkgs-982a17a48e454df80c5ab84de0e17948462f8970.zip
nixos/ipfs: always expose sockets
-rw-r--r--nixos/modules/services/network-filesystems/ipfs.nix5
-rw-r--r--nixos/tests/ipfs.nix7
2 files changed, 10 insertions, 2 deletions
diff --git a/nixos/modules/services/network-filesystems/ipfs.nix b/nixos/modules/services/network-filesystems/ipfs.nix
index 7c376207db4..a5f514974f2 100644
--- a/nixos/modules/services/network-filesystems/ipfs.nix
+++ b/nixos/modules/services/network-filesystems/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" ];
     };
 
   };
diff --git a/nixos/tests/ipfs.nix b/nixos/tests/ipfs.nix
index 4d721aec0c7..82234f96922 100644
--- a/nixos/tests/ipfs.nix
+++ b/nixos/tests/ipfs.nix
@@ -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"
+    )
   '';
 })