Commit graph

42 commits

Author SHA1 Message Date
Luflosi 2b02b34029
nixos/ipfs: replace deprecated command line option
According to https://docs.ipfs.io/reference/cli/#ipfs the --local command line option is deprecated and should be replaced with --offline.
2021-06-30 17:32:38 +02:00
Luflosi b32b56cd54
nixos/ipfs: remove separate ipfs-init systemd unit
There is no need for a separate unit. Simplify the NixOS module by adding the shell code to preStart of the main unit, where the other initialization code already is.
2021-04-22 21:13:05 +02:00
Luflosi 5ff547e729
nixos/ipfs: fix typo in comment
This typo was introduced in 4044d81d5c.
2021-04-21 21:49:48 +02:00
Fabián Heredia Montiel acd3d3dd20 nixos/modules/services/network-filesystems/ipfs: refactor
Add `package` option to change the package used for the service.
2020-11-03 17:35:06 -06:00
John Ericson e6fe9abd8b nixos/ipfs: Allow QUIC connections to socket activate too
Well, via the underlying UDP. QUIC-level socket activation we'll get
someday.
2020-08-11 22:08:19 +00:00
Luflosi 4d9dec0aba
nixos/ipfs: add QUIC transport to swarmAddress list
According to https://github.com/ipfs/go-ipfs/blob/master/docs/config.md#addressesswarm, the default list of swarm multiaddrs now includes the QUIC transport.
2020-08-08 23:08:56 +02:00
John Ericson 4044d81d5c IPFS NixOS module: Socket unit file more precise
The systemd socket unit files now more precisely track the IPFS
configuration, by including any multaddr they can make a `ListenStream`
for. (The daemon doesn't currently support anything which would use
`ListDatagram`, so we don't need to worry about that.)

The tests use some of these features.
2020-06-17 21:43:04 +00:00
Matthew Bauer 2c2f6c0b38 nixos/ipfs: only set listenstream when gateway/api is default 2020-06-12 17:15:34 -05:00
Matthew Bauer 982a17a48e nixos/ipfs: always expose sockets 2020-06-12 17:15:34 -05:00
Matthew Bauer fa06d8f961 nixos/ipfs: actually use upstream systemd units 2020-06-12 17:15:34 -05:00
Matthew Bauer b36ef706fb nixos/ipfs: add startWhenNeeded option
This makes it possible to only start IPFS when needed. So a user’s
IPFS daemon only starts when they actually use it.

A few important warnings though:

  - This probably shouldn’t be mixed with services.ipfs.autoMount
    since you want /ipfs and /ipns aren’t activated like this
  - ipfs.socket assumes that you are using ports 5001 and 8080 for the
    API and gateway respectively. We could do some parsing to figure
    out what is in apiAddress and gatewayAddress, but that’s kind of
    difficult given the nonstandard address format.
  - Apparently? this doesn’t work with the --api commands used in the tests.

Of course you can always start automatically with startWhenNeeded =
false, or just running ‘systemctl start ipfs.service’.

Tested with the following test (modified from tests/ipfs.nix):

  import ./make-test-python.nix ({ pkgs, ...} : {
    name = "ipfs";

    nodes.machine = { ... }: {
      services.ipfs = {
        enable = true;
        startWhenNeeded = true;
      };
    };

    testScript = ''
      start_all()

      machine.wait_until_succeeds("ipfs id")
      ipfs_hash = machine.succeed("echo fnord | ipfs add | awk '{ print $2 }'")

      machine.succeed(f"ipfs cat /ipfs/{ipfs_hash.strip()} | grep fnord")
    '';
  })

Fixes #90145

Update nixos/modules/services/network-filesystems/ipfs.nix

Co-authored-by: Florian Klink <flokli@flokli.de>
2020-06-12 17:15:27 -05:00
Matthew Bauer c5f40198f3 nixos/ipfs: consolidate services into one ipfs.service
Previously we had three services for different config flavors. This is
confusing because only one instance of IPFS can run on a host / port
combination at once. So move all into ipfs.service, which contains the
configuration specified in services.ipfs.

Also remove the env wrapper and just use systemd env configuration.
2020-06-11 15:27:22 -05:00
Matthew Bauer 74ff433320 nixos/ipfs: remove unused auto migrate feature 2020-06-11 14:32:06 -05:00
Dietrich Daroch 735c9a70d7 Services,IPFS,Fix: Require the ipfs-migrator package for handling upgrades.
Without it, the services get stuck on startup when the IPFS repo needs upgrades.
2020-05-13 00:15:50 -07:00
Nathan Fish 496899068e ipfs: remove ipfs repo fsck
https://github.com/NixOS/nixpkgs/pull/86242#issuecomment-621469759
2020-05-05 22:19:06 +00:00
Florian Klink f74735c9d7 nixos: remove dependencies on local-fs.target
Since https://github.com/NixOS/nixpkgs/pull/61321, local-fs.target is
part of sysinit.target again, meaning units without
DefaultDependencies=no will automatically depend on it, and the manual
set dependencies can be dropped.
2019-09-01 19:06:38 +02:00
Michael Weiss 2473d902e6
nixos/fuse: init
Add a module for /etc/fuse.conf.
Fixes #30923.
2019-08-11 16:13:23 +02:00
Aaron Andersen b7f376c01b nixos/ipfs: replace deprecated usage of PermissionsStartOnly
see https://github.com/NixOS/nixpkgs/issues/53852
2019-04-13 07:00:59 -04:00
Symphorien Gibol a915b33315 nixos: add preferLocalBuild=true; on derivations for config files 2019-02-22 20:11:27 +01:00
Emery Hemingway 124d8ccc69
Add IPFS warning 2018-12-22 20:04:19 +01:00
Tuomas Tynkkynen 96190535e5 Revert "nixos: rename system.{stateVersion,defaultChannel} -> system.nixos.\1"
This reverts commit 095fe5b43d.

Pointless renames considered harmful. All they do is force people to
spend extra work updating their configs for no benefit, and hindering
the ability to switch between unstable and stable versions of NixOS.

Like, what was the value of having the "nixos." there? I mean, by
definition anything in a NixOS module has something to do with NixOS...
2018-07-28 00:12:55 +03:00
Florian Klink fff5923686 nixos/modules: users.(extraUsers|extraGroup->users|group) 2018-06-30 03:02:58 +02:00
Sebastian Jordan 2009c76a66 nixos/ipfs: Improve behavior of localDiscovery option
It is no longer required to change the config your ipfs repo manually if you change
localDiscovery option in nixos configuration after ipfs repository initialization.
2018-05-23 16:44:31 +02:00
Sebastian Jordan 1bf798b8cb nixos/ipfs: Add option to disable local port scanning for ipfs daemon 2018-05-21 14:16:47 +02:00
Jan Malakhovski 095fe5b43d nixos: rename system.{stateVersion,defaultChannel} -> system.nixos.\1 2018-05-12 19:27:09 +00:00
Eric Litak d0b9d13618 ipfs: add swarmAddress option 2017-11-25 22:56:07 -08:00
Eric Litak f46616db5a ipfs: disable autoMigrate option for now 2017-09-29 18:07:55 -07:00
Eric Litak 1a15c5d8c6 ipfs: autoMount working without root 2017-09-17 23:57:25 -07:00
Eric Litak 6324317c76 ipfs: workaround for upstream bug; doc fixes 2017-09-17 23:57:25 -07:00
Eric Litak 5050c56382 ipfs: adding mountDir options but disabling broken autoMount 2017-08-30 08:24:38 -07:00
Eric Litak 5554ea5583 ipfs: preStart configuration moved into daemon services 2017-08-30 08:17:34 -07:00
Eric Litak ba976021af ipfs: refactor; wrapper adjustment 2017-08-30 08:17:34 -07:00
Eric Litak 952424217b ipfs: optionally manage ulimit -n in serviceConfig 2017-08-30 08:17:34 -07:00
Eric Litak 5f9bad6ceb ipfs: add extraConfig option 2017-08-30 08:17:34 -07:00
Eric Litak a48a2c4f78 ipfs: add autoMount option 2017-08-30 08:17:34 -07:00
Maximilian Güntner 0f02879e01
ipfs: added defaultMode, added norouting service 2017-08-17 03:30:57 +02:00
Silvan Mosberger df8a7d956d ipfs service: dataDir backwards compatibility (#25782)
Fixes dataDir existance detection. Fixes #25759, #26069.
2017-05-24 20:51:02 +02:00
Silvan Mosberger 91ee3530a7 ipfs service: Fix dataDir being ignored
IPFS uses the environment variable IPFS_PATH to determine where to look for it's data, which wasn't set previously therefore ignoring the dataDir attribute
2017-05-05 11:25:36 +02:00
Maximilian Güntner 123dd9f4e7
services: ipfs: separate system units, add offline mode
Offline mode: When adding a lot of data, start this service.
It will will not flood the DHT since it only exposes the API.
When you are done simply reverse the process.
2017-01-27 00:27:50 +01:00
Maximilian Güntner a541f86f8b
services: ipfs: add emptyRepo option, refactor 2017-01-14 04:01:43 +01:00
Maximilian Güntner 0526a5c90a
services: add gatewayAddress and apiAddress to ipfs
Signed-off-by: Maximilian Güntner <code@klandest.in>
2016-11-28 15:33:51 +01:00
Maximilian Güntner 7fa157c558
services: Add Interplanetary File System service
Signed-off-by: Maximilian Güntner <code@klandest.in>
2016-11-07 22:01:38 +01:00