I am trying to use Nixos as my docker host. Everything works fine except for weird behavior when it comes to the config files. When the containers start up and apply permissions to /config instead of using the supplied PUID and PGID it instead uses (PUID -1+100000) and (PGID-1+100000).

For example if I supply 1026 as the PUID and 100 as the PGID it applies 101025 as the owner and 100099 as the group.

This is my docker config from my configuration.nix:

  # Docker Config
  virtualisation.docker.enable = true;
  virtualisation.docker.rootless = {
    enable = true;
    setSocketVariable = true;
  };

And this is a sample docker-compose config:

services:
  jackett:
      image: ghcr.io/linuxserver/jackett:latest
      container_name: jackett
      environment:
          - PUID=${PUID_NEW}
          - PGID=${PGID_NEW}
          - TZ=${TZ}
      volumes:
          - '${DOCKER_CONFIG}/jackett:/config'
          - '${SHARE_DRIVE}:/downloads'
      networks:
          - medianetwork
      ports:
          - 9117:9117
      restart: always