feat: add script to fix UID changes
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
fab9209726
commit
e8fff0bbd3
1 changed files with 12 additions and 0 deletions
12
outputs.nix
12
outputs.nix
|
@ -161,6 +161,18 @@
|
|||
isoConfig="nixosConfigurations.live-image.config.system.build.isoImage"
|
||||
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
|
||||
'';
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue