nix-helpers: 6d6b835b17e51bac1629023021d5248e79e329ce

     1: {
     2:   die,
     3:   hello,
     4:   lib,
     5:   nothing,
     6: }:
     7: 
     8: with builtins;
     9: with lib;
    10: with import ./util.nix { };
    11: with rec {
    12:   stillNeeded = typeOf (toPath ./.) == "string";
    13:   obsoleteWarn =
    14:     x:
    15:     if stillNeeded then
    16:       x
    17:     else
    18:       trace "WARNING: toPath makes paths, is asPath now redundant?" x;
    19: 
    20:   # We must discard any existing context, to prevent the Nix error message
    21:   # "a string that refers to a store path cannot be appended to a path". Note
    22:   # that it's safe to do this, because a new context will be created when the
    23:   # resulting path gets converted to a string (e.g. as a derivation attribute).
    24:   go =
    25:     path:
    26:     if typeOf path == "path" then
    27:       path
    28:     else
    29:       rootPath + (unsafeDiscardStringContext "${path}");
    30: };
    31: 
    32: obsoleteWarn go

Generated by git2html.