diff --git a/nixarr/nixarr-command/default.nix b/nixarr/nixarr-command/default.nix index 34086fb..cdc977c 100644 --- a/nixarr/nixarr-command/default.nix +++ b/nixarr/nixarr-command/default.nix @@ -26,6 +26,9 @@ with lib; let echo " list-api-keys Lists API keys of supported enabled services." echo " list-unlinked Lists unlinked directories and files, in the given directory." echo " Use the jdupes command to hardlink duplicates from there." + echo " wipe-uids-gids The update on 2025-06-07 causes issues with UID/GIDs," + echo " run this command, then rebuild and finally run" + echo " nixarr fix-permissions, to fix these issues." exit 1 fi @@ -161,14 +164,26 @@ with lib; let ''} } - migrate() { - echo "Backing up /etc/passwd and /etc/group" + wipe-uids-gids() { + if [ "$EUID" -ne 0 ]; then + echo "Please run as root" + exit + fi + + echo "Backing up /etc/passwd and /etc/group..." mkdir "${nixarr.stateDir}/migration-backup" cp /etc/passwd "${nixarr.stateDir}/migration-backup/passwd.bak" cp /etc/group "${nixarr.stateDir}/migration-backup/group.bak" + echo "Wiping all nixarr users and groups from /etc/passwd and /etc/group..." + sed -iE '/^(audiobookshelf|autobrr|bazarr|cross-seed|jellyfin|jellyseerr|lidarr|plex|prowlarr|radarr|readarr|recyclarr|sabnzbd|sonarr|streamer|torrenter|transmission|usenet)/d' /etc/passwd + sed -iE '/^(autobrr|cross-seed|jellyseerr|media|prowlarr|recyclarr|sabnzbd|streamer|torrenter|transmission|usenet)/d' /etc/group + + echo "" + echo "Done, please rebuild your configuration to get back the users and groups. This time, they will have the correct permissions." + echo "After rebuilding, make sure to run: nixarr fix-permissions" } COMMAND="$1" @@ -183,6 +198,9 @@ with lib; let list-api-keys) list-api-keys ;; + wipe-uids-gids) + wipe-uids-gids + ;; esac ''; }; diff --git a/util/globals/default.nix b/util/globals/default.nix index 88fa464..a7ec655 100644 --- a/util/globals/default.nix +++ b/util/globals/default.nix @@ -37,10 +37,10 @@ in { }; gids = { autobrr = 188; - prowlarr = 287; cross-seed = 183; jellyseerr = 250; media = 169; + prowlarr = 287; recyclarr = 269; };