Adding programs to PATH: Difference between revisions

Axka (talk | contribs)
m Put commands into code blocks
Tags: Mobile edit Mobile web edit Visual edit
Axka (talk | contribs)
m Add example of running hello in an ad-hoc flake-based devshell
Tags: Mobile edit Mobile web edit Visual edit
Line 52: Line 52:
Run the following command to create a new shell with the <code>hello</code> package from the <code>nixpkgs</code> [[Flakes|flake]] added to the <code>PATH</code> environment variable.<syntaxhighlight lang="shell-session">
Run the following command to create a new shell with the <code>hello</code> package from the <code>nixpkgs</code> [[Flakes|flake]] added to the <code>PATH</code> environment variable.<syntaxhighlight lang="shell-session">
[username@hostname:~]$ nix shell nixpkgs\#hello
[username@hostname:~]$ nix shell nixpkgs\#hello
[username@hostname:~]$ hello
Hello, world!


[username@hostname:~]$
[username@hostname:~]$