Home Explore Blog Models CI



nixpkgs

nixos/doc/manual/development/importing-modules.section.md
0f6243c58b11d1c536f98c26c75fd87b8358da57a58a038e0000000300000180
# 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;
}
```

Chunks
6ad1d8e6 (1st chunk of `nixos/doc/manual/development/importing-modules.section.md`)
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.