A flake for running Misskey under NixOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Dee 4551adf94a packages.misskey: 12.90.1 → 12.91.0 4 days ago
module nixosModule: actually use the misskey user for the systemd unit 2 weeks ago
pkg packages.misskey: 12.90.1 → 12.91.0 4 days ago
.gitignore Initial commit 🎉 1 month ago
LICENSE Initial commit 🎉 1 month ago
README.md Initial commit 🎉 1 month ago
flake.lock packages.misskey: 12.88.0 → 12.89.2 1 month ago
flake.nix Initial commit 🎉 1 month ago

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