lfs remove 2

This commit is contained in:
41666 2024-04-21 13:59:59 -04:00
parent 228cce8450
commit ca04040731
8 changed files with 151 additions and 1 deletions

2
.gitignore vendored
View file

@ -1,2 +1,2 @@
.direnv
target
result

49
README.md Normal file
View file

@ -0,0 +1,49 @@
# NixOS Fedi Emotes
Ever wanted to describe your emotes declaratively? ya us too.
Extremely WIP, but likely to stay stable with care.
## Modules
### Akkoma
We have a module to automatically import and configure derivations as Akkoma emoji... Assuming you're already importing this as a flake named `fedi-emotes`...
```nix
{ inputs, pkgs, ... }: {
imports = [
inputs.fedi-emotes.nixosModules.akkoma
];
services.akkoma = {
# ...
emoji = {
enable = true; # Enable the emoji tool
emojiPackages = with inputs.fedi-emotes.packages.${pkgs.system}; [
# Any packages are OK here, Akkoma expects .png/.gif.
pkgs.akkoma-emoji.blobs_gg
lightrunner-custom.hearts
lightrunner-custom.anime
];
};
# ...
};
}
```
This module will place these packages/derivations in `services.akkoma.extraStatic."emoji/${package.name}"`, and map these prefixes to picker tabs via `services.akkoma.config.":pleroma".":emoji".groups`.
## Emote Packs
### Lightrunner Custom
_Used by https://sapphic.engineer and https://porcelain.doll.repair, among others._
- **Hearts** - `lightrunner-custom.hearts` - Hearts, Noegrams, and other personal bits and bobs.
- **Anime** - `lightrunner-custom.anime` - A pack of cute anime emotes
### Volpeon
- **Blobfox** - `volpeon.blobfox` - Blobfoxes
- **Neocat** - `volpeon.neocat` - Neocats

41
akkoma.nix Normal file
View file

@ -0,0 +1,41 @@
{ pkgs, config, lib, ... }: with lib; let
cfg = config.services.akkoma.emotes;
in {
options.services.akkoma.emoji = {
enable = mkEnableOption "Akkoma Emoji";
emojiPackages = mkOption {
type = with types; listOf package;
default = [];
description = ''
List of packages to install into Akkoma's emoji store.
Each entry will be its own category in the emoji picker.
These can be _any_ package/derivation, Akkoma is expecting .png and .gif files, though.
'';
};
};
config = mkIf cfg.enable {
services.akkoma = {
config.":pleroma".":emoji" = with (pkgs.formats.elixirConf { }).lib; {
# shortcode_globs = ["/emoji/**/*.png" "/emoji/**/*.gif"];
groups = mkMap(builtins.listToAttrs(
map (package: {
name = package.name;
value = "/emoji/${package.name}/*";
}) cfg.emotePackages
));
};
extraStatic = builtins.listToAttrs(
map (package: {
name = "emoji/${package.name}";
value = package;
}) cfg.emotePackages
);
};
};
}

View file

@ -7,6 +7,17 @@
systems = [ "aarch64-linux" "x86_64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs systems;
in {
nixosModules = {
akkoma = import ./akkoma.nix;
};
packages = forAllSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
in import ./packages.nix {
inherit pkgs inputs;
utils = import ./utils.nix { inherit pkgs; };
});
devShells = forAllSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {

14
packages.nix Normal file
View file

@ -0,0 +1,14 @@
{ pkgs, utils, inputs, ... }: let
specialArgs = { inherit pkgs utils inputs; };
in {
# These are specific to the Lightrunner System instances.
lightrunner-custom = {
anime = import ./custom/anime.nix specialArgs;
hearts = import ./custom/hearts.nix specialArgs;
};
volpeon = {
blobfox = import ./volpeon/blobfox.nix specialArgs;
neocat = import ./volpeon/neocat.nix specialArgs;
};
}

14
utils.nix Normal file
View file

@ -0,0 +1,14 @@
{ pkgs, ... }: {
mkEmotePack = {
src,
name,
version ? "v0.0.1",
convertSVGs ? false
}: pkgs.stdenvNoCC.mkDerivation {
inherit src name version;
buildPhase = ''
cp -r $src/ $out/
'';
};
}

12
volpeon/blobfox.nix Normal file
View file

@ -0,0 +1,12 @@
{ utils, pkgs, ... }: let
rev = "6d3bb625c795ac1bd1484d37b1e1ceb5015d624e";
in utils.mkEmotePack {
name = "volpeon-blobfox";
version = rev;
convertSVGs = true;
src = pkgs.fetchgit {
url = "https://git.vulpes.one/git/blobfox-emojis.git";
rev = rev;
hash = "sha256-IMXC4WfAIGs3Ljc+GM3/YyfE0jOyxsoRvF4LwA4AYrw=";
};
}

9
volpeon/neocat.nix Normal file
View file

@ -0,0 +1,9 @@
{ utils, pkgs, ... }: utils.mkEmotePack {
name = "volpeon-neocat";
version = "1.1";
unzip = true;
src = pkgs.fetchurl {
url = "https://volpeon.ink/emojis/neocat/neocat.zip";
hash = "sha256-DZDuk0Djlax504flNWdpqAw+ROLOOVGj0ZvJLyouo7A=";
};
}