update
This commit is contained in:
@@ -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
|
||||
|
||||
* ``
|
||||
|
||||
@@ -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
|
||||
'';
|
||||
}
|
||||
|
||||
32
assets/scripts/misskey.nix
Normal file
32
assets/scripts/misskey.nix
Normal 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 ];
|
||||
}
|
||||
Reference in New Issue
Block a user