Use amule module from my PR
This commit is contained in:
parent
8fcc7106c3
commit
58cfa8ee1f
1 changed files with 34 additions and 22 deletions
|
@ -1,34 +1,46 @@
|
||||||
{ config, lib, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
let
|
||||||
|
rev = "966199fe1dccc9c6c7016bdb1d9582f27797bc02";
|
||||||
|
amule-flake = builtins.getFlake "github:NixOS/nixpkgs/${rev}";
|
||||||
|
inherit (amule-flake.legacyPackages.${pkgs.system}) amule-daemon amule-web;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
users.users.amule = {
|
disabledModules = [ "services/networking/amuled.nix" ];
|
||||||
isSystemUser = true;
|
documentation.nixos.enable = false;
|
||||||
group = "amule";
|
|
||||||
extraGroups = [ "amule" ];
|
imports = [ "${amule-flake}/nixos/modules/services/networking/amuled.nix" ];
|
||||||
home = config.services.amule.dataDir;
|
|
||||||
};
|
|
||||||
|
|
||||||
users.groups.amule = { };
|
|
||||||
services.amule = {
|
services.amule = {
|
||||||
dataDir = "/mnt/hd/amule";
|
|
||||||
enable = true;
|
enable = true;
|
||||||
user = "amule";
|
package = amule-daemon;
|
||||||
|
amuleWebPackage = amule-web;
|
||||||
|
openPeerPorts = true;
|
||||||
|
openWebServerPort = true;
|
||||||
|
# TODO the service is accessible only from the VPN
|
||||||
|
# however better using agenix
|
||||||
|
ExternalConnectPasswordFile = pkgs.writeText "password" "pippo";
|
||||||
|
WebServerPasswordFile = pkgs.writeText "password" "pippo";
|
||||||
|
settings = {
|
||||||
|
eMule = {
|
||||||
|
IncomingDir = "/mnt/hd/amule";
|
||||||
|
TempDir = "/mnt/hd/amule/Temp";
|
||||||
|
};
|
||||||
|
WebServer = {
|
||||||
|
Enabled = 1;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# sometimes the service crashes with a segfeault without any reason...
|
|
||||||
systemd.services.amuled.serviceConfig.Restart = lib.mkForce "always";
|
|
||||||
|
|
||||||
environment.persistence."/persist".directories = [
|
environment.persistence."/persist".directories = [
|
||||||
config.services.amule.dataDir
|
config.services.amule.dataDir
|
||||||
];
|
];
|
||||||
|
|
||||||
networking.firewall = {
|
services.nginx.virtualHosts."amule.sisko.wg.aciceri.dev" = {
|
||||||
allowedTCPPorts = [ 4662 ];
|
forceSSL = true;
|
||||||
allowedUDPPortRanges = [
|
useACMEHost = "aciceri.dev";
|
||||||
{
|
locations."/" = {
|
||||||
from = 4665;
|
proxyPass = "http://localhost:${builtins.toString config.services.amule.settings.WebServer.Port}";
|
||||||
to = 4672;
|
};
|
||||||
}
|
serverAliases = [ "amule.sisko.zt.aciceri.dev" ];
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue