Hi. I need to do non-trivial string calculations (encrypt the password
with openssl) which AFAIK can't be written in Nix at the moment.
That's why I think about Nix `eval` equivalent. I wonder if it goes
against Nix concepts or not? My implementation looks like the
following:

  encryptPassword = salt: pass : let
    p = runCommand "encryptPassword" {} ''
      printf '"%s"\n' `${openssl}/bin/openssl passwd -1 -salt ${salt}
${pass}` > $out
      '';
    in
      import p;   # <=== (1)

It works but note the `import' expression. I tried builtins.readFile
instead of it in previous attempt but failed: Nix issued  [error:
string `... (1)' cannot refer to other paths] error. What is the
reason of such a difference between readFile and import?

Regards,
Sergey
_______________________________________________
nix-dev mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to