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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misskey: init at 2024.5.0 & nixos/misskey: init module #319348

Merged
merged 3 commits into from
Aug 6, 2024

Conversation

feathecutie
Copy link
Contributor

@feathecutie feathecutie commented Jun 12, 2024

Description of changes

This adds the Misskey blogging platform by providing a package and accompanying NixOS module.

Source code: https://github.com/misskey-dev/misskey
Homepage: https://misskey-hub.net/en/

This PR is largely inspired by #296697.

TODO / Nice to have:

  • Add the ability to pass secrets via files that are read at runtime.
    • Currently only for settings.{db.pass,redis.pass,meilisearch.apiKey}.
  • Correctly type all config options in the NixOS module, as there aren't that many.
    • Created typed options with defaults for the most important options, while leaving the rest freeform.
  • Split out the config options that affect PostgreSQL/Redis/Nginx/Caddy instead of reading them from the untyped settings field.
    • Not split out from settings, but all relevant fields are properly typed now.
  • Assert the settings to be in a state where Misskey doesn't crash at runtime, e.g. when certain options are null.
    • All relevant fields have proper types and defaults and can't be null.
  • Automatically configure SSL for Nginx (I never used Nginx before).
    • Potentially detect if SSL is even necessary by checking if settings.url starts with https:// or http://. This seems quite error prone, so a seperate toggle for SSL in nginx might make sense. Luckily, Caddy handles this automatically based on the URL type.
    • Alternative: Remove the option for auto-configuring a Nginx reverse proxy and let the user set it up completely themselves. This seems less ergonomic, but would leave the specifics of setting up SSL (among other things) to the user.

Feedback is welcome for any of the remaining (or even completed) TODOs.

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.11 Release Notes (or backporting 23.11 and 24.05 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.

Copy link
Member

@JulienMalka JulienMalka left a comment

Choose a reason for hiding this comment

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

Code looks good to me appart from minor comment

pkgs/by-name/mi/misskey/package.nix Outdated Show resolved Hide resolved
@JulienMalka
Copy link
Member

Before merging please squash your changes so that there is one that adds yourself as maintainer, one that adds the package, one that adds the module

@fricklerhandwerk fricklerhandwerk merged commit 0c9cb00 into NixOS:master Aug 6, 2024
29 checks passed
@fricklerhandwerk
Copy link
Contributor

Thanks a lot @feathecutie!

@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/2024-summer-of-nix-program-updates/46053/4

@feathecutie feathecutie deleted the misskey branch August 20, 2024 12:13
@feathecutie feathecutie restored the misskey branch August 20, 2024 12:13
@feathecutie feathecutie deleted the misskey branch August 20, 2024 12:15
@AsterisMono AsterisMono added the backport release-24.05 Backport PR automatically label Sep 24, 2024
Copy link
Contributor

Backport failed for release-24.05, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release-24.05
git worktree add -d .worktree/backport-319348-to-release-24.05 origin/release-24.05
cd .worktree/backport-319348-to-release-24.05
git switch --create backport-319348-to-release-24.05
git cherry-pick -x 70cf12a6d7a7eb86a0ba05f2ad703cfe76e19c28 564a6e61a0e0c6df9eda3baf78071ed59f722248 0c9cb0041ba1835fe630d015be292cfc75922761

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