mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-29 19:46:17 +01:00
7de31b611c
Signed-off-by: magic_rb <magic_rb@redalder.org>
19 lines
624 B
Nix
19 lines
624 B
Nix
{inputs, ...}: {
|
|
flake.overlays.thingiverse-downloader = final: prev: {
|
|
thingiverse-downloader-bash = final.writeShellScriptBin "thingiverse-downloader" ''
|
|
THING_ID="$1"
|
|
curl https://www.thingiverse.com/thing:$THING_ID/zip -OL
|
|
unzip zip
|
|
( echo ; curl "https://api.thingiverse.com/things/$THING_ID?access_token=$THINGIVERSE_API_TOKEN" | \
|
|
${final.lib.getExe final.jq} '.description' -r ) >> README.txt
|
|
rm zip
|
|
'';
|
|
thingiverse-downloader = final.callPackage ./thingiverse-downloader.nix {
|
|
inherit
|
|
(inputs)
|
|
thingiverse-downloader
|
|
;
|
|
};
|
|
};
|
|
}
|