
This gets rid of a potentially confusing behavior that doesn't need to be in NixOS, and nobody ever bothered to add a test for it. Let's keep things simple! The suggested snippet is better than this feature ever was, and will be in the user's face, where it belongs, kindly. Tested with nix-instantiate nixos/lib/eval-config.nix --arg modules '[{fileSystems."/".device="x";boot.loader.grub.enable=false;}]' -A config.system.build.toplevel NIXOS_EXTRA_MODULE_PATH=$HOME/whatever.nix nix-instantiate nixos/lib/eval-config.nix --arg modules '[{fileSystems."/".device="x";boot.loader.grub.enable=false;}]' -A config.system.build.toplevel
384 B
384 B
Importing Modules
Sometimes NixOS modules need to be used in configuration but exist outside of Nixpkgs. These modules can be imported:
{ config, lib, pkgs, ... }:
{
imports =
[ # Use a locally-available module definition in
# ./example-module/default.nix
./example-module
];
services.exampleModule.enable = true;
}