2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2021-06-28 23:13:55 +00:00
|
|
|
, stdenv
|
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";
|
2022-09-09 14:08:57 +00:00
|
|
|
version = "2.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rfjakob";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-09-09 14:08:57 +00:00
|
|
|
sha256 = "sha256-IJUmH9w6ItDAZNbiO1Kkq3NO2c4Qpcd0ELiPlIPpbNI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
vendorSha256 = "sha256-7PpMnkoTMW4rb2Gy6s3CN7K3wG+QHmyvN3+7TYru2hE=";
|
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;
|
|
|
|
};
|
|
|
|
}
|