Prerequisites

Global prerequisites

Make sure to follow EPNix’s global Prerequisites.

NixOS configuration flake

Make sure your NixOS configuration is a Nix flake.

If you’re not sure how to do this, you can follow the Creating an Archiver Appliance instance tutorial, which provides a good introduction on creating a NixOS VM.

Importing the EPNix NixOS module

If you have such a configuration, make sure that:

  • You have the epnix flake input

  • You have added epnix as an argument to your flake outputs

  • You have imported EPNix’s NixOS module

flake.nix — Importing the EPNix NixOS module
{
  # ...
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
  inputs.epnix.url = "github:epics-extensions/EPNix/nixos-25.11";

  # ...
  outputs = {
    self,
    nixpkgs,
    epnix,
  }: {
    nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
      modules = [
        epnix.nixosModules.nixos

        # ...
      ];
    };
  };
}

Hostname consistency

In your flake.nix, you should see the line nixosConfigurations.hostname = ....

Make sure the specified hostname is consistent with the machine’s hostname, which is defined by the option networking.hostName.

Installing the nixos-rebuild utility

To rebuild a NixOS configuration, you need the nixos-rebuild command.

Tip

If you’re rebuilding the configuration locally on the NixOS system, the command is already provided.

If you’re rebuilding a NixOS configuration remotely, for example on a developer machine, you can install it by running:

Installing the nixos-rebuild utility
nix-env -iA nixpkgs.nixos-rebuild