feat: add script to fix UID changes
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-11-22 20:36:56 -05:00
parent fab9209726
commit e8fff0bbd3

View file

@ -161,6 +161,18 @@
isoConfig="nixosConfigurations.live-image.config.system.build.isoImage" isoConfig="nixosConfigurations.live-image.config.system.build.isoImage"
nom build $(realpath /etc/nixos)#$isoConfig nom build $(realpath /etc/nixos)#$isoConfig
'') '')
(pkgs.writeShellApplication {
name = "fixUidChange";
text = ''
GROUP="$1"
OLD_GID="$2"
NEW_GID="$3"
sudo sed -i -e "/^$GROUP:/d" /etc/group # Remove generated group entry
sudo find / -gid "$OLD_GID" -exec chgrp "$NEW_GID" {} + # Change GID on existing files
sudo nixos-rebuild --switch # Regenerate /etc/group with new GID
'';
})
]; ];
}; };