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