Cheatsheet: Difference between revisions

imported>Balsoft
m Add information about nix-locate
imported>Balsoft
m nix-env -i is slow, replace with nix-env -iA
Line 70: Line 70:
2. Run :
2. Run :
<syntaxhighlight lang="console">$ sudo nixos-rebuild switch</syntaxhighlight>
<syntaxhighlight lang="console">$ sudo nixos-rebuild switch</syntaxhighlight>
|<syntaxhighlight lang="console">$ nix-env -i emacs</syntaxhighlight>
|<syntaxhighlight lang="console">$ nix-env -iA nixos.emacs</syntaxhighlight>
Or with collections, add the package to your ~/.nixpkgs/config.nix and run
Or with collections, add the package to your ~/.nixpkgs/config.nix and run
<syntaxhighlight lang="console">$ nix-env -i all</syntaxhighlight>
<syntaxhighlight lang="console">$ nix-env -iA nixos.all</syntaxhighlight>
|-
|-
|Install a package for a specific user only
|Install a package for a specific user only
Line 86: Line 86:
<syntaxhighlight lang="nix">users.users.alice.packages = with pkgs;[ emacs ];</syntaxhighlight>
<syntaxhighlight lang="nix">users.users.alice.packages = with pkgs;[ emacs ];</syntaxhighlight>
2. Run:
2. Run:
<syntaxhighlight lang="console">$ nix-env -i all</syntaxhighlight>
<syntaxhighlight lang="console">$ nix-env -iA nixos.all</syntaxhighlight>
|-
|-
|Install a service
|Install a service