nix-files/pkgs/feeds/update.nix
colin 965d7eedbb define a per-feed update script
it currently has to be run manually:
```
./pkgs/feeds/update.sh <...>
```

it looks like `nix-update` might not really support flakes
2023-01-10 10:53:59 +00:00

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}'
''