Change primary display don't need sketchybar

This commit is contained in:
Tyler Mayoff 2025-02-17 12:54:48 -05:00
parent 6768bdb19e
commit c1e274ab1c
No known key found for this signature in database
GPG key ID: B62A5AFAD8E14845
6 changed files with 44 additions and 64 deletions

View file

@ -40,6 +40,19 @@
file.".gnupg/gpg-agent.conf".text = ''
pinentry-program ${pkgs.pinentry_mac}/Applications/pinentry-mac.app/Contents/MacOS/pinentry-mac
'';
file.".config/sketchybar/sketchybarrc" = {
executable = true;
text = ''
#!/usr/bin/env lua
package.cpath = package.cpath .. ";${pkgs.sbarlua}/lib/lua/5.4/sketchybar.so"
-- Load the sketchybar-package and prepare the helper binaries
require("helpers")
require("init")
'';
};
};
programs.home-manager.enable = true;

View file

@ -1,6 +1,8 @@
{...}: {
# services.sketchybar = {
# enable = true;
# extraPackages = [];
# };
{pkgs, ...}: {
services.sketchybar = {
# enable = true;
extraPackages = with pkgs; [
sbarlua
];
};
}

View file

@ -1,62 +1,33 @@
{
lib,
stdenv,
clang,
fetchFromGitHub,
gcc,
lua,
nix-update-script,
apple-sdk_15,
versionCheckHook,
readline,
lua5_4,
}: let
inherit (stdenv.hostPlatform) system;
target =
{
"aarch64-darwin" = "arm64";
"x86_64-darwin" = "x86";
}
.${system}
or (throw "Unsupported system: ${system}");
lua = lua5_4;
in
stdenv.mkDerivation (
finalAttrs: {
pname = "SBarLua";
version = "437bd2031da38ccda75827cb7548e7baa4aa9978";
src = fetchFromGitHub {
repo = "SbarLua";
owner = "FelixKratz";
rev = "437bd2031da38ccda75827cb7548e7baa4aa9978";
hash = "sha256-F0UfNxHM389GhiPQ6/GFbeKQq5EvpiqQdvyf7ygzkPg=";
};
stdenv.mkDerivation {
pname = "SBarLua";
version = "unstable-2024-02-28";
nativeBuildInputs = [
gcc
];
src = fetchFromGitHub {
owner = "FelixKratz";
repo = "SbarLua";
rev = "437bd2031da38ccda75827cb7548e7baa4aa9978";
hash = "sha256-F0UfNxHM389GhiPQ6/GFbeKQq5EvpiqQdvyf7ygzkPg=";
};
buildInputs = [
apple-sdk_15
lua
];
nativeBuildInputs = [
clang
gcc
];
# buildPhase = ''
# make
# '';
buildInputs = [readline];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
ls -la
cp ./bin/sbarlua $out/bin/sbarlua
runHook postInstall
'';
meta = {
homepage = "https://github.com/FelixKratz/SbarLua";
platforms = lib.platforms.darwin;
};
}
)
installPhase = ''
mkdir -p $out/lib/lua/${lua.luaversion}/
cp -r bin/* "$out/lib/lua/${lua.luaversion}/"
'';
}