2023-03-29 11:45:40 +03:00
|
|
|
{
|
|
|
|
gtk3,
|
|
|
|
gdk-pixbuf,
|
2023-04-23 02:47:04 +03:00
|
|
|
librsvg,
|
|
|
|
webp-pixbuf-loader,
|
|
|
|
gobject-introspection,
|
|
|
|
glib-networking,
|
|
|
|
glib,
|
|
|
|
shared-mime-info,
|
|
|
|
gsettings-desktop-schemas,
|
|
|
|
wrapGAppsHook,
|
2023-03-29 11:45:40 +03:00
|
|
|
gtk-layer-shell,
|
2023-04-23 02:47:04 +03:00
|
|
|
gnome,
|
2023-03-29 11:45:40 +03:00
|
|
|
libxkbcommon,
|
2024-02-18 20:32:51 +03:00
|
|
|
libpulseaudio,
|
2023-03-29 11:45:40 +03:00
|
|
|
openssl,
|
2024-03-31 02:43:30 +03:00
|
|
|
luajit,
|
|
|
|
luajitPackages,
|
2023-03-29 11:45:40 +03:00
|
|
|
pkg-config,
|
2023-04-23 02:47:04 +03:00
|
|
|
hicolor-icon-theme,
|
2023-03-29 11:45:40 +03:00
|
|
|
rustPlatform,
|
|
|
|
lib,
|
|
|
|
version ? "git",
|
|
|
|
features ? [],
|
2023-07-27 00:22:52 +03:00
|
|
|
builderName ? "nix",
|
|
|
|
builder ? {},
|
|
|
|
}: let
|
2024-04-18 00:04:43 +03:00
|
|
|
hasFeature = f: features == [ ] || builtins.elem f features;
|
|
|
|
|
2023-07-27 00:22:52 +03:00
|
|
|
basePkg = rec {
|
|
|
|
inherit version;
|
2024-04-17 23:43:46 +03:00
|
|
|
|
2023-07-27 00:22:52 +03:00
|
|
|
pname = "ironbar";
|
2024-04-17 23:43:46 +03:00
|
|
|
|
2023-07-27 00:22:52 +03:00
|
|
|
src = builtins.path {
|
|
|
|
name = "ironbar";
|
|
|
|
path = lib.cleanSource ../.;
|
|
|
|
};
|
2024-04-17 23:43:46 +03:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
wrapGAppsHook
|
|
|
|
gobject-introspection
|
|
|
|
];
|
2024-03-31 02:43:30 +03:00
|
|
|
|
|
|
|
buildInputs = [
|
2023-07-27 00:22:52 +03:00
|
|
|
gtk3
|
2024-03-31 02:43:30 +03:00
|
|
|
gdk-pixbuf
|
|
|
|
glib
|
|
|
|
gtk-layer-shell
|
|
|
|
glib-networking
|
|
|
|
shared-mime-info
|
|
|
|
gnome.adwaita-icon-theme
|
|
|
|
hicolor-icon-theme
|
|
|
|
gsettings-desktop-schemas
|
2024-04-18 00:04:43 +03:00
|
|
|
libxkbcommon ]
|
|
|
|
++ (if hasFeature "http" then [ openssl ] else [])
|
|
|
|
++ (if hasFeature "volume" then [ libpulseaudio ] else [])
|
|
|
|
++ (if hasFeature "cairo" then [ luajit ] else []);
|
2024-03-31 02:43:30 +03:00
|
|
|
|
2024-04-17 23:43:46 +03:00
|
|
|
propagatedBuildInputs = [ gtk3 ];
|
2024-03-31 02:43:30 +03:00
|
|
|
|
|
|
|
lgi = luajitPackages.lgi;
|
|
|
|
|
2024-04-18 00:04:43 +03:00
|
|
|
gappsWrapperArgs = ''
|
2023-07-27 00:22:52 +03:00
|
|
|
# Thumbnailers
|
2024-04-18 00:04:43 +03:00
|
|
|
--prefix XDG_DATA_DIRS : "${gdk-pixbuf}/share"
|
|
|
|
--prefix XDG_DATA_DIRS : "${librsvg}/share"
|
|
|
|
--prefix XDG_DATA_DIRS : "${webp-pixbuf-loader}/share"
|
|
|
|
--prefix XDG_DATA_DIRS : "${shared-mime-info}/share"
|
2024-04-06 21:34:29 +03:00
|
|
|
|
2024-04-18 00:04:43 +03:00
|
|
|
# gtk-launch
|
|
|
|
--suffix PATH : "${lib.makeBinPath [ gtk3 ]}"
|
|
|
|
''
|
|
|
|
+ (if hasFeature "cairo" then ''
|
2024-03-31 02:43:30 +03:00
|
|
|
--prefix LUA_PATH : "./?.lua;${lgi}/share/lua/5.1/?.lua;${lgi}/share/lua/5.1/?/init.lua;${luajit}/share/lua/5.1/\?.lua;${luajit}/share/lua/5.1/?/init.lua"
|
|
|
|
--prefix LUA_CPATH : "./?.so;${lgi}/lib/lua/5.1/?.so;${luajit}/lib/lua/5.1/?.so;${luajit}/lib/lua/5.1/loadall.so"
|
2024-04-18 00:04:43 +03:00
|
|
|
'' else "");
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
gappsWrapperArgs+=(
|
|
|
|
${gappsWrapperArgs}
|
2023-07-27 00:22:52 +03:00
|
|
|
)
|
|
|
|
'';
|
2024-04-17 23:43:46 +03:00
|
|
|
|
2023-07-27 00:22:52 +03:00
|
|
|
passthru = {
|
|
|
|
updateScript = gnome.updateScript {
|
|
|
|
packageName = pname;
|
|
|
|
attrPath = "gnome.${pname}";
|
|
|
|
};
|
|
|
|
};
|
2024-04-17 23:43:46 +03:00
|
|
|
|
2023-07-27 00:22:52 +03:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/JakeStanger/ironbar";
|
2024-04-17 23:43:46 +03:00
|
|
|
description =
|
|
|
|
"Customisable gtk-layer-shell wlroots/sway bar written in rust.";
|
2023-07-27 00:22:52 +03:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
mainProgram = "ironbar";
|
2023-04-23 02:47:04 +03:00
|
|
|
};
|
2024-04-17 23:43:46 +03:00
|
|
|
|
2023-04-23 02:47:04 +03:00
|
|
|
};
|
2024-04-17 23:43:46 +03:00
|
|
|
|
2023-07-27 00:22:52 +03:00
|
|
|
flags = let
|
2024-04-17 23:43:46 +03:00
|
|
|
noDefault = if features == [ ] then "" else "--no-default-features";
|
|
|
|
|
|
|
|
featuresStr = if features == [ ] then
|
|
|
|
""
|
|
|
|
else
|
|
|
|
''-F "${builtins.concatStringsSep "," features}"'';
|
|
|
|
|
|
|
|
in [ noDefault featuresStr ];
|
|
|
|
in if builderName == "naersk" then
|
|
|
|
builder.buildPackage (basePkg // { cargoBuildOptions = old: old ++ flags; })
|
|
|
|
else if builderName == "crane" then
|
|
|
|
builder.buildPackage (basePkg // {
|
|
|
|
cargoExtraArgs = builtins.concatStringsSep " " flags;
|
|
|
|
doCheck = false;
|
|
|
|
})
|
|
|
|
else
|
|
|
|
rustPlatform.buildRustPackage (basePkg // {
|
|
|
|
buildNoDefaultFeatures = features != [ ];
|
|
|
|
|
|
|
|
buildFeatures = features;
|
|
|
|
cargoDeps = rustPlatform.importCargoLock { lockFile = ../Cargo.lock; };
|
|
|
|
cargoLock.lockFile = ../Cargo.lock;
|
|
|
|
cargoLock.outputHashes."stray-0.1.3" =
|
|
|
|
"sha256-7mvsWZFmPWti9AiX67h6ZlWiVVRZRWIxq3pVaviOUtc=";
|
|
|
|
})
|