-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Labels
enhancementNew feature or requestNew feature or request
Description
The flatpak module currently doesn't seem very nice to work with; ideally it would more closely look like the flatpak-spawn command, and (imo) wouldn't look as "ugly".
Here's a quick draft of what the ideal struct for it would be like, this 100% needs tweaking in order to work with the Flatpak portal, and work "properly":
use std::os::fd::RawFd;
use std::fs::File;
#[derive(Debug)]
struct EnvVar {
var: String,
val: String,
}
/// A (more or less) 1:1 copy of the flatpak-spawn command, as a struct
#[derive(Default, Debug)]
struct FlatpakSpawn {
/// Enable debug output
verbose: bool,
/// Forward file descriptor(s)
forward_fd: Vec<RawFd>,
/// Run with clean environment
clear_env: bool,
/// Make the spawned command exit if we do
watch_bus: bool,
/// Expose sandbox PIDs in calling sandbox
expose_pids: bool,
/// Use the same PID namespace as calling sandbox
share_pids: bool,
/// Set environment variable(s)
env: Vec<EnvVar>,
// Unset environment variable(s)
// Remember to only pass through the variable name, not the contents!
// TODO
// unset-env: Vec<String>
// TODO: env-fd
/// Run with the latest vesion of the app and runtime
latest_version: bool,
/// Run sandboxed, without inheriting permissions.
/// See the --sandbox argument in https://man7.org/linux/man-pages/man1/flatpak-run.1.html
/// for more information.
sandbox: bool,
/// Whether to run with network access
no_network: bool,
/// Expose read-write access to the files/directories
sandbox-expose-rw: Vec<File>,
/// Expose read-only access to the files/directories
sandbox-expose-ro: Vec<File>,
// TODO: sandbox-flag
// NOT PLANNED: host (use a separate struct, ideally closer to Command)
/// Working directory in which to run the command
directory: File,
// Replace runtime's /app with DIR, or empty
// TODO
// app-path
/// Replace runtime's /usr with DIR
usr-path: File,
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request