tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
vaults: 0.9.0 -> 0.10.0
aleksana
7 months ago
e847a969
19a21665
+158
-35
3 changed files
expand all
collapse all
unified
split
pkgs
by-name
va
vaults
not-found-flatpak-info.patch
package.nix
remove_flatpak_dependency.patch
-11
pkgs/by-name/va/vaults/not-found-flatpak-info.patch
···
1
-
--- a/src/global_config_manager.rs
2
-
+++ b/src/global_config_manager.rs
3
-
@@ -100,7 +100,7 @@
4
-
let object: Self = glib::Object::new();
5
-
6
-
*object.imp().flatpak_info.borrow_mut() =
7
-
- Ini::load_from_file("/.flatpak-info").expect("Could not load .flatpak-info");
8
-
+ Ini::load_from_file("/.flatpak-info").unwrap_or_else(|_| Ini::new());
9
-
10
-
match user_config_dir().as_os_str().to_str() {
11
-
Some(user_config_directory) => {
···
0
0
0
0
0
0
0
0
0
0
0
+19
-24
pkgs/by-name/va/vaults/package.nix
···
2
lib,
3
stdenv,
4
fetchFromGitHub,
0
5
appstream-glib,
6
desktop-file-utils,
7
meson,
···
18
wayland,
19
gocryptfs,
20
cryfs,
0
0
21
}:
22
23
-
stdenv.mkDerivation rec {
24
pname = "vaults";
25
-
version = "0.9.0";
26
27
src = fetchFromGitHub {
28
owner = "mpobaschnig";
29
repo = "vaults";
30
-
tag = version;
31
-
hash = "sha256-PczDj6G05H6XbkMQBr4e1qgW5s8GswEA9f3BRxsAWv0=";
32
};
33
34
cargoDeps = rustPlatform.fetchCargoVendor {
35
-
inherit pname version src;
36
-
hash = "sha256-j0A6HlApV0l7LuB7ISHp+k/bSH5Icdv+aNQ9juCCO9I=";
37
};
38
39
-
patches = [ ./not-found-flatpak-info.patch ];
0
0
0
0
0
0
0
40
41
postPatch = ''
42
patchShebangs build-aux
43
'';
44
45
-
makeFlags = [
46
-
"PREFIX=${placeholder "out"}"
47
-
];
48
-
49
-
preFixup = ''
50
-
gappsWrapperArgs+=(
51
-
--prefix PATH : "${
52
-
lib.makeBinPath [
53
-
gocryptfs
54
-
cryfs
55
-
]
56
-
}"
57
-
)
58
-
'';
59
-
60
nativeBuildInputs = [
61
desktop-file-utils
62
meson
···
82
meta = {
83
description = "GTK frontend for encrypted vaults supporting gocryptfs and CryFS for encryption";
84
homepage = "https://mpobaschnig.github.io/vaults/";
85
-
changelog = "https://github.com/mpobaschnig/vaults/releases/tag/${version}";
86
license = lib.licenses.gpl3Plus;
87
maintainers = with lib.maintainers; [
88
benneti
···
91
mainProgram = "vaults";
92
platforms = lib.platforms.linux;
93
};
94
-
}
···
2
lib,
3
stdenv,
4
fetchFromGitHub,
5
+
replaceVars,
6
appstream-glib,
7
desktop-file-utils,
8
meson,
···
19
wayland,
20
gocryptfs,
21
cryfs,
22
+
fuse,
23
+
util-linux,
24
}:
25
26
+
stdenv.mkDerivation (finalAttrs: {
27
pname = "vaults";
28
+
version = "0.10.0";
29
30
src = fetchFromGitHub {
31
owner = "mpobaschnig";
32
repo = "vaults";
33
+
tag = finalAttrs.version;
34
+
hash = "sha256-B4CNEghMfP+r0poyhE102zC1Yd2U5ocV1MCMEVEMjEY=";
35
};
36
37
cargoDeps = rustPlatform.fetchCargoVendor {
38
+
inherit (finalAttrs) pname version src;
39
+
hash = "sha256-my4CxFIEN19juo/ya2vlkejQTaZsyoYLtFTR7iCT9s0=";
40
};
41
42
+
patches = [
43
+
(replaceVars ./remove_flatpak_dependency.patch {
44
+
cryfs = lib.getExe' cryfs "cryfs";
45
+
gocryptfs = lib.getExe' gocryptfs "gocryptfs";
46
+
fusermount = lib.getExe' fuse "fusermount";
47
+
umount = lib.getExe' util-linux "umount";
48
+
})
49
+
];
50
51
postPatch = ''
52
patchShebangs build-aux
53
'';
54
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
55
nativeBuildInputs = [
56
desktop-file-utils
57
meson
···
77
meta = {
78
description = "GTK frontend for encrypted vaults supporting gocryptfs and CryFS for encryption";
79
homepage = "https://mpobaschnig.github.io/vaults/";
80
+
changelog = "https://github.com/mpobaschnig/vaults/releases/tag/${finalAttrs.version}";
81
license = lib.licenses.gpl3Plus;
82
maintainers = with lib.maintainers; [
83
benneti
···
86
mainProgram = "vaults";
87
platforms = lib.platforms.linux;
88
};
89
+
})
+139
pkgs/by-name/va/vaults/remove_flatpak_dependency.patch
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
diff --git a/src/backend/cryfs.rs b/src/backend/cryfs.rs
2
+
index 089bf03..157c72a 100644
3
+
--- a/src/backend/cryfs.rs
4
+
+++ b/src/backend/cryfs.rs
5
+
@@ -35,13 +35,7 @@ fn get_binary_path(vault_config: &VaultConfig) -> String {
6
+
}
7
+
}
8
+
9
+
- let global_config = GlobalConfigManager::instance().get_flatpak_info();
10
+
- let instance_path = global_config
11
+
- .section(Some("Instance"))
12
+
- .unwrap()
13
+
- .get("app-path")
14
+
- .unwrap();
15
+
- let cryfs_instance_path = instance_path.to_owned() + "/bin/cryfs";
16
+
+ let cryfs_instance_path = "@cryfs@".to_string();
17
+
log::info!("CryFS binary path: {}", cryfs_instance_path);
18
+
cryfs_instance_path
19
+
}
20
+
@@ -49,9 +43,7 @@ fn get_binary_path(vault_config: &VaultConfig) -> String {
21
+
pub fn is_available(vault_config: &VaultConfig) -> Result<bool, BackendError> {
22
+
log::trace!("is_available({:?})", vault_config);
23
+
24
+
- let output = Command::new("flatpak-spawn")
25
+
- .arg("--host")
26
+
- .arg(get_binary_path(vault_config))
27
+
+ let output = Command::new(get_binary_path(vault_config))
28
+
.arg("--version")
29
+
.output()?;
30
+
log::debug!("CryFS output: {:?}", output);
31
+
@@ -64,9 +56,7 @@ pub fn is_available(vault_config: &VaultConfig) -> Result<bool, BackendError> {
32
+
pub fn init(vault_config: &VaultConfig, password: String) -> Result<(), BackendError> {
33
+
log::trace!("init({:?}, password: <redacted>)", vault_config);
34
+
35
+
- let mut child = Command::new("flatpak-spawn")
36
+
- .arg("--host")
37
+
- .arg(get_binary_path(vault_config))
38
+
+ let mut child = Command::new(get_binary_path(vault_config))
39
+
.env("CRYFS_FRONTEND", "noninteractive")
40
+
.stdin(Stdio::piped())
41
+
.stdout(Stdio::piped())
42
+
@@ -106,9 +96,7 @@ pub fn init(vault_config: &VaultConfig, password: String) -> Result<(), BackendE
43
+
pub fn open(vault_config: &VaultConfig, password: String) -> Result<(), BackendError> {
44
+
log::trace!("open({:?}, password: <redacted>)", vault_config);
45
+
46
+
- let mut child = Command::new("flatpak-spawn")
47
+
- .arg("--host")
48
+
- .arg(get_binary_path(vault_config))
49
+
+ let mut child = Command::new(get_binary_path(vault_config))
50
+
.env("CRYFS_FRONTEND", "noninteractive")
51
+
.stdin(Stdio::piped())
52
+
.stdout(Stdio::piped())
53
+
@@ -143,9 +131,7 @@ pub fn open(vault_config: &VaultConfig, password: String) -> Result<(), BackendE
54
+
pub fn close(vault_config: &VaultConfig) -> Result<(), BackendError> {
55
+
log::trace!("close({:?})", vault_config);
56
+
57
+
- let child = Command::new("flatpak-spawn")
58
+
- .arg("--host")
59
+
- .arg("fusermount")
60
+
+ let child = Command::new("@fusermount@")
61
+
.arg("-u")
62
+
.stdout(Stdio::piped())
63
+
.arg(&vault_config.mount_directory)
64
+
diff --git a/src/backend/gocryptfs.rs b/src/backend/gocryptfs.rs
65
+
index 9638f3a..ffa8f44 100644
66
+
--- a/src/backend/gocryptfs.rs
67
+
+++ b/src/backend/gocryptfs.rs
68
+
@@ -35,13 +35,7 @@ fn get_binary_path(vault_config: &VaultConfig) -> String {
69
+
}
70
+
}
71
+
72
+
- let global_config = GlobalConfigManager::instance().get_flatpak_info();
73
+
- let instance_path = global_config
74
+
- .section(Some("Instance"))
75
+
- .unwrap()
76
+
- .get("app-path")
77
+
- .unwrap();
78
+
- let gocryptfs_instance_path = instance_path.to_owned() + "/bin/gocryptfs";
79
+
+ let gocryptfs_instance_path = "@gocryptfs@".to_string();
80
+
log::info!("gocryptfs binary path: {}", gocryptfs_instance_path);
81
+
gocryptfs_instance_path
82
+
}
83
+
@@ -49,9 +43,7 @@ fn get_binary_path(vault_config: &VaultConfig) -> String {
84
+
pub fn is_available(vault_config: &VaultConfig) -> Result<bool, BackendError> {
85
+
log::trace!("is_available({:?})", vault_config);
86
+
87
+
- let output = Command::new("flatpak-spawn")
88
+
- .arg("--host")
89
+
- .arg(get_binary_path(vault_config))
90
+
+ let output = Command::new(get_binary_path(vault_config))
91
+
.arg("--version")
92
+
.output()?;
93
+
log::debug!("gocryptfs output: {:?}", output);
94
+
@@ -64,9 +56,7 @@ pub fn is_available(vault_config: &VaultConfig) -> Result<bool, BackendError> {
95
+
pub fn init(vault_config: &VaultConfig, password: String) -> Result<(), BackendError> {
96
+
log::trace!("init({:?}, password: <redacted>)", vault_config);
97
+
98
+
- let mut child = Command::new("flatpak-spawn")
99
+
- .arg("--host")
100
+
- .arg(get_binary_path(vault_config))
101
+
+ let mut child = Command::new(get_binary_path(vault_config))
102
+
.stdin(Stdio::piped())
103
+
.stdout(Stdio::piped())
104
+
.arg("--init")
105
+
@@ -104,9 +94,7 @@ pub fn init(vault_config: &VaultConfig, password: String) -> Result<(), BackendE
106
+
pub fn open(vault_config: &VaultConfig, password: String) -> Result<(), BackendError> {
107
+
log::trace!("open({:?}, password: <redacted>)", vault_config);
108
+
109
+
- let mut child = Command::new("flatpak-spawn")
110
+
- .arg("--host")
111
+
- .arg(get_binary_path(vault_config))
112
+
+ let mut child = Command::new(get_binary_path(vault_config))
113
+
.stdin(Stdio::piped())
114
+
.stdout(Stdio::piped())
115
+
.arg("-q")
116
+
@@ -142,9 +130,7 @@ pub fn open(vault_config: &VaultConfig, password: String) -> Result<(), BackendE
117
+
pub fn close(vault_config: &VaultConfig) -> Result<(), BackendError> {
118
+
log::trace!("close({:?}, password: <redacted>)", vault_config);
119
+
120
+
- let child = Command::new("flatpak-spawn")
121
+
- .arg("--host")
122
+
- .arg("umount")
123
+
+ let child = Command::new("@umount@")
124
+
.stdout(Stdio::piped())
125
+
.arg(&vault_config.mount_directory)
126
+
.spawn()?;
127
+
diff --git a/src/global_config_manager.rs b/src/global_config_manager.rs
128
+
index 619bb18..cea9ac3 100644
129
+
--- a/src/global_config_manager.rs
130
+
+++ b/src/global_config_manager.rs
131
+
@@ -102,7 +102,7 @@ impl GlobalConfigManager {
132
+
let object: Self = glib::Object::new();
133
+
134
+
*object.imp().flatpak_info.borrow_mut() =
135
+
- Ini::load_from_file("/.flatpak-info").expect("Could not load .flatpak-info");
136
+
+ Ini::load_from_file("/.flatpak-info").unwrap_or_else(|_| Ini::new());
137
+
138
+
match user_config_dir().as_os_str().to_str() {
139
+
Some(user_config_directory) => {