NixOS modules: Difference between revisions

imported>Mth
No edit summary
imported>Asymmetric
add stub on developing modules
Line 206: Line 206:


(sorry, dont' have more time to make this into a nice little guide yet, but this links should be pretty good introductions into more advanced module system usages) qknight
(sorry, dont' have more time to make this into a nice little guide yet, but this links should be pretty good introductions into more advanced module system usages) qknight
== Developing modules ==
To test your module out, you can run the following from a local checkout of nixpkgs with a copy of a <code>configuration.nix</code>:
<syntaxhighlight lang="bash">
nixos-rebuild build-vm --fast -I nixos-config=./configuration.nix -I nixpkgs=.
</syntaxhighlight>.
If you're developing on top of master, this will potentially cause the compilation of lots of packages, since master is not cached on cache.nixos.org. To avoid that, you can develop your module on top of nixos-unstable, by adding it as a remote:
<syntaxhighlight lang="bash">
git remote add -f channels https://github.com/NixOS/nixpkgs-channels
git checkout -b mymodule channels/nixos-unstable
</syntaxhighlight>


== References ==
== References ==