-
-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkgs/formats: add generator for PHP config files #311299
Conversation
127221f
to
195cc4e
Compare
8e97a29
to
88802aa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I quickly reviewed and left a comment.
I'm wondering if we could validate the config with php -l
by default and eventually format it using PSR-12 with PHP-CS-Fixer.
I'm afraid that it will slow down evaluation a lot. |
e4ba680
to
508045d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I'll wait for @jtojnar to give its feedback on this before merging.
508045d
to
3c59da6
Compare
It would be done at build time so there should be negligible effect on evaluation time. |
db79bdc
to
66b67aa
Compare
This comment was marked as resolved.
This comment was marked as resolved.
66b67aa
to
a828dc1
Compare
This comment was marked as resolved.
This comment was marked as resolved.
a828dc1
to
8d245d7
Compare
Question: Is the Nix indentation mechanism and function still necessary if you pass the resulting PHP code through PHP-CS-Fixer?
If we decide including PHP-CS-Fixer in the closure is fine, then Nix indentation mechanism is pointless. If we decide that the former is too heavy, then doing basic formatting ourselves would be preferred.
|
I'm a bit confused, why format auto-generated file at all? |
To make it easier for humans to read when debugging. |
Formatting is just nice to have, IMO, so no need to block on that. |
Can we just omit it for now? |
9fc64c6
to
450998b
Compare
@jtojnar I think it's ready to merge. |
Yes, that is what I meant.
No other input from me, other than the minor preference for moving it to a separate file. We should probably give @infinisil as a code owner a bit more time to react if they want. |
450998b
to
4d791bc
Compare
I moved it to separate file, yeah, it's better :) Got it, thank you! |
4d791bc
to
5e495dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not bad! Leaving some feedback :)
5e495dc
to
7c4aceb
Compare
@jtojnar Can you approve changes? Or I missed something? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the above this looks fine to me!
7c4aceb
to
083f211
Compare
so, it's ready to merge, right? |
Thank you! |
Description of changes
Some PHP apps are configurable through evaluation of
config.php
file (file should contain php code that should set options on hashmap), for example Filesender or Flarum.This PR adds generation of PHP configs through Nix DSL.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.