Home Explore Blog Models CI



nixpkgs

nixos/doc/manual/configuration/ad-hoc-network-config.section.md
d8e0481353baa2f05ab49ec78248a3f8d9c532038e5da2a100000003000001a2
# Ad-Hoc Configuration {#ad-hoc-network-config}

You can use [](#opt-networking.localCommands) to
specify shell commands to be run at the end of `network-setup.service`. This
is useful for doing network configuration not covered by the existing NixOS
modules. For instance, to statically configure an IPv6 address:

```nix
{
  networking.localCommands = ''
    ip -6 addr add 2001:610:685:1::1/64 dev eth0
  '';
}
```

Chunks
c58692e3 (1st chunk of `nixos/doc/manual/configuration/ad-hoc-network-config.section.md`)
Title: Ad-Hoc Network Configuration in NixOS
Summary
This section explains how to perform ad-hoc network configurations in NixOS using the `networking.localCommands` option. This allows users to specify custom shell commands to be executed at the end of `network-setup.service`, enabling network setups not covered by standard NixOS modules. An example demonstrates how to statically configure an IPv6 address on an interface.