2024-12-10 00:43:48 +00:00
|
|
|
{
|
|
|
|
inputs,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}:
|
2024-12-04 20:09:32 +00:00
|
|
|
with lib; let
|
|
|
|
cfg = config.modules.pelican-wings;
|
|
|
|
in {
|
|
|
|
options = {
|
|
|
|
modules.pelican-wings = {
|
|
|
|
enable = mkEnableOption "Pelican Wings";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2024-12-10 00:43:48 +00:00
|
|
|
networking.firewall.allowedTCPPorts = [8080 8443];
|
2024-12-04 20:09:32 +00:00
|
|
|
|
|
|
|
virtualisation.docker.enable = true;
|
|
|
|
|
|
|
|
environment.systemPackages = [
|
2024-12-10 00:43:48 +00:00
|
|
|
(pkgs.callPackage ./package.nix {})
|
2024-12-04 20:09:32 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
systemd.services.pelican-wings = {
|
|
|
|
description = "Wings Daemon";
|
2024-12-10 00:43:48 +00:00
|
|
|
after = ["docker.service"];
|
|
|
|
requires = ["docker.service"];
|
|
|
|
partOf = ["docker.service"];
|
2024-12-04 20:09:32 +00:00
|
|
|
|
|
|
|
serviceConfig = {
|
|
|
|
User = "root";
|
|
|
|
WorkingDirectory = "/etc/pelican";
|
|
|
|
LimitNOFILE = 4096;
|
|
|
|
PIDFile = "/var/run/wings/daemon.pid";
|
|
|
|
ExecStart = "/run/current-system/sw/bin/wings";
|
|
|
|
Restart = "on-failure";
|
|
|
|
startLimitInterval = 180;
|
|
|
|
startLimitBurst = 30;
|
|
|
|
RestartSec = "5";
|
|
|
|
};
|
|
|
|
|
2024-12-10 00:43:48 +00:00
|
|
|
wantedBy = ["multi-user.target"];
|
2024-12-04 20:09:32 +00:00
|
|
|
};
|
|
|
|
};
|
2024-12-10 00:43:48 +00:00
|
|
|
}
|