Nixpkgs/Create and debug packages: Difference between revisions

imported>Eisfreak7
FixPhase seems to be a misspell of FixupPhase, InstallPhase was mentioned twice
imported>Bencoman
made example more concrete. corrected some $NIXREPO to $NIXPKGS
Line 23: Line 23:


== How to install from the local repository ==
== How to install from the local repository ==
For the sake of this article, let's set an environment variable which points to the directory where we've cloned our repo.
For expediency, we'll shallow clone direct from the distribution repo and set an environment variable pointing to it.


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
$ export NIXPKGS=/path/to/clone/of/nixpkgs
$ mkdir -p ~/tmpdev && cd ~/tmpdev
$ git clone --depth=1 https://github.com/nixos/nixpkgs
$ export NIXPKGS=~/tmpdev/nixpkgs
</syntaxhighlight>
</syntaxhighlight>


Line 32: Line 34:


'''example: list all available software''' from the local repository
'''example: list all available software''' from the local repository
$NIXREPOS/nixpkgs
$NIXPKGS
<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
$ nix-env -f $NIXPKGS -qaP '*'
$ nix-env -f $NIXPKGS -qaP '*'
Line 42: Line 44:
</syntaxhighlight>
</syntaxhighlight>


'''example: update the system''' based on your local '''$NIXREPOS'''
'''example: update the system''' based on your local '''$NIXPKGS'''
<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
$ nixos-rebuild -I nixos=$NIXPKGS/nixos -I nixpkgs=$NIXPKGS switch
$ nixos-rebuild -I nixos=$NIXPKGS/nixos -I nixpkgs=$NIXPKGS switch