Re: [Nix-dev] User and group ID ranges

2016-01-14 Thread Игорь Пашев
I use this function to get IDs:

 uid = name:
let
  dec = {
"0" =  0; "1" =  1; "2" =  2; "3" =  3;
"4" =  4; "5" =  5; "6" =  6; "7" =  7;
"8" =  8; "9" =  9; "a" = 10; "b" = 11;
"c" = 12; "d" = 13; "e" = 14; "f" = 15;
  };
  base = 10; # 2^31 > base + 16^7, 2^31 for JSON int
  hex = lib.toLower (builtins.substring 0 7 (builtins.hashString
"sha1" name));
  pow = b: n: lib.foldl builtins.mul 1 (builtins.genList (_: b) n);
  digits = lib.imap (i: d: {m = pow 16 (i - 1); d = d;})
(lib.stringToCharacters hex);
  f = a: {m, d}: a + m * dec.${d};

in lib.foldl f base digits;

2016-01-13 16:02 GMT+03:00 Christian Kauhaus :
> Hi,
>
> we are currently in the process of configuring users and groups with fixed
> UID/GID numbers from a central directory on a bunch of NixOS machines.
>
> I'd like to clarify some policy issues to avoid future ID conflicts.
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] matplotlib not found by python

2016-01-14 Thread Andrew Fraser
Bjørn,

Thank you for the pointer.  I'd hoped to recommend nix to some large
projects I work on.  As I understand the
https://github.com/NixOS/nixpkgs/issues/10597 thread, each user must do
some nix hacking to be able to use python packages.  While my colleagues
would not work in such an unfamiliar fashion, I may figure out something
for myself.

Andy


> "BF" == Bjørn Forsman  writes:

BF> On 14 January 2016 at 06:27, Andrew Fraser  
wrote:
>> [...]  I write today to ask for help getting matplotlib running. [...]

BF> That workflow is currently not supported. See
BF> https://github.com/NixOS/nixpkgs/issues/10597.

BF> Best regards, Bjørn Forsman
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev