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

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.

@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.

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 yu-re-ka force-pushed the feature-misskey branch 2 times, most recently from 2165b4e to 0b936e6 Compare March 1, 2022 18:45
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants