summaryrefslogtreecommitdiffstats
path: root/derivation.nix
blob: 8fde5aeea64e152805ae3a739a4a436400697bd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ stdenv, rustPlatform, dbus, pkgconfig, ... }:

rustPlatform.buildRustPackage rec {
  name = "set_eq-${version}";
  version = "0.1.0";

  buildInputs = [ dbus pkgconfig ];

  src = ./.;
  cargoSha256 = "0qc2fapqsri244sm85ykpdq2icwvg99fdb9nqpf0fmhzh8m9plhy";

  preFixup = ''
    mkdir -p "$out/share/"{bash-completion/completions,fish/vendor_completions.d,zsh/site-functions}
    cp target/release/build/set_eq-*/out/set_eq.bash "$out/share/bash-completion/completions/"
    cp target/release/build/set_eq-*/out/set_eq.fish "$out/share/fish/vendor_completions.d/"
    cp target/release/build/set_eq-*/out/_set_eq     "$out/share/zsh/site-functions/"
  '';

  checkPhase = ''
    runHook preCheck

    echo "Running cargo test --release"
    cargo test --release

    runHook postCheck
  '';

  meta = with stdenv.lib; {
    description = "A command-line tool to manipulate PulseAudio's equalizer";
    homepage = https://github.com/minijackson/set_eq;
    platforms = platforms.all;
  };
}