Home Explore Blog Models CI



nixpkgs

1st chunk of `nixos/doc/manual/development/importing-modules.section.md`
6ad1d8e655466b3d620d8f561e9a56e2833dbfb6c63823e10000000100000180
# Importing Modules {#sec-importing-modules}

Sometimes NixOS modules need to be used in configuration but exist
outside of Nixpkgs. These modules can be imported:

```nix
{
  config,
  lib,
  pkgs,
  ...
}:

{
  imports = [
    # Use a locally-available module definition in
    # ./example-module/default.nix
    ./example-module
  ];

  services.exampleModule.enable = true;
}
```

Title: Importing External NixOS Modules
Summary
This chunk explains how to import NixOS modules that are not part of Nixpkgs into a configuration. It demonstrates this using the `imports` attribute within a NixOS configuration, showing an example of importing a locally-available module definition (e.g., from `./example-module/default.nix`) and subsequently enabling a service defined within it.