Home Explore Blog CI



nixpkgs

1st chunk of `nixos/doc/manual/development/importing-modules.section.md`
9d8ecc151fc13327dc70fa566a73d6ba52406140fc5cb0b10000000100000180
# 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 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`.