You can also make /etc/nixos/configuration.nix a symbolic link to /home/user/whatever/configuration.nix. Nix will follow symbolic links and resolve relative imports correctly, so imports = [ ./mymodule.nix ] will load /home/user/whatever/mymodule.nix.