[Nix-dev] Declarative user management merged to master

James Cook james.cook at utoronto.ca
Mon Feb 10 23:08:20 CET 2014


On 10 February 2014 00:26, Pascal Wittmann <PascalWittmann at gmx.net> wrote:
> On 02/10/2014 09:00 AM, Rickard Nilsson wrote:
>> This sounds strange. If you don't have uid=78 in your passwd file, then
>> the new implementation has touched it, but left the older (499) lightdm
>> user intact. Then the lightdm service really shoule be running as 499,
>> and I can't find anything in NixOS that picks the lightdm uid directly
>> and does a chown or something like that.
>>
>> But after your chown-command, /var/lib/lightdm is now owned by 499, right?
>
> I guess it happens here:
>
>   test "$(stat -c %u "${h}")" = ${uid} || chown ${uid} "${h}" || true
>
> https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/config/users-groups.nix#L437
>
> At least I had the same problem with my user. The ids in
> configuration.nix and in /etc/passwd differed and my home directory was
> owned by "the uid". I solved it by using in configuration.nix the id
> from /etc/passwd. But first I changed uid to u.name in the above line,
> which also worked.
>
> Regards Pascal

I confirm this.  Changing it to use names instead of uids fixes the
problem for me.  The following commit shows the complete change I
made, but don't merge it, because that branch is my personal head with
a bunch of junk on it.  The commit also uses group name instead of
gid, although this was not an issue for me.

  https://github.com/falsifian/nixpkgs/commit/0a8089861c270011d1ad2da7d5eedf5470514428

James


More information about the nix-dev mailing list