{ pkgs ? import <nixpkgs> { } }:

pkgs.rustPlatform.buildRustPackage {
  pname = "ewwbar";
  version = "1.0.0";

  src = builtins.path { path = ./.; name = "ewwbar"; };

  cargoLock = {
    lockFile = ./Cargo.lock;
  };

  nativeBuildInputs = [
    pkgs.pkg-config
  ];

  buildInputs = [
    pkgs.libxkbcommon
    pkgs.eww
  ];

  postInstall = ''
    mkdir -p $out/bin
    cp -r $src/eww $out/bin/eww
  '';

  meta = with pkgs.lib; {
    description = "Top bar using ElKowars Wacky Widgets";
    homepage = " git.huwe.mooo.com/willifan/desktop-utils";
    license = licenses.gpl3;
    platforms = platforms.unix;
    mainProgram = "ewwbar";
  }; 

}
