Cheatsheet: Difference between revisions

imported>Fadenb
Syntax highlighting
imported>Lheckemann
Line 231: Line 231:
|In Debian, apt-get source gets both the patched upstream source and the recipe for the package. Those need two steps in Nix.
|In Debian, apt-get source gets both the patched upstream source and the recipe for the package. Those need two steps in Nix.


To find the package recipe: <syntaxhighlight lang="bash">grep -r emacs $(nix-instantiate --eval --expr '<nixpkgs>')</syntaxhighlight>
To find the package's attribute path: <syntaxhighlight lang="bash">nix-env -qaP emacs</syntaxhighlight> or <syntaxhighlight lang="bash">nox emacs</syntaxhighlight>
To download the source as specified by the package recipe: <syntaxhighlight lang="bash">nix-build '<nixpkgs>' -A emacs.src</syntaxhighlight>
To download the source as specified by the package recipe: <syntaxhighlight lang="bash">nix-build '<nixpkgs>' -A emacs.src</syntaxhighlight>
The patched source is usually not a derivation itself, but can be produced for most packages with the following command: <syntaxhighlight lang="bash">nix-shell '<nixpkgs>' -A emacs\
The patched source is usually not a derivation itself, but can be produced for most packages with the following command: <syntaxhighlight lang="bash">nix-shell '<nixpkgs>' -A emacs\