add syntax renderer to hastebin
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{ pkgs, config, ... }:
|
||||
{ pkgs, config, inputs, ... }:
|
||||
let
|
||||
immichDataDir = "/mnt/storage/immich";
|
||||
syncthingDataDir = "/mnt/storage/syncthing";
|
||||
@@ -45,6 +45,29 @@ in
|
||||
hastebin = {
|
||||
enable = true;
|
||||
subdomain = "bin";
|
||||
renderers = with pkgs;
|
||||
let
|
||||
hl = rustPlatform.buildRustPackage {
|
||||
name = "syntax-renderer";
|
||||
src = inputs.syntax-renderer;
|
||||
cargoHash = "sha256-+3rsXsZohapIZAQfDYCqcatj+qWmC2iD8raeECKtgzE=";
|
||||
};
|
||||
in
|
||||
{
|
||||
hl = "${hl}/bin/syntax-renderer";
|
||||
sha = writeShellScript "sha-renderer" ''
|
||||
echo "Content-Type: text/plain"
|
||||
echo "---"
|
||||
${coreutils}/bin/sha256sum - | cut -d' ' -f1
|
||||
'';
|
||||
stl = writeShellScript "stl-renderer" ''
|
||||
echo "Content-Type: model/stl"
|
||||
echo "Content-Disposition: attachment; filename=$(basename "$1" .scad).stl"
|
||||
echo "---"
|
||||
${openscad}/bin/openscad --export-format stl -o - -
|
||||
'';
|
||||
};
|
||||
cleanup.enable = true;
|
||||
};
|
||||
|
||||
readeck = {
|
||||
|
||||
Reference in New Issue
Block a user