nixpkgs-suyu/pkgs/applications/window-managers/i3/blocks.nix
Kier Davis 90b3648f9c
i3blocks: search for config in correct system directory
The SYSCONFDIR variable used in the Makefile servers two purposes:

1) During buildPhase, it is hardcoded into the executable as one of
   the locations that will be searched for the i3blocks.conf config
   file. We want this set to "/etc", so that "/etc/i3blocks.conf"
   will be automatically loaded if it exists, as specified in the
   manpage.

2) During installPhase, it specifies the location that the sample
   i3blocks.conf should be installed to. We want this to be "$out/etc".

Case 2 was already handled correctly, but case 1 was not. This resulted
in i3blocks instead searching for i3blocks.conf in the default value of
SYSCONFDIR, which is "/usr/local/etc", a directory which generally does
not exist on NixOS. This commit remedies this problem by setting
SYSCONFDIR=/etc during buildPhase.

A minor stylistic fix (correcting a usage of "makeFlags" to "buildFlags"
in the expression) has also been applied in this commit.
2017-01-12 20:15:15 +00:00

22 lines
637 B
Nix

{ fetchurl, stdenv }:
stdenv.mkDerivation rec {
name = "i3blocks-${version}";
version = "1.4";
src = fetchurl {
url = "https://github.com/vivien/i3blocks/releases/download/${version}/${name}.tar.gz";
sha256 = "c64720057e22cc7cac5e8fcd58fd37e75be3a7d5a3cb8995841a7f18d30c0536";
};
buildFlags = "SYSCONFDIR=/etc all";
installFlags = "PREFIX=\${out} VERSION=${version}";
meta = with stdenv.lib; {
description = "A flexible scheduler for your i3bar blocks";
homepage = https://github.com/vivien/i3blocks;
license = licenses.gpl3;
maintainers = [ "MindTooth" ];
platforms = platforms.all;
};
}