Skip to content

pterodactyl-panel: init at 1.15.1, pterodactyl-wings: init at 1.13.3, nixos/pterodactyl-{panel, wings}: init - #456521

Open
PadowYT2 wants to merge 5 commits into
NixOS:masterfrom
PadowYT2:add-pterodactyl
Open

pterodactyl-panel: init at 1.15.1, pterodactyl-wings: init at 1.13.3, nixos/pterodactyl-{panel, wings}: init#456521
PadowYT2 wants to merge 5 commits into
NixOS:masterfrom
PadowYT2:add-pterodactyl

Conversation

@PadowYT2

@PadowYT2 PadowYT2 commented Oct 28, 2025

Copy link
Copy Markdown

Added Pterodactyl Panel and Pterodactyl Wings modules with their packages.

Homepage: https://pterodactyl.io

Things done


Add a 👍 reaction to pull requests you find important.

@PadowYT2 PadowYT2 changed the title init: pterodactyl pterodactyl: init Oct 28, 2025
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 12.first-time contribution This PR is the author's first one; please be gentle! 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` 9.needs: reviewer This PR currently has no reviewers requested and needs attention. labels Oct 28, 2025
@PadowYT2

Copy link
Copy Markdown
Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 456521
Commit: baf1adb8d96992cf24fa4ffc0e4daf032f1361a3


x86_64-linux

⏩ 2 packages blacklisted:
  • nixos-install-tools
  • tests.nixos-functions.nixos-test
✅ 2 packages built:
  • pterodactyl-panel
  • pterodactyl-wings

@qweered

qweered commented Oct 28, 2025

Copy link
Copy Markdown
Contributor

Pr title should be "nixos/pterodactyl-{panel, wings}: init"

@PadowYT2 PadowYT2 changed the title pterodactyl: init nixos/pterodactyl-{panel, wings}: init Oct 28, 2025
@PadowYT2

This comment was marked as outdated.

@h7x4 h7x4 added the 8.has: module (new) This PR adds a module in `nixos/` label Oct 29, 2025
Comment thread nixos/modules/services/misc/pterodactyl-wings.nix
@nixpkgs-ci nixpkgs-ci Bot removed the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label Oct 29, 2025
@acid-bong

Copy link
Copy Markdown
Contributor

Since you're introducing both packages and modules, separate each into its own commit, with package init ones preceding the respective module init ones

@keenanweaver keenanweaver left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work! Thanks for making this. I'm not a Pterodactyl user, but these modules will make me one.

Some observations/questions:

  • Can you change the wings module to enable virtualisation.docker conditionally with it? Shouldn't be any harm in doing this instead of an assertion.
  • I know it's annoying, but each config option in both modules should have a description explaining what they're for.
  • Are you able to nix-ify a full Pterodactyl setup with these modules? Can I programmatically configure eggs, etc. (I am ignorant of the software)
  • May want to consider looking into service hardening

Also have some non-blocking nits:

Comment thread pkgs/by-name/pt/pterodactyl-panel/package.nix Outdated
Comment thread pkgs/by-name/pt/pterodactyl-panel/package.nix Outdated
Comment thread pkgs/by-name/pt/pterodactyl-wings/package.nix Outdated
Comment thread pkgs/by-name/pt/pterodactyl-wings/package.nix Outdated
Comment thread pkgs/by-name/pt/pterodactyl-panel/package.nix Outdated
Comment thread nixos/modules/services/web-apps/pterodactyl-panel.nix Outdated
@PadowYT2

PadowYT2 commented Oct 29, 2025

Copy link
Copy Markdown
Author

Amazing work! Thanks for making this. I'm not a Pterodactyl user, but these modules will make me one.

🔥

  • I know it's annoying, but each config option in both modules should have a description explaining what they're for.

Some of them aren't documented officially, will come up with something I guess.

  • Are you able to nix-ify a full Pterodactyl setup with these modules? Can I programmatically configure eggs, etc. (I am ignorant of the software)

I wish you could. There are no commands within Pterodactyl (php artisan ...) which allows you to create servers/users/etc. If appropriate for nixpkgs, I could add these commands via patches (or other ways) while of course making a PR upstream.

Will check out and apply changes you have suggested. As a first time contribution, honestly thanks for checking out the changes

@keenanweaver

Copy link
Copy Markdown
Member

If appropriate for nixpkgs, I could add these commands via patches (or other ways) while of course making a PR upstream.

