2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-09-25 04:45:31 +00:00
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
2021-09-22 15:38:15 +00:00
|
|
|
, fuse
|
|
|
|
, makeWrapper
|
2020-09-25 04:45:31 +00:00
|
|
|
, openssl
|
|
|
|
, pandoc
|
|
|
|
, pkg-config
|
2021-06-28 23:13:55 +00:00
|
|
|
, libfido2
|
2020-09-25 04:45:31 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "gocryptfs";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "2.4.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rfjakob";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
sha256 = "sha256-lStaMj2f8lQZx2E42o4ikPmFQzydlN3PFKwFvUx37SI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
vendorHash = "sha256-ir7FR7ndbPhzUOCVPrYO0SEe03wDFIP74I4X6HJxtE8=";
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2021-09-22 15:38:15 +00:00
|
|
|
makeWrapper
|
2021-06-28 23:13:55 +00:00
|
|
|
pkg-config
|
|
|
|
pandoc
|
|
|
|
];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
buildInputs = [ openssl ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
propagatedBuildInputs = [ libfido2 ];
|
|
|
|
|
2021-08-27 14:25:00 +00:00
|
|
|
ldflags = [
|
|
|
|
"-X main.GitVersion=${version}"
|
|
|
|
"-X main.GitVersionFuse=[vendored]"
|
|
|
|
"-X main.BuildDate=unknown"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
subPackages = [ "." "gocryptfs-xray" "contrib/statfs" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
postBuild = ''
|
2020-09-25 04:45:31 +00:00
|
|
|
pushd Documentation/
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p $out/share/man/man1
|
2021-06-28 23:13:55 +00:00
|
|
|
# taken from Documentation/MANPAGE-render.bash
|
2020-04-24 23:36:52 +00:00
|
|
|
pandoc MANPAGE.md -s -t man -o $out/share/man/man1/gocryptfs.1
|
|
|
|
pandoc MANPAGE-XRAY.md -s -t man -o $out/share/man/man1/gocryptfs-xray.1
|
2020-09-25 04:45:31 +00:00
|
|
|
pandoc MANPAGE-STATFS.md -s -t man -o $out/share/man/man1/statfs.1
|
2020-04-24 23:36:52 +00:00
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
2021-10-01 09:20:50 +00:00
|
|
|
# use --suffix here to ensure we don't shadow /run/wrappers/bin/fusermount,
|
|
|
|
# as the setuid wrapper is required to use gocryptfs as non-root on NixOS
|
2021-09-22 15:38:15 +00:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/gocryptfs \
|
2021-10-01 09:20:50 +00:00
|
|
|
--suffix PATH : ${lib.makeBinPath [ fuse ]}
|
2021-09-22 15:38:15 +00:00
|
|
|
ln -s $out/bin/gocryptfs $out/bin/mount.fuse.gocryptfs
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Encrypted overlay filesystem written in Go";
|
|
|
|
license = licenses.mit;
|
|
|
|
homepage = "https://nuetzlich.net/gocryptfs/";
|
2020-09-25 04:45:31 +00:00
|
|
|
maintainers = with maintainers; [ flokli offline prusnak ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|