diff options
author | Artturi <Artturin@artturin.com> | 2022-06-28 19:55:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-28 19:55:10 +0300 |
commit | 3cff3f75b4b951a7e24da086e78c172ec482cea9 (patch) | |
tree | b9e528e433440ed1ab0b0ebe76cac1bf8d7d42aa /nixos | |
parent | 0646a9b3ab52dd487c7382134187e0881daa815d (diff) | |
parent | 664dab95743b9e11402d41dbedb1c8da6af163f6 (diff) | |
download | nixpkgs-3cff3f75b4b951a7e24da086e78c172ec482cea9.tar nixpkgs-3cff3f75b4b951a7e24da086e78c172ec482cea9.tar.gz nixpkgs-3cff3f75b4b951a7e24da086e78c172ec482cea9.tar.bz2 nixpkgs-3cff3f75b4b951a7e24da086e78c172ec482cea9.tar.lz nixpkgs-3cff3f75b4b951a7e24da086e78c172ec482cea9.tar.xz nixpkgs-3cff3f75b4b951a7e24da086e78c172ec482cea9.tar.zst nixpkgs-3cff3f75b4b951a7e24da086e78c172ec482cea9.zip |
Merge pull request #166340 from max-privatevoid/patch-6
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/network-filesystems/ipfs.nix | 2 | ||||
-rw-r--r-- | nixos/tests/ipfs.nix | 15 |
2 files changed, 16 insertions, 1 deletions
diff --git a/nixos/modules/services/network-filesystems/ipfs.nix b/nixos/modules/services/network-filesystems/ipfs.nix index a5f8f55a682..b7e6a787cfb 100644 --- a/nixos/modules/services/network-filesystems/ipfs.nix +++ b/nixos/modules/services/network-filesystems/ipfs.nix @@ -283,7 +283,7 @@ in User = cfg.user; Group = cfg.group; StateDirectory = ""; - ReadWritePaths = [ "" cfg.dataDir ]; + ReadWritePaths = optionals (!cfg.autoMount) [ "" cfg.dataDir ]; } // optionalAttrs (cfg.serviceFdlimit != null) { LimitNOFILE = cfg.serviceFdlimit; }; } // optionalAttrs (!cfg.startWhenNeeded) { wantedBy = [ "default.target" ]; diff --git a/nixos/tests/ipfs.nix b/nixos/tests/ipfs.nix index 5e7c967028e..295a7b9c727 100644 --- a/nixos/tests/ipfs.nix +++ b/nixos/tests/ipfs.nix @@ -14,6 +14,14 @@ import ./make-test-python.nix ({ pkgs, ...} : { }; }; + nodes.fuse = { ... }: { + services.ipfs = { + enable = true; + apiAddress = "/ip4/127.0.0.1/tcp/2324"; + autoMount = true; + }; + }; + testScript = '' start_all() @@ -40,5 +48,12 @@ import ./make-test-python.nix ({ pkgs, ...} : { # Test if setting dataDir works properly with the hardened systemd unit machine.succeed("test -e /mnt/ipfs/config") machine.succeed("test ! -e /var/lib/ipfs/") + + # Test FUSE mountpoint + ipfs_hash = fuse.succeed( + "echo fnord3 | ipfs --api /ip4/127.0.0.1/tcp/2324 add --quieter" + ) + + fuse.succeed(f"cat /ipfs/{ipfs_hash.strip()} | grep fnord3") ''; }) |