nixos/eris-server: drop
This commit is contained in:
@@ -1030,7 +1030,7 @@ Make sure to also check the many updates in the [Nixpkgs library](#sec-release-2
|
||||
|
||||
- [eris-server](https://codeberg.org/eris/eris-go), an implementation of the
|
||||
Encoding for Robust Immutable Storage (ERIS). Available as
|
||||
[services.eris-server](#opt-services.eris-server.enable).
|
||||
`services.eris-server`.
|
||||
|
||||
- [forgejo](https://forgejo.org/), a git forge and drop-in replacement for
|
||||
Gitea. Available as [services.forgejo](#opt-services.forgejo.enable).
|
||||
|
||||
@@ -184,6 +184,8 @@
|
||||
|
||||
- `services.clamsmtp` is unmaintained and was removed from Nixpkgs.
|
||||
|
||||
- `services.eris-server` was removed from Nixpkgs due to a hostile upstream.
|
||||
|
||||
- `prosody` gained a config check option named `services.prosody.checkConfig` which runs `prosodyctl check config` and is turned on by default.
|
||||
|
||||
- `services.dependency-track` removed its configuration of the JVM heap size. This lets the JVM choose its maximum heap size automatically, which should work much better in practice for most users. For deployments on systems with little RAM, it may now be necessary to manually configure a maximum heap size using {option}`services.dependency-track.javaArgs`.
|
||||
|
||||
@@ -1048,7 +1048,6 @@
|
||||
./services/network-filesystems/davfs2.nix
|
||||
./services/network-filesystems/diod.nix
|
||||
./services/network-filesystems/drbd.nix
|
||||
./services/network-filesystems/eris-server.nix
|
||||
./services/network-filesystems/glusterfs.nix
|
||||
./services/network-filesystems/ipfs-cluster.nix
|
||||
./services/network-filesystems/kbfs.nix
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.services.eris-server;
|
||||
stateDirectoryPath = "\${STATE_DIRECTORY}";
|
||||
nullOrStr = with lib.types; nullOr str;
|
||||
in
|
||||
{
|
||||
|
||||
options.services.eris-server = {
|
||||
|
||||
enable = lib.mkEnableOption "an ERIS server";
|
||||
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.eris-go;
|
||||
defaultText = lib.literalExpression "pkgs.eris-go";
|
||||
description = "Package to use for the ERIS server.";
|
||||
};
|
||||
|
||||
decode = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether the HTTP service (when enabled) will decode ERIS content at /uri-res/N2R?urn:eris:.
|
||||
Enabling this is recommended only for private or local-only servers.
|
||||
'';
|
||||
};
|
||||
|
||||
listenCoap = lib.mkOption {
|
||||
type = nullOrStr;
|
||||
default = ":5683";
|
||||
example = "[::1]:5683";
|
||||
description = ''
|
||||
Server CoAP listen address. Listen on all IP addresses at port 5683 by default.
|
||||
Please note that the server can service client requests for ERIS-blocks by
|
||||
querying other clients connected to the server. Whether or not blocks are
|
||||
relayed back to the server depends on client configuration but be aware this
|
||||
may leak sensitive metadata and trigger network activity.
|
||||
'';
|
||||
};
|
||||
|
||||
listenHttp = lib.mkOption {
|
||||
type = nullOrStr;
|
||||
default = null;
|
||||
example = "[::1]:8080";
|
||||
description = "Server HTTP listen address. Do not listen by default.";
|
||||
};
|
||||
|
||||
backends = lib.mkOption {
|
||||
type = with lib.types; listOf str;
|
||||
description = ''
|
||||
List of backend URLs.
|
||||
Add "get" and "put" as query elements to enable those operations.
|
||||
'';
|
||||
example = [
|
||||
"badger+file:///var/db/eris.badger?get&put"
|
||||
"coap+tcp://eris.example.com:5683?get"
|
||||
];
|
||||
};
|
||||
|
||||
mountpoint = lib.mkOption {
|
||||
type = nullOrStr;
|
||||
default = null;
|
||||
example = "/eris";
|
||||
description = ''
|
||||
Mountpoint for FUSE namespace that exposes "urn:eris:…" files.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = lib.strings.versionAtLeast cfg.package.version "20231219";
|
||||
message = "Version of `config.services.eris-server.package` is incompatible with this module";
|
||||
}
|
||||
];
|
||||
|
||||
systemd.services.eris-server =
|
||||
let
|
||||
cmd =
|
||||
"${cfg.package}/bin/eris-go server"
|
||||
+ (lib.optionalString (cfg.listenCoap != null) " --coap '${cfg.listenCoap}'")
|
||||
+ (lib.optionalString (cfg.listenHttp != null) " --http '${cfg.listenHttp}'")
|
||||
+ (lib.optionalString cfg.decode " --decode")
|
||||
+ (lib.optionalString (cfg.mountpoint != null) " --mountpoint '${cfg.mountpoint}'");
|
||||
in
|
||||
{
|
||||
description = "ERIS block server";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
environment.ERIS_STORE_URL = toString cfg.backends;
|
||||
script = lib.mkIf (cfg.mountpoint != null) ''
|
||||
export PATH=${config.security.wrapperDir}:$PATH
|
||||
${cmd}
|
||||
'';
|
||||
serviceConfig =
|
||||
let
|
||||
umounter = lib.mkIf (
|
||||
cfg.mountpoint != null
|
||||
) "-${config.security.wrapperDir}/fusermount -uz ${cfg.mountpoint}";
|
||||
in
|
||||
if (cfg.mountpoint == null) then
|
||||
{
|
||||
ExecStart = cmd;
|
||||
}
|
||||
else
|
||||
{
|
||||
ExecStartPre = umounter;
|
||||
ExecStopPost = umounter;
|
||||
}
|
||||
// {
|
||||
Restart = "always";
|
||||
RestartSec = 20;
|
||||
AmbientCapabilities = "CAP_NET_BIND_SERVICE";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -493,7 +493,6 @@ in
|
||||
};
|
||||
ergo = runTest ./ergo.nix;
|
||||
ergochat = runTest ./ergochat.nix;
|
||||
eris-server = runTest ./eris-server.nix;
|
||||
esphome = runTest ./esphome.nix;
|
||||
etc = pkgs.callPackage ../modules/system/etc/test.nix { inherit evalMinimalConfig; };
|
||||
activation = pkgs.callPackage ../modules/system/activation/test.nix { };
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
name = "eris-server";
|
||||
|
||||
nodes.server = {
|
||||
environment.systemPackages = [
|
||||
pkgs.eris-go
|
||||
pkgs.eriscmd
|
||||
];
|
||||
services.eris-server = {
|
||||
enable = true;
|
||||
decode = true;
|
||||
listenHttp = "[::1]:80";
|
||||
backends = [ "badger+file:///var/cache/eris.badger?get&put" ];
|
||||
mountpoint = "/eris";
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
start_all()
|
||||
server.wait_for_unit("eris-server.service")
|
||||
server.wait_for_open_port(5683)
|
||||
server.wait_for_open_port(80)
|
||||
server.succeed("eriscmd get http://[::1] $(echo 'Hail ERIS!' | eriscmd put coap+tcp://[::1]:5683)")
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user