2022-06-23 21:31:15 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, coreutils
|
|
|
|
, cryptsetup
|
|
|
|
, mount
|
|
|
|
, systemd
|
|
|
|
, umount
|
|
|
|
}:
|
2016-06-02 20:22:21 +00:00
|
|
|
|
2022-06-23 21:31:15 +00:00
|
|
|
buildGoModule rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "interlock";
|
2022-06-23 21:31:15 +00:00
|
|
|
version = "2020.03.05";
|
2016-06-02 20:22:21 +00:00
|
|
|
|
2016-06-06 10:26:56 +00:00
|
|
|
src = fetchFromGitHub {
|
2022-06-23 21:31:15 +00:00
|
|
|
owner = "usbarmory";
|
2016-06-06 10:26:56 +00:00
|
|
|
repo = "interlock";
|
2022-06-23 21:31:15 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-YXa4vErt3YnomTKAXCv8yUVhcc0ST47n9waW5E8QZzY=";
|
2016-06-02 20:22:21 +00:00
|
|
|
};
|
|
|
|
|
2023-09-13 04:44:46 +00:00
|
|
|
vendorHash = "sha256-OL6I95IpyTIc8wCwD9nWxVUTrmZH6COhsd/YwNTyvN0=";
|
2022-06-23 21:31:15 +00:00
|
|
|
|
|
|
|
ldflags = [ "-s" "-w" ];
|
2016-06-02 20:22:21 +00:00
|
|
|
|
|
|
|
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|'
|
|
|
|
'';
|
2022-06-23 21:31:15 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share
|
|
|
|
cp -R $src/static $out/share
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Tests are broken due to an error during key generation.
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/usbarmory/interlock";
|
|
|
|
description = "File encryption tool and an HSM frontend";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "interlock";
|
2022-06-23 21:31:15 +00:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
2016-06-02 20:22:21 +00:00
|
|
|
}
|