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

add misskey package and module #161855

Closed
wants to merge 4 commits into from
Closed

add misskey package and module #161855

wants to merge 4 commits into from

Conversation

yu-re-ka
Copy link
Contributor

@yu-re-ka yu-re-ka commented Feb 25, 2022

Motivation for this change

Running on https://mk.yuka.dev

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 22.05 Release Notes (or backporting 21.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
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added 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/` labels Feb 25, 2022
@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Feb 25, 2022
@yu-re-ka yu-re-ka marked this pull request as ready for review February 27, 2022 13:59
@yu-re-ka
Copy link
Contributor Author

yu-re-ka commented Feb 27, 2022

This is now ready for review.

I considered adding abstractions for database/redis configuration, or a module documentation, but both of these made my head smoke too much because of the opinionated nature of these topics.

This is how my config looks using this module:

{ config, ... }:

{
  services.misskey = {
    enable = true;
    settings = {
      url = "https://mk.yuka.dev/";
      port = 11231;
      id = "aid";
      db = {
        host = "/run/postgresql";
        port = config.services.postgresql.port;
        user = "misskey";
        db = "misskey";
      };
      redis = {
        host = "localhost";
        port = config.services.redis.servers.misskey.port;
      };
    };
  };
  services.postgresql = {
    enable = true;
    ensureDatabases = [ "pleroma" ];
    ensureUsers = [
      {
        name = "misskey";
        ensurePermissions."DATABASE misskey" = "ALL PRIVILEGES";
      }
    ];
  };
  services.redis.servers.misskey = {
    enable = true;
    bind = "127.0.0.1";
    port = 16434;
  };
  # services.nginx.recommended* are set globally in another file
  services.nginx.virtualHosts."mk.yuka.dev" = {
    enableACME = true;
    forceSSL = true;
    locations = {
      "/" = {
        proxyPass = "http://127.0.0.1:${toString config.services.misskey.settings.port}/";
        proxyWebsockets = true;
      };
    };
  };
}

If someone wants to create a manual entry from that, I would be grateful.

@ofborg ofborg bot requested a review from kloenk February 27, 2022 14:12
@ofborg ofborg bot added 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin labels Feb 27, 2022
Copy link
Contributor

@DeeUnderscore DeeUnderscore left a comment

Choose a reason for hiding this comment

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

Other than the listed concerns, this looks good. I moved my instance (https://mi.underscore.world) to it, and it seems to be working well.

nixos/modules/services/networking/misskey.nix Show resolved Hide resolved
pkgs/servers/misskey/default.nix Outdated Show resolved Hide resolved
@yu-re-ka
Copy link
Contributor Author

yu-re-ka commented Mar 2, 2022

@kloenk maybe you can add the missing inputs for darwin? It is not finding some XCode tools.

@yayayayaka
Copy link
Member

If someone wants to create a manual entry from that, I would be grateful.

Will do.

@yu-re-ka
Copy link
Contributor Author

Updated misskey and rebased

@@ -0,0 +1,103 @@
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="misskey">
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like the outermost element should be a <chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="misskey">, otherwise the manual doesn't build

@yu-re-ka yu-re-ka closed this Apr 9, 2022
@yu-re-ka
Copy link
Contributor Author

yu-re-ka commented Apr 9, 2022

Someone else feel free to use the contents of this PR as basis for a new one

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: 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 10.rebuild-darwin: 1 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants