Something went wrong. Try again.
NixOS / Nix-darwin / Home Manager dotfiles for my devices
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121{ lib, self, ...}:{ flake.wrappers = { sketchybar = { pkgs, ... }: { imports = [ self.wrapperModules.sketchybar-wrapper ];
config = { type = "lua"; config = '' require('init') '';
luaPackages = ps: let buildFennelPackage = pkgs.buildFennelPackage.override { lua54Packages = ps; }; in [ (buildFennelPackage { name = "sketchybar-config"; src = lib.sourceFilesBySuffices ./. [ ".fnl" ]; }) (pkgs.rift-lua.override { lua55Packages = ps; }) ps.fennel ];
extraPackages' = [ pkgs.maple-mono.NF-CN-unhinted ]; }; };
sketchybar-wrapper = { config, pkgs, wlib, ... }: { imports = [ wlib.modules.default ];
options = { type = lib.mkOption { default = "bash"; type = lib.types.enum [ "lua" "bash" ]; };
config = lib.mkOption { default = ""; type = lib.types.lines; };
luaPackages = lib.mkOption { default = _: [ ]; type = lib.types.functionTo (lib.types.listOf lib.types.package); };
sbarluaPackage = lib.mkPackageOption pkgs "sbarlua" { };
luaPackage = lib.mkOption { type = lib.types.package; default = config.sbarluaPackage.passthru.luaModule; };
extraPackages' = lib.mkOption { type = lib.types.listOf lib.types.package; default = [ ]; }; };
config = { package = pkgs.symlinkJoin { name = "sketchybar"; paths = [ pkgs.sketchybar ] ++ config.extraPackages'; };
prefixVar = let ps = config.luaPackage.pkgs; allLuaPackages = (config.luaPackages ps) ++ [ config.sbarluaPackage ]; in lib.mkIf (config.type == "lua") [ [ "LUA_PATH" ";" "${lib.concatMapStringsSep ";" ps.getLuaPath allLuaPackages}" ] [ "LUA_CPATH" ";" "${lib.concatMapStringsSep ";" ps.getLuaCPath allLuaPackages}" ] ]; flags."--config" = pkgs.writeTextFile { name = "sketchybar-config"; text = '' #!${lib.getExe (if config.type == "lua" then config.luaPackage else pkgs.bash)} ${config.config} ''; executable = true; };
meta.platforms = lib.platforms.darwin; }; }; };}