40 lines
899 B
Nix

{
pkgs,
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.my.sketchybar;
luaBasePackage = pkgs.lua5_4;
luaPackage = luaBasePackage.withPackages (ps:
with ps; [
(pkgs.sbarlua.override {lua = luaBasePackage;})
luafilesystem
]);
in {
options.my.sketchybar = {
enable = mkEnableOption "sketchybar";
};
config = mkIf cfg.enable {
home.file.".config/sketchybar/lua".source =
config.lib.file.mkOutOfStoreSymlink
"${config.home.homeDirectory}/Projects/nix-dots/darwin/sketchybar/config";
home.file.".config/sketchybar/sketchybarrc" = {
text = ''
#!${luaPackage}/bin/lua
local lfs = require("lfs")
lfs.chdir("lua")
-- Load the sketchybar-package and prepare the helper binaries
require("helpers")
require("init")
'';
executable = true;
};
};
}