It's generally preferred to do everything possible upstream before doing patches and a lot of nix-specific fixes here. It all depends on how receptive upstream is to changes, especially if those changes are for Nix specifically.

As a first time contribution, honestly thanks for checking out the changes

You're welcome! I haven't tested them out on my own stuff yet, but I'm planning to deep dive with them and learn Pterodactyl at the same time.

@PadowYT2

Copy link
Copy Markdown
Author

It's generally preferred to do everything possible upstream before doing patches and a lot of nix-specific fixes here. It all depends on how receptive upstream is to changes, especially if those changes are for Nix specifically.

They wouldn't be nix-specific but will benefit the nix configuration more (and maybe some other setups, like install scripts)

@PadowYT2

Copy link
Copy Markdown
Author
  • Are you able to nix-ify a full Pterodactyl setup with these modules? Can I programmatically configure eggs, etc. (I am ignorant of the software)

I will not do it for this PR, maybe some time in the future as it will take some time

The module is already way too complex for me and I have no clue what should I add. If you want to suggest something, please do

@keenanweaver keenanweaver left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The module is already way too complex for me and I have no clue what should I add. If you want to suggest something, please do

Nothing in particular. Thanks for considering!

Some more changes to consider:

Comment thread nixos/modules/services/misc/pterodactyl-wings.nix Outdated
Comment thread nixos/modules/services/misc/pterodactyl-wings.nix Outdated
Comment thread pkgs/by-name/pt/pterodactyl-panel/package.nix Outdated
Comment thread pkgs/by-name/pt/pterodactyl-wings/package.nix Outdated
Comment thread nixos/modules/services/web-apps/pterodactyl-panel.nix Outdated
Comment thread nixos/modules/services/web-apps/pterodactyl-panel.nix Outdated
Comment thread nixos/modules/services/misc/pterodactyl-wings.nix
Comment on lines +135 to +140
phpPackage = lib.mkOption {
type = lib.types.package;
readOnly = true;
default = php;
description = "The PHP package to use";
};

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this option also be using lib.mkPackageOption?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe so. I just looked through the tree and found a couple of examples that do it for additional packages.

rulesProvider = lib.mkPackageOption pkgs "ananicy" { example = "ananicy-cpp"; } // {

dbmatePackage = lib.mkPackageOption pkgs "dbmate" { };

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tried, you can't use just lib.mkPackageOption "php" { } as the second option is supposed to be an object. So I guess just leave it like that?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably want to leave it as it is now and we'll see if someone else chimes in.

@PadowYT2
PadowYT2 force-pushed the add-pterodactyl branch 3 times, most recently from 4f8cf94 to 286d3cb Compare October 30, 2025 13:34
@nixpkgs-ci
nixpkgs-ci Bot requested a review from GetPsyched May 26, 2026 22:01
@PadowYT2

PadowYT2 commented May 26, 2026

Copy link
Copy Markdown
Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 456521
Commit: d9cf5b158469c5f7967ac021abcdb518cc824afc


x86_64-linux

⏩ 2 packages blacklisted:
  • nixos-install-tools
  • tests.nixos-functions.nixos-test
✅ 2 packages built:
  • pterodactyl-panel
  • pterodactyl-wings

I'm not sure why CI fails saying strictDeps = false even though it is set to true. Same question goes to docs...

@nixpkgs-ci nixpkgs-ci Bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jun 5, 2026
@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 3+ This PR was reviewed and approved by three or more persons. and removed 12.approvals: 2 This PR was reviewed and approved by two persons. labels Jun 8, 2026
@nixpkgs-ci nixpkgs-ci Bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jun 12, 2026
@PadowYT2 PadowYT2 changed the title pterodactyl-panel: init at 1.12.3, pterodactyl-wings: init at 1.12.2, nixos/pterodactyl-{panel, wings}: init pterodactyl-panel: init at 1.12.4, pterodactyl-wings: init at 1.12.3, nixos/pterodactyl-{panel, wings}: init Jun 12, 2026
@PadowYT2

Copy link
Copy Markdown
Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 456521
Commit: bac727284ec39189e9c773412a2cac8fe1187f62


x86_64-linux

⏩ 2 packages blacklisted:
  • nixos-install-tools
  • tests.nixos-functions.nixos-test
✅ 2 packages built:
  • pterodactyl-panel
  • pterodactyl-wings

@GetPsyched GetPsyched left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving redirects

