Skip to content

Commit

Permalink
nix(package): program is no longer depending on notify-send(libnotify)
Browse files Browse the repository at this point in the history
  • Loading branch information
luisnquin committed Jan 30, 2024
1 parent c594d4c commit 9467b1e
Showing 1 changed file with 23 additions and 31 deletions.
54 changes: 23 additions & 31 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,38 +1,30 @@
{pkgs ? import <nixpkgs> {}, ...}: let
runtimePackages = with pkgs; [libnotify];
in
pkgs.rustPlatform.buildRustPackage rec {
pname = "battery-notifier";
version = "unstable";
{pkgs ? import <nixpkgs> {}, ...}:
pkgs.rustPlatform.buildRustPackage rec {
pname = "battery-notifier";
version = "unstable";

src = builtins.path {
name = "${pname}-source";
path = ./.;
};
src = builtins.path {
name = "${pname}-source";
path = ./.;
};

nativeBuildInputs = with pkgs; [git cmake makeWrapper];
buildInputs = runtimePackages;
nativeBuildInputs = with pkgs; [git cmake makeWrapper];

cargoLock = {
lockFile = ./Cargo.lock;
cargoLock = {
lockFile = ./Cargo.lock;

outputHashes = {
"soloud-1.0.5" = "sha256-2Cd5aWfntRawxRSdy+4tJJdTkTeii1ilshQadG6Pybw=";
};
outputHashes = {
"soloud-1.0.5" = "sha256-2Cd5aWfntRawxRSdy+4tJJdTkTeii1ilshQadG6Pybw=";
};
};

preConfigure = ''
substituteInPlace ./src/notify.rs \
--replace './assets/battery-danger.png' '${placeholder "out"}/assets/battery-danger.png'
'';

preInstall = ''
mkdir -p $out/assets/
cp ./assets/*.png $out/assets/
'';
preConfigure = ''
substituteInPlace ./src/notify.rs \
--replace './assets/battery-danger.png' '${placeholder "out"}/assets/battery-danger.png'
'';

postInstall = ''
wrapProgram ${placeholder "out"}/bin/${pname} \
--prefix PATH : ${pkgs.lib.makeBinPath runtimePackages}
'';
}
preInstall = ''
mkdir -p $out/assets/
cp ./assets/*.png $out/assets/
'';
}

0 comments on commit 9467b1e

Please sign in to comment.