Code Monkey home page Code Monkey logo

maunium-stickerpicker-nix's Introduction

built with nix

maunium-stickerpicker-nix

Nix wrapper for maunium/stickerpicker

Usage:

Here's an example of a stickerpicker

myStickerPicker = createStickerPicker {
  homeserver = "https://my.matrix.server";
  userId = "@stickerbot:my.matrix.server";
  # You should probably encrypt this with either agenix, sops-nix or whatever else
  accessTokenFile = ./stickerbot_access_token.txt;
  sha256 = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
  packs = [
    {
      type = "chatsticker";
      name = "pompom-tao3";
    }
    {
      type = "directory";
      src = ./myHomemadeStickers;
    }
  ];
};

Afterwards, you can easily host it in an nginx config

{ ... }:
{
services.nginx.enable = true;
services.nginx.virtualHosts."stickers.myhost.org" = {
    root = myStickerPicker;
  };
}

List of available fetchers

Site Type Name Required Arguments
<local dir> directory src (path to a local dir with image files)
https://chatsticker.com chatsticker name (see url)

Some notes

To use this, leave the sha256 empty at first, build the stickerspicker with whatever stickers you'd like, and paste the sha256 from the error message back into your code.

Normally, maunium/stickerpicker would cache the stickers in a config file, and reuse the config file on the next run in order not to. This does not work with Nix' determinism. Thus every time you want to add just 1 more stickerpack (or any other kind of edit), this will reupload all stickers. In order to make it easier to delete all sticker once in a while, I would recommend creating a separate user (I've called mine stickerbot), whose only purpose is to be the owner of a bunch of sticker media files. Whenever you want to clean up the media store, just delete all the media file of stickerbot (THIS WILL BREAK OLDER MESSAGES)

maunium-stickerpicker-nix's People

Contributors

h7x4 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.