Home Explore Blog CI



nixpkgs

nixos/doc/manual/development/importing-modules.section.md
d2ea49aeb0b0e04d5b30fdb5e5645ac15943127bd79aa3360000000300000180
# 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
9d8ecc15 (1st chunk of `nixos/doc/manual/development/importing-modules.section.md`)
Title: Importing Modules in NixOS
Summary
NixOS modules that are not part of Nixpkgs can be imported into the configuration using the `imports` attribute. This allows the use of locally available module definitions, as demonstrated by importing `./example-module/default.nix`.