Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

flarum: init at 1.8.1, module #311608

Merged
merged 2 commits into from
May 20, 2024
Merged

flarum: init at 1.8.1, module #311608

merged 2 commits into from
May 20, 2024

Conversation

fsagbuya
Copy link
Contributor

@fsagbuya fsagbuya commented May 14, 2024

Description of changes

Based from #96869, ngi-nix/ngipkgs#47 and ngi-nix/ngipkgs#56.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 馃憤 reaction to pull requests you find important.

@drupol
Copy link
Contributor

drupol commented May 14, 2024

Hi!

Good idea to backport flarum from ngi-nix, did you used their repo as source for the code?
Context: ngi-nix/ngipkgs#56

@fsagbuya
Copy link
Contributor Author

fsagbuya commented May 15, 2024

did you used their repo as source for the code? Context: ngi-nix/ngipkgs#56

Yes, only changes I made were updating the version and hash, some cleanup, and modifying this line to avoid this error:

Cacheable portion of option doc build failed.
Usually this means that an option attribute that ends up in documentation (eg `default` or `description`) depends on the restricted module arguments `config` or `pkgs`.

I'm open to suggestions especially from someone at ngi-nix, and very willing to add them as maintainer. Just give me a ping.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/3967

@jasonodoom
Copy link
Member

did you used their repo as source for the code? Context: ngi-nix/ngipkgs#56

Yes, only changes I made were updating the version and hash, some cleanup, and modifying this line to avoid this error:

Cacheable portion of option doc build failed.
Usually this means that an option attribute that ends up in documentation (eg `default` or `description`) depends on the restricted module arguments `config` or `pkgs`.

I'm open to suggestions especially from someone at ngi-nix, and very willing to add them as maintainer. Just give me a ping.

Thanks for doing this @fsagbuya! I was able to build this successfully. Feel free to add me as second maintainer if you want.

@fsagbuya
Copy link
Contributor Author

fsagbuya commented May 20, 2024

@jasonodoom, added you as maintainer. Thanks!

@ofborg ofborg bot requested a review from jasonodoom May 20, 2024 03:48
@drupol drupol merged commit a041ac5 into NixOS:master May 20, 2024
24 of 25 checks passed
@albertchae
Copy link
Contributor

@fsagbuya thanks for upstreaming this! last year one of the reasons we didn't upstream it was that no one wanted to be a maintainer in nixpkgs since we didn't use the software, but looks like @jasonodoom has changed his mind since 馃帀

@drupol thanks for linking the PRs to the ngipkgs repo. IIRC your recent comments in #foundation seemed to indicate you felt there were code quality issues with the flarum packaging work, so I was hoping you'd provide some more commentary on this upstreaming PR for our education

Now that this PR has been merged, it's a good candidate for whenever ngipkgs implements ngi-nix/ngipkgs#76

@drupol
Copy link
Contributor

drupol commented May 20, 2024

@drupol thanks for linking the PRs to the ngipkgs repo. IIRC your recent comments in #foundation seemed to indicate you felt there were code quality issues with the flarum packaging work, so I was hoping you'd provide some more commentary on this upstreaming PR for our education

Hello,

My main concern has been addressed already, but I'd like to reiterate it here. I don't see the value in merging stuff into a repository outside nixpkgs. Even if this is enforced by the NGI contractual agreement, it seems counterproductive. NGI should either ensure that once a PR is merged into their repository, it gets upstreamed into nixpkgs, or they should discontinue ngi-nix/ngipkgs and instead support users in contributing directly to nixpkgs, which maintains higher quality standards.

I refrained from interfering with this PR, even though I could have requested some changes. I didn't want to block the merge over the use of a top-level with lib;. While technically valid, this practice is no longer recommended.

I hope my message is clear. My goal is to consolidate nix recipes in their appropriate place and avoid fragmentation. Teaching contributors to work directly with nixpkgs is much more valuable than contributing to a standalone repository. It's important to learn technical skills, best practices, and the social interactions on GitHub.

lorenzleutgeb added a commit to ngi-nix/ngipkgs that referenced this pull request May 24, 2024
wegank pushed a commit to ngi-nix/ngipkgs that referenced this pull request May 27, 2024
wegank pushed a commit to ngi-nix/ngipkgs that referenced this pull request May 30, 2024
fricklerhandwerk pushed a commit to ngi-nix/ngipkgs that referenced this pull request May 30, 2024
Comment on lines +191 to +192
mkdir -p ${cfg.stateDir}/{extensions,public/assets/avatars}
mkdir -p ${cfg.stateDir}/storage/{cache,formatter,sessions,views}
Copy link
Member

Choose a reason for hiding this comment

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

This should use tmpfiles.d. A few months back was a treewide PR which converted many of those occurrences

script = ''
mkdir -p ${cfg.stateDir}/{extensions,public/assets/avatars}
mkdir -p ${cfg.stateDir}/storage/{cache,formatter,sessions,views}
cd ${cfg.stateDir}
Copy link
Member

Choose a reason for hiding this comment

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

Working directory should be used instead

Comment on lines +194 to +198
cp -f ${cfg.package}/share/php/flarum/{extend.php,site.php,flarum} .
ln -sf ${cfg.package}/share/php/flarum/vendor .
ln -sf ${cfg.package}/share/php/flarum/public/index.php public/
chmod a+x . public
chmod +x site.php extend.php flarum
Copy link
Member

Choose a reason for hiding this comment

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

This could all be covered by tmpfiles.d, too

ensureUsers = [
{
name = cfg.database.username;
ensurePermissions = {
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this deprecated since months?

Comment on lines +89 to +101
# the database driver; i.e. MySQL; MariaDB...
driver = "mysql";
# the host of the connection; localhost in most cases unless using an external service
host = "localhost";
# the name of the database in the instance
database = "flarum";
# database username
username = "flarum";
# database password
password = "";
# the prefix for the tables; useful if you are sharing the same database with another service
prefix = "";
# the port of the connection; defaults to 3306 with MySQL
Copy link
Member

Choose a reason for hiding this comment

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

Those comments aren't visible for people visiting search.nixos.org

description = "MySQL database parameters";
default = {
# the database driver; i.e. MySQL; MariaDB...
driver = "mysql";
Copy link
Member

Choose a reason for hiding this comment

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

Why not default to the more free mariadb?

@@ -0,0 +1,210 @@
{ pkgs, lib, config, ... }:

with lib;
Copy link
Member

Choose a reason for hiding this comment

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

Adding new file wide withs are highly discouraged

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

Successfully merging this pull request may close these issues.

None yet

6 participants