nixpkgs/pkgs/servers/interlock/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.3 KiB
Nix
Raw Normal View History

2022-06-23 22:31:15 +01:00
{ lib
, buildGoModule
, fetchFromGitHub
, coreutils
, cryptsetup
, mount
, systemd
, umount
}:
2016-06-02 21:22:21 +01:00
2022-06-23 22:31:15 +01:00
buildGoModule rec {
pname = "interlock";
2022-06-23 22:31:15 +01:00
version = "2020.03.05";
2016-06-02 21:22:21 +01:00
src = fetchFromGitHub {
2022-06-23 22:31:15 +01:00
owner = "usbarmory";
repo = "interlock";
2022-06-23 22:31:15 +01:00
rev = "v${version}";
sha256 = "sha256-YXa4vErt3YnomTKAXCv8yUVhcc0ST47n9waW5E8QZzY=";
2016-06-02 21:22:21 +01:00
};
2022-06-23 22:31:15 +01:00
vendorSha256 = "sha256-OL6I95IpyTIc8wCwD9nWxVUTrmZH6COhsd/YwNTyvN0=";
ldflags = [ "-s" "-w" ];
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|'
'';
2022-06-23 22:31:15 +01: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";
license = licenses.gpl3Plus;
platforms = platforms.linux;
};
2016-06-02 21:22:21 +01:00
}