A flake for running Misskey under NixOS
Go to file
Dee 95949b004f readme: fix example 2021-12-15 20:01:25 +01:00
module nixosModule: actually use the misskey user for the systemd unit 2021-09-10 23:00:15 +02:00
pkg packages.misskey: 12.94.1 → 12.95.0 2021-11-02 04:41:35 +01:00
.gitignore Initial commit 🎉 2021-08-27 01:13:13 +02:00
LICENSE Initial commit 🎉 2021-08-27 01:13:13 +02:00
README.md readme: fix example 2021-12-15 20:01:25 +01:00
flake.lock packages.misskey: 12.88.0 → 12.89.2 2021-08-27 13:59:46 +02:00
flake.nix Initial commit 🎉 2021-08-27 01:13:13 +02:00

README.md

Nix Flake for Misskey

This is a Nix flake for Misskey. It can be used to deploy Misskey, a decentralized, ActivityPub-based microblogging platform, on NixOS.

This is an unofficial effort, not associated with the Misskey project. Please do not report any issues encountered when deploying Misskey via this method to the upstream Misskey project.

Usage

Import

To use the Misskey module provided by this flake, add this flake as an input to the flake.nix used for your system configurations, and then import nixosModule from it.

For example, your flake.nix might look something like this:

{
  inputs = {
    misskey.url = "github:DeeUnderscore/misskey-flake";
  };

  outputs = {self, nixpkgs, misskey}: {
    nixosConfigurations.exampleBox = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [ ./exampleBox/configuration.nix ];
      specialArgs = { 
          inherit misskey;
      };
    };
  };
}

Then, in your confiuguration.nix, you can import the module like so:

{ config, pkgs, misskey, ...}:
{
  imports = [
      misskey.nixosModule
  ];
}

Settings

For detailed options provided by the module, see the module source file. There is currently no generated documentation.

services.misskey.settings follows the Misskey config file structure.

Database setup

The module supplied by the flake does not provide a createLocally option for the database. Additionally, there is no support for peer authentication, so you will most likely need to set a password for the Misskey user manually.

To do this, add a Misskey user to your Postgresql configuration in your configuration.nix:

services.postgresql = {
    enable = true;
    authentication = ''
      host   misskey   misskey  127.0.0.1/32 password
    '';

    ensureDatabases = [
      "misskey"
    ];

    ensureUsers = [
      {
        name = "misskey";
        ensurePermissions."DATABASE misskey" = "ALL PRIVILEGES";
      }
    ];
  };

And then, imperatively:

$ sudo -u postgres psql 
postgres=# ALTER ROLE misskey WITH PASSWORD 'passwordGoesHere';

License

The contents of this repository are available under the MIT license. See LICENSE for full text.