nixpkgs/pkgs/servers/interlock/default.nix

38 lines
1.0 KiB
Nix
Raw Normal View History

{ sudo, coreutils, systemd, cryptsetup
, mount, umount
, buildGoPackage, fetchFromGitHub }:
2016-06-02 21:22:21 +01:00
buildGoPackage rec {
pname = "interlock";
2016-06-02 21:22:21 +01:00
version = "2016.04.13";
rev = "v${version}";
goPackagePath = "github.com/inversepath/interlock";
subPackages = [ "./cmd/interlock" ];
src = fetchFromGitHub {
2016-06-02 21:22:21 +01:00
inherit rev;
owner = "inversepath";
repo = "interlock";
sha256 = "06aqx3jy744yx29xyg8ips0dw16186hfqbxdv3hfrmwxmaxhl4lz";
2016-06-02 21:22:21 +01:00
};
goDeps = ./deps.nix;
2016-06-02 21:22:21 +01:00
nativeBuildInputs = [ sudo ];
2021-08-05 22:52:32 +01:00
tags = [ "textsecure" ];
2016-06-02 21:22:21 +01:00
postPatch = ''
grep -lr '/s\?bin/' | xargs sed -i \
-e 's|/bin/mount|${mount}/bin/mount|' \
-e 's|/bin/umount|${umount}/bin/umount|' \
2016-06-02 21:22:21 +01: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|' \
-e 's|/usr/bin/sudo|/run/wrappers/bin/sudo|' \
2016-06-02 21:22:21 +01:00
-e 's|/sbin/cryptsetup|${cryptsetup}/bin/cryptsetup|'
'';
}