1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-07-01 18:51:04 +02:00

style(nix): format

This commit is contained in:
Jake Stanger 2024-04-17 21:43:46 +01:00
parent a86f8b5d50
commit 80f16c5037
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
2 changed files with 237 additions and 225 deletions

View file

@ -27,12 +27,19 @@
}: let
basePkg = rec {
inherit version;
pname = "ironbar";
src = builtins.path {
name = "ironbar";
path = lib.cleanSource ../.;
};
nativeBuildInputs = [ pkg-config wrapGAppsHook gobject-introspection ];
nativeBuildInputs = [
pkg-config
wrapGAppsHook
gobject-introspection
];
buildInputs = [
gtk3
@ -50,7 +57,7 @@
luajit
];
propagatedBuildInputs = [ gtk3 ];
propagatedBuildInputs = [ gtk3 ];
lgi = luajitPackages.lgi;
@ -70,53 +77,48 @@
--prefix LUA_CPATH : "./?.so;${lgi}/lib/lua/5.1/?.so;${luajit}/lib/lua/5.1/?.so;${luajit}/lib/lua/5.1/loadall.so"
)
'';
passthru = {
updateScript = gnome.updateScript {
packageName = pname;
attrPath = "gnome.${pname}";
};
};
meta = with lib; {
homepage = "https://github.com/JakeStanger/ironbar";
description = "Customisable gtk-layer-shell wlroots/sway bar written in rust.";
description =
"Customisable gtk-layer-shell wlroots/sway bar written in rust.";
license = licenses.mit;
platforms = platforms.linux;
mainProgram = "ironbar";
};
};
flags = let
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 =
if features == []
then false
else true;
buildFeatures = features;
cargoDeps = rustPlatform.importCargoLock {lockFile = ../Cargo.lock;};
cargoLock.lockFile = ../Cargo.lock;
cargoLock.outputHashes."stray-0.1.3" = "sha256-7mvsWZFmPWti9AiX67h6ZlWiVVRZRWIxq3pVaviOUtc=";
})
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=";
})