mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-11-09 18:47:02 +00:00
ipfs: remove modes
This commit is contained in:
parent
ad78983ef3
commit
0098774d8f
1 changed files with 8 additions and 24 deletions
|
@ -1,33 +1,10 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.sconfig.ipfs;
|
cfg = config.sconfig.ipfs;
|
||||||
|
|
||||||
modes = {
|
|
||||||
server = {
|
|
||||||
AutoNAT.ServiceMode = "disabled"; # maybe change this to "enabled" ?
|
|
||||||
Reprovider.Strategy = "pinned";
|
|
||||||
Routing.Type = "dhtclient"; # maybe change this to "dht" ?
|
|
||||||
Swarm.ConnMgr.HighWater = 900;
|
|
||||||
Swarm.ConnMgr.LowWater = 600;
|
|
||||||
Swarm.DisableNatPortMap = true; # Disable UPnP
|
|
||||||
};
|
|
||||||
desktop = {
|
|
||||||
AutoNAT.ServiceMode = "disabled";
|
|
||||||
Reprovider.Strategy = "pinned";
|
|
||||||
Routing.Type = "dhtclient";
|
|
||||||
Swarm.ConnMgr.HighWater = 300;
|
|
||||||
Swarm.ConnMgr.LowWater = 50;
|
|
||||||
Swarm.DisableNatPortMap = true; # Disable UPnP
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.sconfig.ipfs = {
|
options.sconfig.ipfs = {
|
||||||
|
|
||||||
enable = lib.mkEnableOption "Turn on IPFS";
|
enable = lib.mkEnableOption "Turn on IPFS";
|
||||||
mode = lib.mkOption { type = lib.types.enum [ "server" "desktop" ]; };
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
@ -35,10 +12,17 @@ in
|
||||||
services.ipfs = {
|
services.ipfs = {
|
||||||
enable = true;
|
enable = true;
|
||||||
emptyRepo = true;
|
emptyRepo = true;
|
||||||
extraConfig = modes.${cfg.mode};
|
|
||||||
gatewayAddress = "/ip4/127.0.0.1/tcp/8001";
|
gatewayAddress = "/ip4/127.0.0.1/tcp/8001";
|
||||||
# Had issues without fdlimit. 65536 value taken from nixpkgs example
|
# Had issues without fdlimit. 65536 value taken from nixpkgs example
|
||||||
serviceFdlimit = 65536;
|
serviceFdlimit = 65536;
|
||||||
|
extraConfig = {
|
||||||
|
AutoNAT.ServiceMode = "disabled"; # maybe "enabled" for servers?
|
||||||
|
Reprovider.Strategy = "pinned";
|
||||||
|
Routing.Type = "dhtclient"; # maybe "dht" for servers?
|
||||||
|
Swarm.ConnMgr.HighWater = 1000;
|
||||||
|
Swarm.ConnMgr.LowWater = 50;
|
||||||
|
Swarm.DisableNatPortMap = true; # Disable UPnP
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.ipfs.postStart = ''
|
systemd.services.ipfs.postStart = ''
|
||||||
|
|
Loading…
Reference in a new issue