@PadowYT2 PadowYT2 changed the title pterodactyl-panel: init at 1.12.4, pterodactyl-wings: init at 1.12.3, nixos/pterodactyl-{panel, wings}: init pterodactyl-panel: init at 1.14.0, pterodactyl-wings: init at 1.13.0, nixos/pterodactyl-{panel, wings}: init Jun 25, 2026
@PadowYT2

Copy link
Copy Markdown
Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 456521
Commit: dd8bf49a9402a0c2f5a48bd5f84dd59e64c1a40b


x86_64-linux

⏩ 2 packages blacklisted:
  • nixos-install-tools
  • tests.nixos-functions.nixos-test
✅ 2 packages built:
  • pterodactyl-panel
  • pterodactyl-wings

@Svenum

Svenum commented Jul 2, 2026

Copy link
Copy Markdown
Member

I am waiting for this. Is there a reason why this isn't merged yet? Am I able to help?

@PadowYT2

PadowYT2 commented Jul 2, 2026

Copy link
Copy Markdown
Author

Am I able to help?

👀
Perhaps testing it and approving if everything works correctly...? There's a standalone version as a flake (which is a clone of the add-pterodactyl branch) - PadowYT2/pterodactyl.nix

@PadowYT2

PadowYT2 commented Jul 2, 2026

Copy link
Copy Markdown
Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 456521
Commit: a89d461d0f86802fdf33d2df7fe924627a503160


x86_64-linux

⏩ 2 packages blacklisted:
  • nixos-install-tools
  • tests.nixos-functions.nixos-test
✅ 2 packages built:
  • pterodactyl-panel
  • pterodactyl-wings

@PadowYT2

PadowYT2 commented Aug 7, 2026

Copy link
Copy Markdown
Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 456521
Commit: 15b5e27d31106e3bafd782b45b624269e4561850


x86_64-linux

⏩ 2 packages blacklisted:
  • nixos-install-tools
  • tests.nixos-functions.nixos-test
✅ 3 packages built:
  • pterodactyl-panel
  • pterodactyl-wings
  • tests.config-nix-unit

@PadowYT2

Copy link
Copy Markdown
Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 456521
Commit: bdebe06ccb1d711fc3bc9a04ab71b9a8f067a7ad


x86_64-linux

⏩ 2 packages blacklisted:
  • nixos-install-tools
  • tests.nixos-functions.nixos-test
✅ 2 packages built:
  • pterodactyl-panel
  • pterodactyl-wings

@06kellyjac 06kellyjac left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, great to see this. I look forward to trying it

Currently CI is failing due to the manual adjustments:

 error: Cannot build '/nix/store/fb9n5wprzfs6wi250s08v242rc5wyglp-nixos-manual-html.drv'.
       Reason: builder failed with exit code 1.
       Output paths:
         /nix/store/y1scwmg6bi4hrqnn6p5n7jwfwpp4nrgd-nixos-manual-html
       Last 25 log lines:
       >     - module-services-pterodactyl-basic-usage
       >
       > This can happen when an identifier was added, renamed, or removed.
       >
       >     Added new content?
       >         $ redirects add-content <identifier> <path>
       >     often:
       >         $ redirects add-content <identifier> index.html
       >
       >     Moved existing content to a different output path?
       >         $ redirects move-content <identifier> <path>
       >
       >     Renamed existing identifiers?
       >         $ redirects rename-identifier <old-identifier> <new-identifier>
       >
       >     Removed content? Redirect to alternatives or relevant release notes.
       >         $ redirects remove-and-redirect <identifier> <target-identifier>
       >
       >     NOTE: Run the right nix-shell to make this command available.
       >         Nixpkgs:
       >         $ nix-shell doc
       >         NixOS:
       >         $ nix-shell nixos/doc/manual
       >
       > NOTE: If your build passes locally and you see this message in CI, you probably need a rebase.

And some other changes raised

