colin
965d7eedbb
it currently has to be run manually: ``` ./pkgs/feeds/update.sh <...> ``` it looks like `nix-update` might not really support flakes
19 lines
308 B
Nix
19 lines
308 B
Nix
{ lib
|
|
, curl
|
|
, jq
|
|
, runtimeShell
|
|
, writeScript
|
|
# feed-specific args
|
|
, jsonPath
|
|
, url
|
|
}:
|
|
|
|
let
|
|
apiQuery = "https://feedsearch.dev/api/v1/search?url=${url}";
|
|
in
|
|
writeScript "update-feed" ''
|
|
#!${runtimeShell}
|
|
PATH=${lib.makeBinPath [ curl jq ]}
|
|
curl -X GET '${apiQuery}' | jq '.[-1]' > '${jsonPath}'
|
|
''
|