mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-08-16 22:31:03 +02:00
chore(nix): reformat package.nix
with alejandra
This commit is contained in:
parent
322fc0cdcc
commit
d97d07e98e
1 changed files with 59 additions and 53 deletions
112
nix/package.nix
112
nix/package.nix
|
@ -30,7 +30,7 @@
|
||||||
builderName ? "nix",
|
builderName ? "nix",
|
||||||
builder ? {},
|
builder ? {},
|
||||||
}: let
|
}: let
|
||||||
hasFeature = f: features == [ ] || builtins.elem f features;
|
hasFeature = f: features == [] || builtins.elem f features;
|
||||||
|
|
||||||
basePkg = rec {
|
basePkg = rec {
|
||||||
inherit version;
|
inherit version;
|
||||||
|
@ -43,34 +43,37 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
pkg-config
|
pkg-config
|
||||||
wrapGAppsHook
|
wrapGAppsHook
|
||||||
gobject-introspection
|
gobject-introspection
|
||||||
installShellFiles
|
installShellFiles
|
||||||
];
|
];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs =
|
||||||
gtk3
|
[
|
||||||
gdk-pixbuf
|
gtk3
|
||||||
glib
|
gdk-pixbuf
|
||||||
gtk-layer-shell
|
glib
|
||||||
glib-networking
|
gtk-layer-shell
|
||||||
shared-mime-info
|
glib-networking
|
||||||
adwaita-icon-theme
|
shared-mime-info
|
||||||
hicolor-icon-theme
|
adwaita-icon-theme
|
||||||
gsettings-desktop-schemas
|
hicolor-icon-theme
|
||||||
libxkbcommon ]
|
gsettings-desktop-schemas
|
||||||
++ lib.optionals (hasFeature "http") [ openssl ]
|
libxkbcommon
|
||||||
++ lib.optionals (hasFeature "tray") [ libdbusmenu-gtk3 ]
|
]
|
||||||
++ lib.optionals (hasFeature "volume")[ libpulseaudio ]
|
++ lib.optionals (hasFeature "http") [openssl]
|
||||||
++ lib.optionals (hasFeature "cairo") [ luajit ]
|
++ lib.optionals (hasFeature "tray") [libdbusmenu-gtk3]
|
||||||
++ lib.optionals (hasFeature "keyboard") [ libinput libevdev ];
|
++ lib.optionals (hasFeature "volume") [libpulseaudio]
|
||||||
|
++ lib.optionals (hasFeature "cairo") [luajit]
|
||||||
|
++ lib.optionals (hasFeature "keyboard") [libinput libevdev];
|
||||||
|
|
||||||
propagatedBuildInputs = [ gtk3 ];
|
propagatedBuildInputs = [gtk3];
|
||||||
|
|
||||||
lgi = luajitPackages.lgi;
|
lgi = luajitPackages.lgi;
|
||||||
|
|
||||||
gappsWrapperArgs = ''
|
gappsWrapperArgs =
|
||||||
|
''
|
||||||
# Thumbnailers
|
# Thumbnailers
|
||||||
--prefix XDG_DATA_DIRS : "${gdk-pixbuf}/share"
|
--prefix XDG_DATA_DIRS : "${gdk-pixbuf}/share"
|
||||||
--prefix XDG_DATA_DIRS : "${librsvg}/share"
|
--prefix XDG_DATA_DIRS : "${librsvg}/share"
|
||||||
|
@ -78,12 +81,12 @@
|
||||||
--prefix XDG_DATA_DIRS : "${shared-mime-info}/share"
|
--prefix XDG_DATA_DIRS : "${shared-mime-info}/share"
|
||||||
|
|
||||||
# gtk-launch
|
# gtk-launch
|
||||||
--suffix PATH : "${lib.makeBinPath [ gtk3 ]}"
|
--suffix PATH : "${lib.makeBinPath [gtk3]}"
|
||||||
''
|
''
|
||||||
+ lib.optionalString (hasFeature "cairo") ''
|
+ lib.optionalString (hasFeature "cairo") ''
|
||||||
--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_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"
|
--prefix LUA_CPATH : "./?.so;${lgi}/lib/lua/5.1/?.so;${luajit}/lib/lua/5.1/?.so;${luajit}/lib/lua/5.1/loadall.so"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
preFixup = ''
|
preFixup = ''
|
||||||
gappsWrapperArgs+=(
|
gappsWrapperArgs+=(
|
||||||
|
@ -107,38 +110,41 @@
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "https://github.com/JakeStanger/ironbar";
|
homepage = "https://github.com/JakeStanger/ironbar";
|
||||||
description =
|
description = "Customisable gtk-layer-shell wlroots/sway bar written in rust.";
|
||||||
"Customisable gtk-layer-shell wlroots/sway bar written in rust.";
|
|
||||||
license = licenses.mit;
|
license = licenses.mit;
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
mainProgram = "ironbar";
|
mainProgram = "ironbar";
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
flags = let
|
flags = let
|
||||||
noDefault = if features == [ ] then "" else "--no-default-features";
|
noDefault =
|
||||||
|
if features == []
|
||||||
|
then ""
|
||||||
|
else "--no-default-features";
|
||||||
|
|
||||||
featuresStr = if features == [ ] then
|
featuresStr =
|
||||||
""
|
if features == []
|
||||||
else
|
then ""
|
||||||
''-F "${builtins.concatStringsSep "," features}"'';
|
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 != [];
|
||||||
|
|
||||||
in [ noDefault featuresStr ];
|
buildFeatures = features;
|
||||||
in if builderName == "naersk" then
|
cargoDeps = rustPlatform.importCargoLock {lockFile = ../Cargo.lock;};
|
||||||
builder.buildPackage (basePkg // { cargoBuildOptions = old: old ++ flags; })
|
cargoLock.lockFile = ../Cargo.lock;
|
||||||
else if builderName == "crane" then
|
cargoLock.outputHashes."stray-0.1.3" = "sha256-7mvsWZFmPWti9AiX67h6ZlWiVVRZRWIxq3pVaviOUtc=";
|
||||||
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=";
|
|
||||||
})
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue