Import flake module, wants aarch64-darwin?

I’m trying to pull in a flake for use in a nixos configuration.nix. My system flake is like this (local dir for now):

  description = "test system";

  inputs = {
    nixpkgs = { url = "github:nixos/nixpkgs/nixos-23.11"; };
    zknotes = { url = "/home/bburdette/code/zknotes/zknotes"; };

  outputs = inputs:
    nixosConfigurations = {

      radicale = inputs.nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        modules = [
        specialArgs = { inherit inputs; };

In the configuration.nix I’d like to services.zknotes.enable = true, but for now it doesn’t use the 3rd party flake at all.

So when I do:

nixos-rebuild --target-host --flake .#radicale switch --show-trace

I get:

      error: The option `aarch64-darwin' does not exist. Definition values:
       - In `/nix/store/2mx7dgmxwvdi802a4w0qzayi0ypgsaf7-source/flake.nix':
             zknotes = <function, args: {config, lib, pkgs}>;

And if I comment out the inputs.zknotes.nixosModules line the error goes away.

From other flake module code I don’t see the ${system} stuff being needed, but guess I’m wrong? I don’t see how to apply it here.

BTW zknotes flake.nix and module.nix are here

Ok I think I’ve solved this, or at least I’m on to the next problem.

This is due to apparently the flakeutils foreachsystem gadget putting {system} on things that don’t need it, like nixosModules.

Theres a blog post about this.

For now, I applied a quick-and-dirty solution - move the nixosModules part out of the foreachsystem call.

Right now the flake is building without errors so :+1:.