Update README.md
This commit is contained in:
parent
63d52c2fd4
commit
ae69822530
55
flake.nix
55
flake.nix
|
@ -14,7 +14,60 @@
|
||||||
packages."aarch64-linux".default = self.packages."aarch64-linux".pterodactyl-wings;
|
packages."aarch64-linux".default = self.packages."aarch64-linux".pterodactyl-wings;
|
||||||
|
|
||||||
nixosModules.pterodactyl-panel = ./modules/panel.nix;
|
nixosModules.pterodactyl-panel = ./modules/panel.nix;
|
||||||
nixosModules.pterodactyl-wings = ./modules/wings.nix;
|
nixosModules.pterodactyl-wings = { lib, config, pkgs, ... }:
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
configuration = ''
|
||||||
|
# managed by NixOS
|
||||||
|
'' + "${config.services.wings.configuration}";
|
||||||
|
in {
|
||||||
|
options.services.wings = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
configuration = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
pkg = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = self.packages.${pkgs.system}.pterodactyl-wings;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf config.services.wings.enable {
|
||||||
|
assertions = [{
|
||||||
|
assertion = config.services.wings.configuration != null;
|
||||||
|
message = "wings is enabled, configuration must be set.";
|
||||||
|
}];
|
||||||
|
|
||||||
|
virtualisation.docker.enable = true;
|
||||||
|
environment.etc."pterodactyl/config.yml".text = configuration;
|
||||||
|
environment.systemPackages = [ config.services.wings.pkg ];
|
||||||
|
systemd.services.wings = {
|
||||||
|
enable = cfg.enable;
|
||||||
|
description = "Pterodactyl Wings daemon";
|
||||||
|
after = [ "docker.service" ];
|
||||||
|
partOf = [ "docker.service" ];
|
||||||
|
requires = [ "docker.service" ];
|
||||||
|
startLimitIntervalSec = 180;
|
||||||
|
startLimitBurst = 30;
|
||||||
|
serviceConfig = {
|
||||||
|
User = "root";
|
||||||
|
WorkingDirectory = "/run/wings";
|
||||||
|
LimitNOFILE = 4096;
|
||||||
|
PIDFile = "/var/run/wings/daemon.pid";
|
||||||
|
ExecStart =
|
||||||
|
"/bin/sh -c '/usr/bin/env mkdir /run/wings; /usr/bin/env cat /etc/pterodactyl/config.yml > /run/wings/config.yml; ${config.services.wings.pkg}/bin/wings --config /run/wings/config.yml'";
|
||||||
|
Restart = "on-failure";
|
||||||
|
RestartSec = "5s";
|
||||||
|
};
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
nixosModules.default = self.nixosModules.pterodactyl-wings;
|
nixosModules.default = self.nixosModules.pterodactyl-wings;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ lib, config, pkgs, ... }:
|
{ lib, config, pkgs, self, ... }:
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
configuration = ''
|
configuration = ''
|
||||||
|
@ -16,7 +16,7 @@ in {
|
||||||
};
|
};
|
||||||
pkg = mkOption {
|
pkg = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
default = pkgs.pterodactyl-wings;
|
default = self.packages.${pkgs.system}.pterodactyl-wings;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue