nix-csv/README.md

555 B

nix-csv

Load a csv and use it in your nix as an attribute.

The challenge here is, that you could -in theory- parse files in nix directly, but nix is really bad at this. What we do here, is using builtins.fromJSON by just converting the csv file to a json file first.

Quick summary of the pipeline:

test.csv -> csv-to-json -> test.json -> readFile -> fromJSON

See comments in flake.nix for how it works.

Technically this can adapted to any type of data source.