Comment thread nixos/modules/services/web-apps/pterodactyl-panel.nix
Comment thread nixos/modules/services/web-apps/pterodactyl-panel.nix Outdated
Comment on lines +558 to +568
services.mysql = lib.optionalAttrs cfg.database.createLocally {
enable = true;
package = pkgs.mariadb;
ensureDatabases = [ cfg.database.name ];
ensureUsers = [
{
name = cfg.database.user;
ensurePermissions."${cfg.database.name}.*" = "ALL PRIVILEGES";
}
];
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering we default to mariadb shouldn't our DB_CONNECTION = "mysql"; at the top actually be DB_CONNECTION = "mariadb"; (or better we derive it from the mysql package)

https://github.com/pterodactyl/panel/blob/113ea43d0d48f48d567c9d91e4a7d5b5bb8876e3/config/database.php#L63-L86

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default provider is mysql and it works fine with a MariaDB server, but sure for pushing to just change the provider. Will do some testing before changing

@PadowYT2 PadowYT2 Aug 19, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mariadb provider has not been tested by the Pterodactyl team and doesn't work due to having strict GROUP BY rules, resulting in errors

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, weird they have a whole separate provider block that doesn't work with the db it's intended for lol.
Can we make sure there's a comment explaining this

Comment thread nixos/modules/services/web-apps/pterodactyl-panel.nix Outdated
Comment thread nixos/modules/services/web-apps/pterodactyl-panel.nix Outdated
Comment on lines +59 to +78
setupScript = pkgs.writeShellApplication {
name = "pterodactyl-wings-setup";
runtimeInputs = with pkgs; [
coreutils
replace-secret
];
text = ''
install -Dm640 -o ${cfg.user} -g ${cfg.group} ${
(pkgs.formats.yaml { }).generate "config.yml" (lib.recursiveUpdate mainConfig cfg.extraConfig)
} ${cfg.rootDir}/config.yml

${lib.optionalString (cfg.tokenIdFile != null) ''
replace-secret '@TOKEN_ID@' ${lib.escapeShellArg cfg.tokenIdFile} ${cfg.rootDir}/config.yml
''}

${lib.optionalString (cfg.tokenFile != null) ''
replace-secret '@TOKEN@' ${lib.escapeShellArg cfg.tokenFile} ${cfg.rootDir}/config.yml
''}
'';
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_test.go files are test files, which are just unit tests. The actual logic for these specific secrets are here:
https://github.com/pterodactyl/wings/blob/d6116827313dae176ddf4741e233554392993398/config/config.go#L444-L449

@06kellyjac 06kellyjac Aug 19, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test files are testing specific functionality. The tests were just the clearest usage/example I could link you

Here's a link for the ResolveToken method on the Configuration struct inside the working code. The godoc comment helps explain what it does.
https://github.com/pterodactyl/wings/blob/d6116827313dae176ddf4741e233554392993398/config/config.go#L414-L422

As long as you set the env var to file:///the/path/to/secret or nix level "file://${theNixVar}"; it'll read it, we don't need to template raw values into the config.

We should also use systemd's LoadCredential feature to ensure the service has access to the secret files.

We can define a services.pterodactyl.wings.secrets.tokenIDFile and services.pterodactyl.wings.secrets.tokenFile etc and when those are set we can auto define services.pterodactyl.wings.settings.token_id = "file://${cfg.secrets.tokenIDFile}"; etc.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PadowYT2 LMK when this adjustment is made or if you need help 🙂

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PadowYT2 LMK when this adjustment is made or if you need help 🙂

This is done with the freeform options, which I kinda need help with (see your other comment about it)

Comment thread nixos/modules/services/misc/pterodactyl-wings.nix Outdated
Comment thread nixos/modules/services/misc/pterodactyl-wings.nix Outdated
Comment thread nixos/modules/services/misc/pterodactyl-wings.nix
Comment thread nixos/doc/manual/release-notes/rl-2611.section.md Outdated
@06kellyjac

Copy link
Copy Markdown
Member

Oh and since it's been added since you started the PR if you could please review the https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#automationai-policy and note if you're following the process in the PR body

@PadowYT2

Copy link
Copy Markdown
Author

Hey, great to see this. I look forward to trying it

Thanks for a thorough review of the PR. I will try to solve/explain most of the things you commented on (been kinda a while since massive nix changes for me).

Currently CI is failing due to the manual adjustments:
NOTE: If your build passes locally and you see this message in CI, you probably need a rebase.

I'm unsure what to do, as everything has been done properly, with builds (nixpkgs-review) passing and GetPsyched has left his comment saying the redirects are fine. So I guess the note attached is what should be followed?

@06kellyjac

Copy link
Copy Markdown
Member

Running nix-build ci -A manual-nixos fails on your branch

image image

You're missing some redirect identifiers for some of your anchors or it used to be module-services-pterodactyl-basic-usage and now it's module-services-pterodactyl-panel-basic-usage etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog This PR adds or changes release notes 8.has: documentation This PR adds or changes documentation 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` 8.has: module (new) This PR adds a module in `nixos/` 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 3+ This PR was reviewed and approved by three or more persons. 12.first-time contribution This PR is the author's first one; please be gentle!

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.