-
Notifications
You must be signed in to change notification settings - Fork 12
/
default.nix
33 lines (27 loc) · 836 Bytes
/
default.nix
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
{ naersk-lib, pkgs, useGlobalAlsaUtils ? false }:
let
binPath = pkgs.lib.makeBinPath (
(with pkgs; [
coreutils # audio: stdbuf
dnsutils # network: dig
iproute2 # network: ip
wirelesstools # network: iwgetid
])
++ pkgs.lib.optional (!useGlobalAlsaUtils) pkgs.alsa-utils # audio: alsactl, amixer
);
name = "dwm-status";
in
naersk-lib.buildPackage {
pname = name;
src = builtins.filterSource
(path: type: type != "directory" || baseNameOf path != "target")
./.;
nativeBuildInputs = with pkgs; [ makeWrapper pkg-config ];
buildInputs = with pkgs; [ dbus gdk-pixbuf libnotify xorg.libX11 ];
postInstall = ''
# run only when building the final package
if [[ -x $out/bin/${name} ]]; then
wrapProgram $out/bin/${name} --prefix "PATH" : "${binPath}"
fi
'';
}