cmacrae / spacebar

A minimal status bar for macOS. Ideal for use with tiling window managers like yabai
MIT License
1.22k stars 52 forks source link

Cannot directly import overlay in Nix flake #103

Closed remi-gelinas closed 2 years ago

remi-gelinas commented 2 years ago

I'm trying to add spacebar to my system flake overlays, but I'm not sure that the instructions are valid anymore. Using these instructions from the root README:

{
  inputs.darwin.url = "github:lnl7/nix-darwin";
  inputs.spacebar.url = "github:cmacrae/spacebar/v1.4.0";

  outputs = { self, darwin, spacebar }: {
    darwinConfigurations.example = darwin.lib.darwinSystem {
      modules = [
        {
          nixpkgs.overlays = [
            spacebar.overlay
          ];
        }
      ];
    };
  };
}

spacebar.overlay results in an attribute set containing each system overlay, structured like this:

{
  aarch64-darwin = <overlay function>;
  x86_64-darwin = <overlay function>;
}

Passing spacebar.overlay directly into the nixpkgs overlay list fails to evaluate as spacebar.overlay evaluates to an attribute set instead of an overlay function directly:

error: A definition for option `nixpkgs.overlays.[definition 1-entry 9]' is not of type `nixpkgs overlay'. Definition values:
       - In `<unknown-file>':
           {
             aarch64-darwin = <function>;
             x86_64-darwin = <function>;
           }

Directly passing either system's attribute spacebar.overlay.aarch64-darwin obviously does work though, since you're passing an overlay in.

Is there something in the README that needs to be updated now that multiple systems are supported?