NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.38k stars 14.33k forks source link

Nixpkgs config (e.g. allowUnfree) when using `nix profile` #101101

Open kirelagin opened 4 years ago

kirelagin commented 4 years ago

When using the new flakes interface, e.g. nix profile, the nixpkgs configuration in ~/.config/nixpkgs/config.nix is ignored due to hermetic evaluation, so, e.g. it is not clear to me how to install unfree packages now. When I try to install a new package, the error is not helpful as it suggests using this file.

I think, this error needs to be updated to detect (?) that the evaluation is hermetic and recommend some other solution which will work.

samuelgrf commented 4 years ago

You can work around this by running NIXPKGS_ALLOW_UNFREE=1 nix profile --impure, but this shouldn't be a long term solution.

Nix issue about this: https://github.com/NixOS/nix/issues/3949 . There are plans for fixing this mentioned here: https://github.com/NixOS/nix/issues/3843#issuecomment-706084621

doronbehar commented 4 years ago

See also: https://github.com/NixOS/nixpkgs/pull/101367 .

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info

doronbehar commented 3 years ago

Still an issue.

mausch commented 1 year ago

You can work around this by running NIXPKGS_ALLOW_UNFREE=1 nix profile --impure

This flag doesn't seem to exist?

$ NIXPKGS_ALLOW_UNFREE=1 nix profile --impure install .#
error: unrecognised flag '--impure'

Nix 2.15.1

iFreilicht commented 1 year ago

@mausch --impure is an argument of install, not profile. Try it like this:

NIXPKGS_ALLOW_UNFREE=1 nix profile install --impure .#