After creating two compatible configuration units, an import may be created by hovering the target configuration unit and selecting the "Import" button, shown with an arrow pointing down.
Shown below is an example of a NixOS modules nginx containing settings for the nginx web server. To the left is shown the import menu used to assign an import of the nginx NixOS module into the NixOS configuration nixos. The right image shows the created import.
How to import between flakes
Imports can also be used between compatible configuration units defined in separate flakes.
Create the configuration unit to import in the flake to be imported from. In the example below this is the user-alpha NixOS module in the flake mynixos/my-user-configs.
Create a released version of the flake which is imported from. In the example below this is the mynixos/my-user-configs flake.
Create the configuration unit to import into in a second flake. In the example below this is the nixos NixOS configuration in the mynixos/my-os-configs flake.
Navigate to the configuration unit to import from. In the example below this is the mynixos-my-user-configs flake.
Ensure that the flake being imported into is selected in the flake selector to the upper right of the screen. In the example below this is the mynixos/my-os-configs flake selected in the upper right corner.
Click the "Export" button on the exporting configuration unit (with the upwards pointing arrow), and select the importing configuration unit. In the example below this is the user-alpha NixOS module in the first image, selecting the nixos target configuration unit in the mynixos/my-os-configs flake.
The configuration units must be compatible as described in "Allowed imports".