Commit e64f987f authored by Robert Hensing's avatar Robert Hensing
Browse files

writers.makeDataWriter: Deprecate

parent 79130267
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ rec {
  #   writeJSON = makeDataWriter { input = builtins.toJSON; output = "cp $inputPath $out"; };
  #   myConfig = writeJSON "config.json" { hello = "world"; }
  #
  makeDataWriter = { input ? lib.id, output ? "cp $inputPath $out" }: nameOrPath: data:
  makeDataWriter = lib.warn "pkgs.writers.makeDataWriter is deprecated. Use pkgs.writeTextFile." ({ input ? lib.id, output ? "cp $inputPath $out" }: nameOrPath: data:
    assert lib.or (types.path.check nameOrPath) (builtins.match "([0-9A-Za-z._])[0-9A-Za-z._-]*" nameOrPath != null);
    let
      name = last (builtins.split "/" nameOrPath);