This commit is contained in:
Kenryu Shibata
2026-01-07 01:42:09 +09:00
parent a743f2c943
commit d471aa77f9
8 changed files with 151 additions and 17 deletions

View File

@@ -1,7 +1,7 @@
# Static Assets for ricing
All of stuff(Wallpapers, etc.) packaged in single nix deriv.
All of stuff(Wallpapers, Scripts, etc.) packaged in single nix deriv.
## Sources
## Wallpaper Sources
* ``

View File

@@ -2,7 +2,7 @@ stdenv.mkDerivation {
name = "ricing-assets";
src = ./.;
installPhase = ''
mkdir -p $out/share/wallpapers
cp -r wallpapers/ $out/share/wallpapers
mkdir -p $out/usr/local/share/wallpapers
cp -r wallpapers/ $out/usr/local/share/wallpapers
'';
}

View File

@@ -0,0 +1,32 @@
{ config, pkgs, ... }:
let
getLatestN = writeShellApplication {
name = "misskey-getLatestN";
runtimeInputs = [
curl
jq
];
text = ''
if [[ -a /tmp/${config.networking.hostName}/misskey-scripts/getLatestN.fifo ]]; then
mkdir -p /tmp/${config.networking.hostName}/misskey-scripts
mkfifo /tmp/${config.networking.hostName}/misskey-scripts/getLatestN.fifo
fi
pipeLocation=/tmp/${config.networking.hostName}/misskey-scripts/getLatestN.fifo
curl https://misskey.io/api/notes -s --request POST --header 'Content-Type: application/json' --data '{"local": true, "reply": false, "renote": false, "withFiles": false, "poll": false, "limit": $1}' > "$pipeLocation" &
echo "$(jq -M -r '.[].text' < $pipeLocation)" > $pipeLocation &
while read line; do
echo "$line"
done < $pipeLocation
wait
'';
};
in
pkgs.symlinkJoin {
name = "misskey-scripts";
paths = [ getLatestN ];
}