nixos/applications/pelican/wings/wings.nix

48 lines
1,008 B
Nix
Raw Normal View History

2024-12-10 00:43:48 +00:00
{
inputs,
pkgs,
lib,
config,
...
}:
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];
virtualisation.docker.enable = true;
environment.systemPackages = [
2024-12-10 00:43:48 +00:00
(pkgs.callPackage ./package.nix {})
];
systemd.services.pelican-wings = {
description = "Wings Daemon";
2024-12-10 00:43:48 +00:00
after = ["docker.service"];
requires = ["docker.service"];
partOf = ["docker.service"];
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-10 00:43:48 +00:00
}