mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-12-11 09:22:02 +01:00
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
|
||
|
;
|
||
|
};
|
||
|
};
|
||
|
}
|