diff --git a/cluster/services/ipfs/default.nix b/cluster/services/ipfs/default.nix new file mode 100644 index 0000000..6aff0a8 --- /dev/null +++ b/cluster/services/ipfs/default.nix @@ -0,0 +1,19 @@ +{ tools, ... }: + +{ + services.ipfs = { + nodes = { + node = [ "VEGAS" "prophet" ]; + gateway = [ "VEGAS" ]; + }; + nixos = { + node = [ + ./node.nix + ]; + gateway = [ + ./gateway.nix + ./monitoring.nix + ]; + }; + }; +} diff --git a/hosts/VEGAS/services/ipfs/default.nix b/cluster/services/ipfs/gateway.nix similarity index 87% rename from hosts/VEGAS/services/ipfs/default.nix rename to cluster/services/ipfs/gateway.nix index 0f93fc7..ec22343 100644 --- a/hosts/VEGAS/services/ipfs/default.nix +++ b/cluster/services/ipfs/gateway.nix @@ -1,4 +1,4 @@ -{ aspect, config, hosts, tools, ... }: +{ config, hosts, tools, ... }: with tools.nginx; let inherit (tools.meta) domain; @@ -6,22 +6,11 @@ let gw = config.links.ipfsGateway; in { - imports = [ - aspect.modules.ipfs - ]; - systemd.services.ipfs = { serviceConfig = { LimitNOFILE = 524288; IOSchedulingPriority = 7; }; - environment = { - OTEL_TRACES_EXPORTER = "otlp"; - OTEL_EXPORTER_OTLP_PROTOCOL = "grpc"; - OTEL_EXPORTER_OTLP_ENDPOINT = config.links.tempo-otlp-grpc.url; - OTEL_TRACES_SAMPLER = "parentbased_traceidratio"; - OTEL_TRACES_SAMPLER_ARG = "0.01"; - }; }; systemd.slices.remotefshost.sliceConfig = { diff --git a/cluster/services/ipfs/monitoring.nix b/cluster/services/ipfs/monitoring.nix new file mode 100644 index 0000000..501f3df --- /dev/null +++ b/cluster/services/ipfs/monitoring.nix @@ -0,0 +1,13 @@ +{ config, ... }: + +{ + systemd.services.ipfs = { + environment = { + OTEL_TRACES_EXPORTER = "otlp"; + OTEL_EXPORTER_OTLP_PROTOCOL = "grpc"; + OTEL_EXPORTER_OTLP_ENDPOINT = config.links.tempo-otlp-grpc.url; + OTEL_TRACES_SAMPLER = "parentbased_traceidratio"; + OTEL_TRACES_SAMPLER_ARG = "0.01"; + }; + }; +} diff --git a/modules/ipfs/default.nix b/cluster/services/ipfs/node.nix similarity index 98% rename from modules/ipfs/default.nix rename to cluster/services/ipfs/node.nix index 3469102..ba14220 100644 --- a/modules/ipfs/default.nix +++ b/cluster/services/ipfs/node.nix @@ -9,7 +9,7 @@ let in { age.secrets.ipfs-swarm-key = { - file = ../../secrets/ipfs-swarm-key.age; + file = ../../../secrets/ipfs-swarm-key.age; mode = "0400"; owner = cfg.user; inherit (cfg) group; diff --git a/hosts/VEGAS/system.nix b/hosts/VEGAS/system.nix index 6a9357d..5911822 100644 --- a/hosts/VEGAS/system.nix +++ b/hosts/VEGAS/system.nix @@ -22,7 +22,6 @@ ./services/fbi ./services/gitlab ./services/hydra - ./services/ipfs ./services/jokes ./services/nextcloud ./services/nfs diff --git a/hosts/prophet/system.nix b/hosts/prophet/system.nix index 41157d4..048a108 100644 --- a/hosts/prophet/system.nix +++ b/hosts/prophet/system.nix @@ -14,7 +14,6 @@ ./services/reflex aspect.modules.hercules-ci-agent aspect.modules.hyprspace - aspect.modules.ipfs aspect.modules.nix-builder aspect.modules.sss diff --git a/modules/default.nix b/modules/default.nix index a9c29f2..58f65b9 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -9,7 +9,6 @@ let hercules-ci-agent = import ./hercules-ci-agent; hydra = import ./hydra; hyprspace = import ./hyprspace; - ipfs = import ./ipfs; maintenance = import ./maintenance; minimal = import ./minimal; motd = import ./motd;