Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I reset my nix environment to the original user profile?

Tags:

nix

nixos

I believe I ran nix-env -if example.nix which changed my nix environment.

How can I undo this action?

I'm trying to run a application that is specified in my nixos config (/etc/nixos/*), however it no longer seems available (within the $PATH).


Seems it might be nix-env --switch-profile /nix/var/nix/profiles/default (according to https://nixos.org/nix/manual/#sec-profiles) ?

like image 877
Chris Stryczynski Avatar asked Dec 23 '18 16:12

Chris Stryczynski


1 Answers

I run nix-env -e '*' to remove all packages from my profile installed via nix-env regularly and move anything I want to use into environment.systemPackages so all my packages are tracked in my nixos configuration declaratively. As for debugging why the application specified in your configuration.nix isn't in your path, an application specified in your configuration.nix should be symlinked to /run/current-system/sw/bin, so the first thing would be to check that the binary you're looking for is listed in there and second that is in your $PATH.

like image 98
Samuel Leathers Avatar answered Sep 22 '22 15:09

Samuel Leathers