add stormd

This commit is contained in:
RingOfStorms (Joshua Bell) 2024-10-14 02:14:03 -05:00
parent 21509bed4d
commit 7afc927424
5 changed files with 90 additions and 30 deletions

View file

@ -1,6 +1,8 @@
{
config,
lib,
ringofstorms-stormd,
settings,
...
}:
with lib;
@ -15,32 +17,10 @@ in
};
};
imports = [ ringofstorms-stormd.nixosModules.${settings.system.system} ];
config = mkIf cfg.enable {
# environment.systemPackages = with pkgs; [
# ];
# TODO make a derivation for stormd binary and get it properlly in the store. This is super janky and the binary just has to exist there right now.
# networking.firewall.allowedUDPPorts = [ 4242 ];
systemd.services."stormd" = {
description = "Stormd service";
wants = [ "basic.target" ];
after = [
"basic.target"
"network.target"
];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "notify";
Restart = "always";
RestartSec = 1;
ExecStart = "/etc/stormd/stormd daemon";
};
unitConfig = {
StartLimitIntervalSec = 5;
StartLimitBurst = 3;
};
};
users.users.root.packages = [ ringofstorms-stormd.packages.${settings.system.system}.stormd ];
services.stormd.enable = true;
};
}