3

My /etc/nixos/configuration.nix starts with { config, lib, modulesPath, pkgs, ... }:, because that's what was in whichever example I copied. A quick search through the NixOS manual, man nixos-generate-config, and man configuration.nix shows only examples with an even simpler { config, pkgs, ... }:.

Removing the , ... and running nixos-rebuild switch doesn't help; it prints the following three times:

error: anonymous function at /etc/nixos/configuration.nix:1:1 called with unexpected argument 'specialArgs', at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:372:8

How do I figure out its arguments?

1

1 Answer 1

2

I came up with a terrible hack:

  1. Remove the , ...
  2. Run nixos-rebuild switch, which prints

    error: anonymous function at /etc/nixos/configuration.nix:1:1 called with unexpected argument 'specialArgs', at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:372:8

  3. Add the argument above (specialArgs) into the signature.
  4. Repeat steps 2 & 3 until done.

This resulted in the following signature:

{ config, lib, modulesPath, pkgs, specialArgs, options }:

Hopefully someone knows a better way to get this information.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .