From dff0cfc3b085bc379b830f5ee1542c1c0f905475 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Thu, 5 Jul 2018 23:56:06 +0200 Subject: [PATCH 1/2] gocryptfs: fix typo in folder name --- pkgs/tools/filesystems/{gocrypfs => gocryptfs}/default.nix | 0 pkgs/tools/filesystems/{gocrypfs => gocryptfs}/deps.nix | 0 pkgs/top-level/all-packages.nix | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) rename pkgs/tools/filesystems/{gocrypfs => gocryptfs}/default.nix (100%) rename pkgs/tools/filesystems/{gocrypfs => gocryptfs}/deps.nix (100%) diff --git a/pkgs/tools/filesystems/gocrypfs/default.nix b/pkgs/tools/filesystems/gocryptfs/default.nix similarity index 100% rename from pkgs/tools/filesystems/gocrypfs/default.nix rename to pkgs/tools/filesystems/gocryptfs/default.nix diff --git a/pkgs/tools/filesystems/gocrypfs/deps.nix b/pkgs/tools/filesystems/gocryptfs/deps.nix similarity index 100% rename from pkgs/tools/filesystems/gocrypfs/deps.nix rename to pkgs/tools/filesystems/gocryptfs/deps.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6b1219690d7f..82f6c22c4b93 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2725,7 +2725,7 @@ with pkgs; goaccess = callPackage ../tools/misc/goaccess { }; - gocryptfs = callPackage ../tools/filesystems/gocrypfs { }; + gocryptfs = callPackage ../tools/filesystems/gocryptfs { }; godot = callPackage ../development/tools/godot {}; From 7e579aa994eb2dc42ddabf5aff6e2d89045a4586 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Fri, 6 Jul 2018 00:18:36 +0200 Subject: [PATCH 2/2] gocryptfs: 1.1.1 -> 1.5 Bold marked applicable changelog entries: - Support extended attributes (xattr) in forward mode - Add -fsck function - Fix several symlink race attacks - Use memory pools for buffer handling - Parallelize file content encryption - Use HKDF to derive separate keys for GCM and EME --- pkgs/tools/filesystems/gocryptfs/default.nix | 44 ++++++++++--------- pkgs/tools/filesystems/gocryptfs/deps.nix | 45 ++++++++++++++++---- 2 files changed, 61 insertions(+), 28 deletions(-) diff --git a/pkgs/tools/filesystems/gocryptfs/default.nix b/pkgs/tools/filesystems/gocryptfs/default.nix index b9314015cf55..75f5e9ffe11f 100644 --- a/pkgs/tools/filesystems/gocryptfs/default.nix +++ b/pkgs/tools/filesystems/gocryptfs/default.nix @@ -1,44 +1,50 @@ -# This file was generated by go2nix. -{ stdenv, lib, buildGoPackage, fetchFromGitHub, pkgconfig, openssl }: - -with lib; +# This file was generated by https://github.com/kamilchm/go2nix v1.2.1 +{ stdenv, buildGoPackage, fetchFromGitHub, openssl, pandoc, pkgconfig }: let - goFuseVersion = substring 0 7 (head (filter ( + version = "v1.5"; + goFuseVersion = with stdenv.lib; substring 0 7 (head (filter ( d: d.goPackagePath == "github.com/hanwen/go-fuse" ) (import ./deps.nix))).fetch.rev; -in buildGoPackage rec { +in +buildGoPackage rec { name = "gocryptfs-${version}"; - version = "1.1.1"; - rev = "v${version}"; goPackagePath = "github.com/rfjakob/gocryptfs"; + nativeBuildInputs = [ pandoc pkgconfig ]; + buildInputs = [ openssl ]; + src = fetchFromGitHub { - inherit rev; owner = "rfjakob"; repo = "gocryptfs"; - sha256 = "0p173x2s0km7a43h6ihir5p19fdlkkb9lc9120k9hccr33iws25z"; + rev = version; + sha256 = "0s5smjc7n9088n8a2mv7cy3cx31ci13i1i8fhg1vslc17a15qs2d"; }; - nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ openssl]; - - goDeps = ./deps.nix; - postPatch = "rm -r tests"; buildFlagsArray = '' -ldflags= - -X main.GitVersion=${rev} + -X main.GitVersion=${version} -X main.GitVersionFuse=${goFuseVersion} ''; - meta = { + goDeps = ./deps.nix; + + postBuild = '' + pushd go/src/github.com/rfjakob/gocryptfs/Documentation/ + mkdir -p $out/share/man/man1 + 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 + popd + ''; + + meta = with stdenv.lib; { description = "Encrypted overlay filesystem written in Go"; license = licenses.mit; homepage = https://nuetzlich.net/gocryptfs/; - maintainers = with maintainers; [offline]; - platforms = with platforms; linux; + maintainers = with maintainers; [ flokli offline ]; + platforms = platforms.unix; }; } diff --git a/pkgs/tools/filesystems/gocryptfs/deps.nix b/pkgs/tools/filesystems/gocryptfs/deps.nix index 08a4afb52653..cb5aec527f24 100644 --- a/pkgs/tools/filesystems/gocryptfs/deps.nix +++ b/pkgs/tools/filesystems/gocryptfs/deps.nix @@ -1,12 +1,12 @@ -# This file was generated by go2nix. +# This file was generated by https://github.com/kamilchm/go2nix v1.2.1 [ { goPackagePath = "github.com/hanwen/go-fuse"; fetch = { type = "git"; url = "https://github.com/hanwen/go-fuse"; - rev = "6c2b7d8f22c99776f8bfe17cd26d5f744a5b4cdc"; - sha256 = "1mb73vyqfy92830qif83zdlng0zycmm5fgmm9bwihqh92y8inw3h"; + rev = "291273cb8ce0f139636a6fd7414be3c7e2de6288"; + sha256 = "1djfl6mni8k4wllhwcr6qwyg1nh6wykdalvdl6gpc1rwrjj9c6xi"; }; } { @@ -14,8 +14,17 @@ fetch = { type = "git"; url = "https://github.com/jacobsa/crypto"; - rev = "293ce0c192fb4f59cd879b46544922b9ed09a13a"; - sha256 = "12nm5h5dqqk8yrzlkmcqm0aam8l6l1s6rah48mrmz1z5bgm9h5rs"; + rev = "c73681c634de898c869684602cf0c0d2ce938c4d"; + sha256 = "02jbiy6szshbzcmp4j3gpc577hrhikxqvm4kzxixp27k9f2cx5si"; + }; + } + { + goPackagePath = "github.com/pkg/xattr"; + fetch = { + type = "git"; + url = "https://github.com/pkg/xattr"; + rev = "d15dbc2bb0b5da267362b5e066e2c44c1fcff6c7"; + sha256 = "1vab8mpk2x4vbhx0kd0i0kn6sf7z5ivilcmdklyizzcfcwghh17g"; }; } { @@ -23,8 +32,8 @@ fetch = { type = "git"; url = "https://github.com/rfjakob/eme"; - rev = "601d0e278ceda9aa2085a61c9265f6e690ef5255"; - sha256 = "1ryh5f2a42psrqcpjh73shk3p0mva2vcyyfav4nhxmfqall77k5z"; + rev = "2222dbd4ba467ab3fc7e8af41562fcfe69c0d770"; + sha256 = "0c227ly3z8pqaqg22lpd8nzgqrfsbjx5gi9rp9ks1cmd11dv2gl9"; }; } { @@ -32,8 +41,26 @@ fetch = { type = "git"; url = "https://go.googlesource.com/crypto"; - rev = "88d0005bf4c3ec17306ecaca4281a8d8efd73e91"; - sha256 = "1d3x0rwfd4cml06ka8gy74wxrw94m2z7qgz6ky0rgmxcr7p5iikz"; + rev = "a49355c7e3f8fe157a85be2f77e6e269a0f89602"; + sha256 = "020q1laxjx5kcmnqy4wmdb63zhb0lyq6wpy40axhswzg2nd21s44"; + }; + } + { + goPackagePath = "golang.org/x/sync"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/sync"; + rev = "1d60e4601c6fd243af51cc01ddf169918a5407ca"; + sha256 = "046jlanz2lkxq1r57x9bl6s4cvfqaic6p2xybsj8mq1120jv4rs6"; + }; + } + { + goPackagePath = "golang.org/x/sys"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/sys"; + rev = "151529c776cdc58ddbe7963ba9af779f3577b419"; + sha256 = "149yfzs4k8vxhjr8f832drndir2k5ha0ggs2dw2fd6xvxf698bcx"; }; } ]