mimetype: sandbox (and remove unneeded mimeopen)

This commit is contained in:
2024-07-18 11:43:45 +00:00
parent c8a99317bc
commit 9f26ad40f9
4 changed files with 15 additions and 2 deletions

View File

@@ -945,7 +945,7 @@ in
"/sys/devices" "/sys/devices"
]; ];
"perlPackages.FileMimeInfo".sandbox.enable = false; #< TODO: sandbox `mimetype` but not `mimeopen`. "perlPackages.FileMimeInfo" = {};
powertop.sandbox.method = "landlock"; powertop.sandbox.method = "landlock";
powertop.sandbox.capabilities = [ "ipc_lock" "sys_admin" ]; powertop.sandbox.capabilities = [ "ipc_lock" "sys_admin" ];

View File

@@ -90,6 +90,7 @@
./megapixels.nix ./megapixels.nix
./mepo.nix ./mepo.nix
./mimeo ./mimeo
./mimetype.nix
./mmcli.nix ./mmcli.nix
./mopidy.nix ./mopidy.nix
./mpv ./mpv

View File

@@ -0,0 +1,8 @@
{ pkgs, ... }:
{
sane.programs.mimetype = {
packageUnwrapped = pkgs.linkIntoOwnPackage pkgs.perlPackages.FileMimeInfo "bin/mimetype";
sandbox.method = "bwrap";
sandbox.autodetectCliPaths = "existing";
};
}

View File

@@ -12,7 +12,11 @@
# `mimetype` provides better mime associations than `file` # `mimetype` provides better mime associations than `file`
# - see: <https://github.com/NixOS/nixpkgs/pull/285233#issuecomment-1940828629> # - see: <https://github.com/NixOS/nixpkgs/pull/285233#issuecomment-1940828629>
suggestedPrograms = [ "perlPackages.FileMimeInfo" ]; suggestedPrograms = [
# "perlPackages.FileMimeInfo"
"mimetype"
# "mimeopen" #< optional, unclear what benefit
];
# alternative to letting the sandbox decide for itself: forcibly use the portal # alternative to letting the sandbox decide for itself: forcibly use the portal
# if the mime association list is not visible/in scope. # if the mime association list is not visible/in scope.