add syntax renderer to hastebin
This commit is contained in:
@@ -64,6 +64,10 @@
|
||||
url = "github:zhaofengli/colmena";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
syntax-renderer = {
|
||||
url = "sourcehut:~repomaa/syntax-renderer";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
outputs = { flake-parts, agenix, nixpkgs, self, colmena, ... }@inputs:
|
||||
flake-parts.lib.mkFlake { inherit inputs; } (
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -37,18 +37,6 @@ in
|
||||
auth_tokens_file = secrets.hastebin-tokens.path;
|
||||
};
|
||||
|
||||
users.users.hastebin = {
|
||||
isSystemUser = true;
|
||||
group = "hastebin";
|
||||
};
|
||||
|
||||
users.groups.hastebin = { };
|
||||
|
||||
systemd.services.hastebin.serviceConfig = {
|
||||
DynamicUser = lib.mkForce false;
|
||||
User = "hastebin";
|
||||
};
|
||||
|
||||
services.webserver = {
|
||||
enable = lib.mkDefault true;
|
||||
vHosts.${fqdn} = {
|
||||
|
||||
Reference in New Issue
Block a user