hello,

i would like to print the filename + loc of configuration.nix port
assignment in port-module.nix 'throw' line. how to get this information
from nix?

* in nixpkgs/lib/types.nix i see `loc` information for the various merge
functions.
* lib nixpkgs/lib/debug.nix i found traceCall/traceCall2/traceCall3 but
no examples of those in usage

IIRC there was a function which traces back the value to the filename +
loc but i can't find it anymore.

anyone knows how to get these values?






# configuration.nix
  services.portBB = {
    "lastlog.de" = {
      "/status" = {
        port = 8000;
        path = "/status";
      };
    };
  };

# port-module.nix:

    services.portBB = mkOption {
      type = types.attrsOf (types.attrsOf (types.submodule {
        options.port = mkOption {
          type = types.int;
          apply = p: if p == 8000 then throw "Port ${toString p} may not
be used!" else p;
        };

        options.path = mkOption {
          type = types.path;
        };
      }));
    };

_______________________________________________
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to