I noticed i3blocks is very outdated, the last release is from 4 year ago, but the project is still making active progress, so I thought I would update the nix script.
The project has changed quite a lot. One particular change is using autotools to build the project. I have gotten this far with just modifying the old build script:
{ fetchFromGitHub, stdenv, autoconf, automake
, iproute, acpi, sysstat, xset, playerctl
, cmus, openvpn, lm_sensors, alsaUtils
}:
with stdenv.lib;
stdenv.mkDerivation rec {
name = "i3blocks-${version}";
version = "1.4";
src = fetchFromGitHub {
owner = "vivien";
repo = "i3blocks";
rev = "ec050e79ad8489a6f8deb37d4c20ab10729c25c3";
sha256 = "1fx4230lmqa5rpzph68dwnpcjfaaqv5gfkradcr85hd1z8d1qp1b";
};
configurePhase = ''
./autogen.sh
./configure
'';
nativeBuildInputs = [ autoconf automake ];
buildFlags = "SYSCONFDIR=/etc all";
installFlags = "PREFIX=${placeholder "out"} VERSION=${version}";
meta = {
description = "A flexible scheduler for your i3bar blocks";
homepage = https://github.com/vivien/i3blocks;
license = licenses.gpl3;
platforms = with platforms; freebsd ++ linux;
};
}
This results in the following error:
installing
install flags: SHELL=/nix/store/cinw572b38aln37glr0zb8lxwrgaffl4-bash-4.4-p23/bin/bash PREFIX=/nix/store/cf5f1md6ic1ppnr6daz77knix1szkcm5-i3blocks-1.4 VERSION=1.4 install
make[1]: Entering directory '/build/source'
/nix/store/d9s1kq1bnwqgxwcvv4zrc36ysnxg8gv7-coreutils-8.30/bin/mkdir -p '/usr/local/bin'
/nix/store/d9s1kq1bnwqgxwcvv4zrc36ysnxg8gv7-coreutils-8.30/bin/mkdir: cannot create directory '/usr': Permission denied
I am confused, since the PREFIX
flag in install flags is correctly pointing to the right directory, but still the builder is trying to install it to /usr/local/bin
. I already found this topic: Generic builder: minimal autoconf example? and fixed my prefix flag with its help. Maybe I’m setting the wrong flag?