Nixpkgs: Deprecate propagatedUserEnvPkgs

Created on 5 Jul 2018  路  6Comments  路  Source: NixOS/nixpkgs

Issue description

With Nix 2.0 having the nix run command, we can no longer assume that packages will be installed by users before being run. It seems like this is a good opportunity to officially deprecate propagatedUserEnvPkgs as it only works when something is installed. Otherwise people are encouraged to utilize this for certain things, where they should instead use makeWrapper.

Also it would be nice to get rid of Nix's support for nix-support/propagated-user-env-packages but I am much more concerned about Nixpkgs use of it.

$ find . -type d -exec grep --color -nH --null -e propagatedUserEnvPkgs \{\} +
./pkgs/misc/themes/plano/default.nix:16:  propagatedUserEnvPkgs = [ gtk-engine-murrine ];
./pkgs/misc/themes/jade1/default.nix:14:  propagatedUserEnvPkgs = [ gtk-engine-murrine ];
./pkgs/misc/themes/materia-theme/default.nix:18:  propagatedUserEnvPkgs = [ gtk-engine-murrine ];
./pkgs/misc/themes/orion/default.nix:12:  propagatedUserEnvPkgs = [ gtk-engine-murrine ];
./pkgs/misc/themes/numix-solarized/default.nix:18:  propagatedUserEnvPkgs = [ gtk-engine-murrine ];
./pkgs/misc/themes/greybird/default.nix:17:  propagatedUserEnvPkgs = [ gtk-engine-murrine ];
./pkgs/misc/themes/blackbird/default.nix:17:  propagatedUserEnvPkgs = [ gtk-engine-murrine ];
./pkgs/misc/themes/numix/default.nix:18:  propagatedUserEnvPkgs = [ gtk-engine-murrine ];
./pkgs/misc/themes/vertex/default.nix:17:  propagatedUserEnvPkgs = [ gtk-engine-murrine ];
./pkgs/misc/themes/obsidian2/default.nix:14:  propagatedUserEnvPkgs = [ gtk-engine-murrine ];
./pkgs/misc/themes/arc/default.nix:23:  propagatedUserEnvPkgs = [ gtk-engine-murrine ];
./pkgs/misc/themes/adapta/default.nix:32:  propagatedUserEnvPkgs = [ gtk-engine-murrine ];
./pkgs/misc/themes/zuki/default.nix:16:  propagatedUserEnvPkgs = [ gtk-engine-murrine ];
./pkgs/misc/themes/numix-sx/default.nix:12:  propagatedUserEnvPkgs = [ gtk-engine-murrine ];
./pkgs/tools/misc/alarm-clock-applet/default.nix:41:  propagatedUserEnvPkgs = [ gnome2.GConf.out ];
./pkgs/tools/security/hash-slinger/default.nix:22:  propagatedUserEnvPkgs = [ unbound libreswan ];
./pkgs/tools/security/kwalletcli/default.nix:37:  propagatedUserEnvPkgs = [ mksh ];
./pkgs/tools/networking/network-manager/applet.nix:35:  propagatedUserEnvPkgs = [
./pkgs/tools/bluetooth/blueman/default.nix:33:  propagatedUserEnvPkgs = [ obex_data_server ];
./pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh:41:        propagatedUserEnvPkgs+=" $1"
./pkgs/development/libraries/kde-frameworks/kservice/default.nix:17:  propagatedUserEnvPkgs = [ shared-mime-info ]; # for kbuildsycoca5
./pkgs/development/libraries/kde-frameworks/solid.nix:16:  propagatedUserEnvPkgs = [ media-player-info ];
./pkgs/development/libraries/kde-frameworks/default.nix:49:                    propagatedUserEnvPkgs="$propagatedUserEnvPkgs @${out}@"
./pkgs/development/libraries/grantlee/5/setup-hook.sh:10:        propagatedUserEnvPkgs+=" $1"
./pkgs/development/ruby-modules/gem/default.nix:48:, propagatedUserEnvPkgs ? []
./pkgs/development/ruby-modules/gem/default.nix:213:  propagatedUserEnvPkgs = gemPath ++ propagatedUserEnvPkgs;
./pkgs/development/compilers/swift/default.nix:163:  propagatedUserEnvPkgs = [ git pkgconfig ];
./pkgs/development/compilers/chicken/eggDerivation.nix:22:  propagatedUserEnvPkgs = buildInputs ++ [ chicken ];
./pkgs/desktops/plasma-5/default.nix:51:                    propagatedUserEnvPkgs="$propagatedUserEnvPkgs @${out}@"
./pkgs/desktops/deepin/deepin-gtk-theme/default.nix:14:  propagatedUserEnvPkgs = [ gtk-engine-murrine ];
./pkgs/desktops/gnome-3/core/gnome-contacts/default.nix:17:  propagatedUserEnvPkgs = [ evolution-data-server ];
./pkgs/desktops/gnome-3/core/empathy/default.nix:25:  propagatedUserEnvPkgs = [
./pkgs/desktops/gnome-3/core/sushi/default.nix:19:  propagatedUserEnvPkgs = [ gst_all_1.gstreamer gst_all_1.gst-plugins-base gst_all_1.gst-plugins-good ];
./pkgs/desktops/gnome-3/core/gnome-shell/default.nix:48:  propagatedUserEnvPkgs = [
./pkgs/desktops/gnome-3/apps/gnome-nettool/default.nix:18:  propagatedUserEnvPkgs = [ nmap inetutils ];
./pkgs/desktops/gnome-3/apps/gnome-boxes/default.nix:28:  propagatedUserEnvPkgs = [ spice-gtk ];
./pkgs/desktops/gnome-3/apps/evolution/default.nix:17:  propagatedUserEnvPkgs = [ gnome3.evolution-data-server ];
./pkgs/desktops/gnome-3/apps/polari/default.nix:17:  propagatedUserEnvPkgs = [ telepathy-idle telepathy-logger ];
./pkgs/desktops/mate/mate-themes/default.nix:17:  propagatedUserEnvPkgs = [ gtk-engine-murrine ];
./pkgs/top-level/emacs-packages.nix:182:    propagatedUserEnvPkgs = [ external.elpy ] ++ packageRequires;
./pkgs/top-level/emacs-packages.nix:245:    propagatedUserEnvPkgs = [ external.ghc-mod ];
./pkgs/top-level/emacs-packages.nix:280:    propagatedUserEnvPkgs = [ external.hindent ];
./pkgs/top-level/emacs-packages.nix:299:    propagatedUserEnvPkgs = [ external.rtags ];
./pkgs/top-level/emacs-packages.nix:363:    propagatedUserEnvPkgs = [ external.structured-haskell-mode ];
./pkgs/applications/misc/onboard/default.nix:96:  propagatedUserEnvPkgs = [
./pkgs/applications/misc/yakuake/default.nix:58:  propagatedUserEnvPkgs = [ konsole ];
./pkgs/applications/office/kexi/default.nix:30:  propagatedUserEnvPkgs = [ kproperty ];
./pkgs/applications/office/gnucash/2.4.nix:27:  propagatedUserEnvPkgs = [ gconf ];
./pkgs/applications/office/gnucash/default.nix:44:  propagatedUserEnvPkgs = [ dconf ];
./pkgs/applications/office/calligra/default.nix:43:  propagatedUserEnvPkgs = [ kproperty ];
./pkgs/applications/office/mendeley/default.nix:104:  propagatedUserEnvPkgs = [ gconf ];
./pkgs/applications/networking/instant-messengers/swift-im/default.nix:26:  propagatedUserEnvPkgs = [ GConf ];
./pkgs/applications/editors/jetbrains/default.nix:169:      propagatedUserEnvPkgs = [ python ];
./pkgs/applications/editors/emacs-modes/gh/default.nix:13:  propagatedUserEnvPkgs = [ pcache logito ];
./pkgs/applications/editors/emacs-modes/ensime/default.nix:12:  propagatedUserEnvPkgs = [ autoComplete dash s scalaMode2 sbtMode ];
./pkgs/applications/editors/emacs-modes/gist/default.nix:22:  propagatedUserEnvPkgs = [ gh pcache logito ];
./pkgs/applications/editors/emacs-modes/org2blog/default.nix:13:  propagatedUserEnvPkgs = [ org xmlRpc metaweblog ];
./pkgs/applications/editors/emacs-modes/jdee/default.nix:70:    propagatedUserEnvPkgs = propagatedBuildInputs; # FIXME: Not honored
./pkgs/applications/editors/emacs-modes/ecb/default.nix:13:  propagatedUserEnvPkgs = propagatedBuildInputs;
./pkgs/applications/editors/emacs-modes/color-theme-solarized/default.nix:15:  propagatedUserEnvPkgs = [ colorTheme ];
./pkgs/applications/editors/emacs-modes/metaweblog/default.nix:13:  propagatedUserEnvPkgs = [ xmlRpc ];
./pkgs/applications/editors/kile/default.nix:55:  propagatedUserEnvPkgs = [ konsole ];
./pkgs/applications/kde/konsole.nix:22:  propagatedUserEnvPkgs = [ (lib.getBin kinit) ];
./pkgs/applications/kde/kalarm.nix:36:  propagatedUserEnvPkgs = [ kdepim-runtime ];
./pkgs/applications/kde/spectacle.nix:19:  propagatedUserEnvPkgs = [ kipi-plugins libkipi ];
./pkgs/applications/kde/kate.nix:24:  propagatedUserEnvPkgs = [ konsole ];
./pkgs/applications/kde/gwenview.nix:20:  propagatedUserEnvPkgs = [ kipi-plugins libkipi (lib.getBin kinit) ];
./pkgs/applications/kde/kdebugsettings.nix:19:  propagatedUserEnvPkgs = [ ];
./pkgs/applications/kde/k3b.nix:33:  propagatedUserEnvPkgs = [ (lib.getBin kinit) ];
./pkgs/applications/kde/kmail.nix:28:  propagatedUserEnvPkgs = [ kdepim-runtime kwallet ];
./pkgs/applications/audio/paprefs/default.nix:16:  propagatedUserEnvPkgs = [ GConf ];
./pkgs/applications/backup/deja-dup/default.nix:40:  propagatedUserEnvPkgs = [ duplicity ];
./pkgs/applications/window-managers/velox/default.nix:33:  propagatedUserEnvPkgs = [ swc ];
./pkgs/applications/window-managers/awesome/default.nix:32:  propagatedUserEnvPkgs = [ hicolor-icon-theme ];
./pkgs/build-support/emacs/generic.nix:50:  propagatedUserEnvPkgs = packageRequires;
./pkgs/build-support/agda/default.nix:36:    propagatedUserEnvPkgs = self.buildDependsAgda;
./pkgs/games/gtetrinet/default.nix:17:  propagatedUserEnvPkgs = [ GConf ];

Most helpful comment

In my experience, propagatedUserEnvPkgs can almost always be wrapping (optionally with trivial patch). What is much worse are dependencies on systemd services (e.g. https://github.com/NixOS/nixpkgs/issues/42873#issuecomment-404226924).

All 6 comments

From the website:

The latest and recommended version of Nix is 2.0.4. The quickest way to install it on Linux and macOS is to run the following in a shell (as a user other than root):

Given that and your information, a deprecation is the least that could be done. Straight up deletion of propagatedUserEnvPkgs and using whatever works now is also fine with me as long as people can upgrade to Nix 2.

Alternatively, it wouldn't be hard to add support for propagatedUserEnvPkgs to nix run.

Alternatively, it wouldn't be hard to add support for propagatedUserEnvPkgs to nix run.

Is it worth supporting though? It seems like something that will hit you in a lot of different ways - not just nix run. I often will do a nix build and then execute directly with ./result/bin/* & hit this especially with Qt stuff.

Also exportReferencesGraph doesn't recognize propagatedUserEnvPkgs. This is probably correct behavior but also unexpected in some cases. If you want to make an ISO or use nix-bundle, you will have to specify them manually (or hope that it ends up in the closure for some other reason). It makes more sense to me to just use makeWrapper - even if that will lead to bigger closure sizes.

Note there are also some occurrences of propagatedUserEnvPackages (https://github.com/NixOS/nixpkgs/pull/34798).

I like to see this removed, because I think we should be able to run everything directly from the store. At the same time, I know some people like to be able to install individual packages and let them be discovered automatically, in which case this attribute is sometimes needed for dependencies.

In my experience, propagatedUserEnvPkgs can almost always be wrapping (optionally with trivial patch). What is much worse are dependencies on systemd services (e.g. https://github.com/NixOS/nixpkgs/issues/42873#issuecomment-404226924).

I'm not sure symlinking is better than propagating. For example, if I install package A (which symlinks parts of B) and package B, then the user environment builder might fail due to collisions between A and B. (Not entirely sure about that though - it might be that the collision check is on canonicalized symlink targets.)

Also, symlinking is potentially more expensive (since you have to symlink an unbounded number of files).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matthiasbeyer picture matthiasbeyer  路  3Comments

retrry picture retrry  路  3Comments

copumpkin picture copumpkin  路  3Comments

lverns picture lverns  路  3Comments

yawnt picture yawnt  路  3Comments