[Solved] Overwrite default values in configuration.nix / Postfix + postscreen?

You don’t have to prepend pkgs., however I don’t know your configuration so I can only guess that lib is missing in your module arguments, so you need to add it like so:

{ lib, pkgs, ... }:

{
  # ...
  services.postfix.masterConfig.smtp_inet = lib.mkOverride 10 { ... };
}

Btw. using pkgs.lib is also something I’d avoid, because it can easily lead to infinite recursions, consider this:

{ pkgs, ... }:

{
  imports = pkgs.lib.singleton /some/file.nix;
}

This will lead to an infinite recursion error, because the pkgs module argument actually is a configuration option itself (_module.args.pkgs) which can only be resolved once all modules are determined. In this case it can’t do so because importing the /some/file.nix module would depend on that option (which could even be redefined in /some/file.nix).

1 Like