2018-07-21 00:44:44 +00:00
|
|
|
{ sudo, coreutils, systemd, cryptsetup
|
2018-03-27 18:17:10 +00:00
|
|
|
, mount, umount
|
|
|
|
, buildGoPackage, fetchFromGitHub }:
|
2016-06-02 20:22:21 +00:00
|
|
|
|
|
|
|
buildGoPackage rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "interlock";
|
2016-06-02 20:22:21 +00:00
|
|
|
version = "2016.04.13";
|
|
|
|
rev = "v${version}";
|
|
|
|
|
|
|
|
goPackagePath = "github.com/inversepath/interlock";
|
|
|
|
|
|
|
|
subPackages = [ "./cmd/interlock" ];
|
|
|
|
|
2016-06-06 10:26:56 +00:00
|
|
|
src = fetchFromGitHub {
|
2016-06-02 20:22:21 +00:00
|
|
|
inherit rev;
|
2016-06-06 10:26:56 +00:00
|
|
|
owner = "inversepath";
|
|
|
|
repo = "interlock";
|
|
|
|
sha256 = "06aqx3jy744yx29xyg8ips0dw16186hfqbxdv3hfrmwxmaxhl4lz";
|
2016-06-02 20:22:21 +00:00
|
|
|
};
|
|
|
|
|
2016-09-10 10:04:13 +00:00
|
|
|
goDeps = ./deps.nix;
|
2016-06-02 20:22:21 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ sudo ];
|
|
|
|
buildFlags = [ "-tags textsecure" ];
|
|
|
|
postPatch = ''
|
|
|
|
grep -lr '/s\?bin/' | xargs sed -i \
|
2018-03-27 18:17:10 +00:00
|
|
|
-e 's|/bin/mount|${mount}/bin/mount|' \
|
|
|
|
-e 's|/bin/umount|${umount}/bin/umount|' \
|
2016-06-02 20:22:21 +00:00
|
|
|
-e 's|/bin/cp|${coreutils}/bin/cp|' \
|
|
|
|
-e 's|/bin/mv|${coreutils}/bin/mv|' \
|
|
|
|
-e 's|/bin/chown|${coreutils}/bin/chown|' \
|
|
|
|
-e 's|/bin/date|${coreutils}/bin/date|' \
|
|
|
|
-e 's|/sbin/poweroff|${systemd}/sbin/poweroff|' \
|
2017-01-29 10:11:01 +00:00
|
|
|
-e 's|/usr/bin/sudo|/run/wrappers/bin/sudo|' \
|
2016-06-02 20:22:21 +00:00
|
|
|
-e 's|/sbin/cryptsetup|${cryptsetup}/bin/cryptsetup|'
|
|
|
|
'';
|
|
|
|
}
|