Compare commits

...

2 commits

Author SHA1 Message Date
c745986ef4
amarr module WIP
Some checks failed
/ test (push) Failing after 14m23s
2025-04-28 20:20:57 +02:00
29734b6bd7
Add amule and enable on sisko 2025-04-28 20:20:46 +02:00
3 changed files with 58 additions and 0 deletions

View file

@ -33,6 +33,7 @@
"arr"
"zerotier"
"mosh"
"amule"
]
++ [
./disko.nix

23
modules/amarr/default.nix Normal file
View file

@ -0,0 +1,23 @@
args@{ lib, pkgs, ... }:
let
pkgs = builtins.getFlake "github:NixOS/nixpkgs/d278c7bfb89130ac167e80d2250f9abc0bede419";
amarr = pkgs.legacyPackages.${args.pkgs.system}.amarr;
in
{
systemd.services.amarr = {
description = "amarr";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
User = "root";
Type = "oneshot";
ExecStart = lib.getExe amarr;
};
environment = {
AMULE_HOST = "localhost";
AMULE_PORT = "4712";
AMULE_PASSWORD = "";
};
};
}

34
modules/amule/default.nix Normal file
View file

@ -0,0 +1,34 @@
{ config, lib, ... }:
{
users.users.amule = {
isSystemUser = true;
group = "amule";
extraGroups = [ "amule" ];
home = config.services.amule.dataDir;
};
users.groups.amule = { };
services.amule = {
dataDir = "/mnt/hd/amule";
enable = true;
user = "amule";
};
# sometimes the service crashes with a segfeault without any reason...
systemd.services.amuled.serviceConfig.Restart = lib.mkForce "always";
environment.persistence."/persist".directories = [
config.services.amule.dataDir
];
networking.firewall = {
allowedTCPPorts = [ 4662 ];
allowedUDPPortRanges = [
{
from = 4665;
to = 4672;
}
];
};
}