From 6e528893a8ccaf3fa4ad23bc0e4d18c679c1f37d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Fri, 1 Jul 2016 13:04:24 +0200 Subject: [PATCH] nixos/update-users-groups.pl: print UIDs and GIDs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of showing this output from "nixos-rebuild switch": warning: not applying GID change of group ‘munin’ warning: not applying UID change of user ‘ntp’ print this: warning: not applying GID change of group ‘munin’ (95 -> 102) warning: not applying UID change of user ‘ntp’ (3 -> 179) This makes it possible for users to take action and fixup the UIDs/GIDs that NixOS won't touch. --- nixos/modules/config/update-users-groups.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/config/update-users-groups.pl b/nixos/modules/config/update-users-groups.pl index de73de91629..967f427374b 100644 --- a/nixos/modules/config/update-users-groups.pl +++ b/nixos/modules/config/update-users-groups.pl @@ -103,7 +103,7 @@ foreach my $g (@{$spec->{groups}}) { if (defined $existing) { $g->{gid} = $existing->{gid} if !defined $g->{gid}; if ($g->{gid} != $existing->{gid}) { - warn "warning: not applying GID change of group ‘$name’\n"; + warn "warning: not applying GID change of group ‘$name’ ($existing->{gid} -> $g->{gid})\n"; $g->{gid} = $existing->{gid}; } $g->{password} = $existing->{password}; # do we want this? @@ -163,7 +163,7 @@ foreach my $u (@{$spec->{users}}) { if (defined $existing) { $u->{uid} = $existing->{uid} if !defined $u->{uid}; if ($u->{uid} != $existing->{uid}) { - warn "warning: not applying UID change of user ‘$name’\n"; + warn "warning: not applying UID change of user ‘$name’ ($existing->{uid} -> $u->{uid})\n"; $u->{uid} = $existing->{uid}; } } else {