From 9b143be7fdc200d8e5425b8d3e71bafe26dcd062 Mon Sep 17 00:00:00 2001 From: DataEraserC <102341238+DataEraserC@users.noreply.github.com> Date: Sat, 14 Oct 2023 15:35:33 +0800 Subject: [PATCH] Initial Commit for waybar-bluetooth_battery_parse --- default.nix | 1 + .../default.nix | 1 + .../waybar-bluetooth_battery_parse.nix | 38 +++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 pkgs/waybar-bluetooth_battery_parse/default.nix create mode 100644 pkgs/waybar-bluetooth_battery_parse/waybar-bluetooth_battery_parse.nix diff --git a/default.nix b/default.nix index 46795e7..2731ad0 100644 --- a/default.nix +++ b/default.nix @@ -27,6 +27,7 @@ pkgs.callPackage ./pkgs/wechat_dev_tools_appimage { }; wechat_dev_tools_deb = pkgs.callPackage ./pkgs/wechat_dev_tools_deb { }; qtscrcpy = pkgs.libsForQt5.callPackage ./pkgs/qtscrcpy { }; + waybar-bluetooth_battery_parse = pkgs.callPackage ./pkgs/waybar-bluetooth_battery_parse { }; # some-qt5-package = pkgs.libsForQt5.callPackage ./pkgs/some-qt5-package { }; # ... } diff --git a/pkgs/waybar-bluetooth_battery_parse/default.nix b/pkgs/waybar-bluetooth_battery_parse/default.nix new file mode 100644 index 0000000..ee6f0e8 --- /dev/null +++ b/pkgs/waybar-bluetooth_battery_parse/default.nix @@ -0,0 +1 @@ +import ./waybar-bluetooth_battery_parse.nix diff --git a/pkgs/waybar-bluetooth_battery_parse/waybar-bluetooth_battery_parse.nix b/pkgs/waybar-bluetooth_battery_parse/waybar-bluetooth_battery_parse.nix new file mode 100644 index 0000000..4a67785 --- /dev/null +++ b/pkgs/waybar-bluetooth_battery_parse/waybar-bluetooth_battery_parse.nix @@ -0,0 +1,38 @@ +# When you use pkgs.callPackage, parameters here will be filled with packages from Nixpkgs (if there's a match) +{ stdenv, fetchFromGitHub, cmake, gcc }@args: +let + src = fetchFromGitHub ({ + owner = "Program-Learning"; + repo = "waybar-bluetooth_battery_parse"; + # Commit or tag, note that fetchFromGitHub cannot follow a branch! + rev = "96209641f510ac06f157f5493893ba55ef2a4dc7"; + # Download git submodules, most packages don't need this + fetchSubmodules = false; + # Don't know how to calculate the SHA256 here? Comment it out and build the package + # Nix will raise an error and show the correct hash + sha256 = "sha256-hZ6gL5Iez2Ex8g10ROIGm7IYVxR2lLlu+/d+CbbjOEQ="; + }); +in stdenv.mkDerivation rec { + # Specify package name and version + pname = "waybar-bluetooth_battery_parse"; + version = "0.0.2"; + src = src; + buildInputs = [ cmake ]; + + # Download source code from GitHub + + # Parallel building, drastically speeds up packaging, enabled by default. + # You only want to turn this off for one of the rare packages that fails with this. + enableParallelBuilding = true; + # If you encounter some weird error when packaging CMake-based software, try enabling this + # This disables some automatic fixes applied to CMake-based software + dontFixCmake = true; + + # Add CMake to the building environment, to generate Makefile with it + nativeBuildInputs = [ cmake ]; + + # Arguments to CMake that controls functionalities of liboqs + cmakeFlags = [ "-DCMAKE_INSTALL_PREFIX=$out" ]; + + # stdenv.mkDerivation automatically does the rest for you +}