`nix-env` and `nix-shell` installing packages in slightly different manner

I’ve installed firefox-devedition-bin from the latest nixos-19.09 branch, and it works fine. This is the output I get for the command nix-shell -p firefox-devedition-bin:

[$] nix-shell -p firefox-devedition-bin                                  [0:08:59]
these derivations will be built:
  /nix/store/2svwkwj9pwgm1lpn617yyr87ddb9xyc4-builder.pl.drv
  /nix/store/1s1q1jaa5ghhg045rc8cl2ivmrkna0gz-libGLU-combined.drv
  /nix/store/hxibd5hgscfcpbxg4qihbk6g8md6mxm4-firefox-70.0b2.tar.bz2.drv
  /nix/store/i6i462snj0wnx21b0ga4jgkc91pmv5ic-no-update-firefox-policy.json.drv
  /nix/store/gfpq4ad9cd6wmagrfz39pggkq8wzxgii-firefox-devedition-bin-unwrapped-70.0b2.drv
  /nix/store/ww1bga99lgd3lcpg3dsq3cnzvyy9kcmm-firefox.desktop.drv
  /nix/store/v31dcklvkspbk26ji7m1vyvkydkx305b-firefox-devedition-bin-70.0b2.drv
these paths will be fetched (3.77 MiB download, 19.05 MiB unpacked):
  /nix/store/00px5xlsyvlaipflhhayi2whs3hvmx59-libpulseaudio-12.2-dev
  /nix/store/4wlrl2zmbq0dckj478adqn5l4h4lbiqr-libgnomeui-2.24.5
  /nix/store/6nymihdg758lcazjkzasnf5h7mrmj4vl-libglade-2.6.4
  /nix/store/8vlfc6rxsjfx1n26qb1ajdb66f824ari-libgnome-2.32.1
  /nix/store/9fday4azl3rsgsvmxy3r3lxbp8ay9rns-libart_lgpl-2.3.21
  /nix/store/anrzb9rkp1f3ky713d35q908h9n63rmr-libcap-2.27-dev
  /nix/store/bwl8zxwwsr4s465hjvsls0ma8m6sfywz-libbonobo-2.32.1
  /nix/store/cybf2cd025ymnahxqg5yj40bzhldba9j-attr-2.4.48-dev
  /nix/store/h187aapfd738vg648ybl3c8291l2w20m-libbonoboui-2.24.5
  /nix/store/i89khng8jfw5lcj8vcp6w9g9404invyb-heimdal-7.7.0
  /nix/store/sidvbfhz81n7k1hxq3b3bqvq6b7a763c-libgnomecanvas-2.30.3
  /nix/store/wwdmx03ff6flhvm5lz48ydh93smham5s-lndir-1.0.3
  /nix/store/ydlzjliryvqdaqmda609b95kh9nmh3mk-libgnome-keyring-2.32.0

Why is nix-shell installing these additional packages? This is how I installed firefox in my environment:

I have a pkgs.nix:

with pkgs; {
  applications = [
    ...
    firefox-devedition-bin
    ...
  ];
  
  system = [
    ...
    applications
    ...
  ];
}

Command used:

nix-env -f "pkgs.nix" -iA system

maybe you use different channels?

nix-env by default uses manifest.nix, which is how channels are implemented under the hood. Same thing goes when you do nix-shell -p, but you showed that you install from pkgs.nix. Which means, you use <nixpkgs> from $NIX_PATH. But nix-shell uses user’s manifest. It may be that your $NIX_PATH points somehow to root channels, thus you have different channels.