Jump to content

Cheatsheet: Difference between revisions

379 bytes added ,  19 November 2020
Add "Evaluating NixOS configuration without building"
imported>Nh2
(Add "Evaluate packages for a different platform")
imported>Nh2
(Add "Evaluating NixOS configuration without building")
Line 370: Line 370:
$ nixos-rebuild -I nixpkgs=https://github.com/nixcloud/nixpkgs/archive/release-17.03.tar.gz switch
$ nixos-rebuild -I nixpkgs=https://github.com/nixcloud/nixpkgs/archive/release-17.03.tar.gz switch
</syntaxHighlight>
</syntaxHighlight>
=== Evaluating NixOS configuration without building ===
If you only want to evaluate `configuration.nix` without building (e.g. to syntax-check or see if you are using module options correctly), you can use:
<syntaxHighlight lang="console">
$ nix-instantiate '<nixpkgs/nixos>' -A system
</syntaxHighlight>
This creates the `.drv` file that `nixos-rebuild build` would build.


=== Building a service as a VM (for testing) ===
=== Building a service as a VM (for testing) ===
Anonymous user