6 inherit (pkgs) buildPackages callPackage;
8 libconfig-generator = buildPackages.rustPlatform.buildRustPackage {
9 name = "libconfig-generator";
13 passthru.updateScript = ./update.sh;
15 cargoLock.lockFile = ./src/Cargo.lock;
19 buildPackages.runCommandCC "libconfig-validator"
21 buildInputs = with buildPackages; [ libconfig ];
25 $CC -lconfig -x c - -o "$out/bin/libconfig-validator" ${./validator.c}
31 generator ? libconfig-generator,
32 validator ? libconfig-validator,
51 description = "libconfig value";
89 stdenvNoCC.mkDerivation rec {
93 preferLocalBuild = true;
95 json = builtins.toJSON value;
96 passAsFile = [ "json" ];
99 nativeBuildInputs = [ libconfig-generator ];
102 libconfig-generator < $jsonPath > output.cfg
107 nativeCheckInputs = [ libconfig-validator ];
110 libconfig-validator output.cfg
120 passthru.json = writeText "${name}.json" json;
124 libconfig-generator = generator;
125 libconfig-validator = validator;