Created
March 19, 2025 00:23
-
-
Save aabccd021/c8facac370e6770ad15f48a326565ea1 to your computer and use it in GitHub Desktop.
unar.nix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs, lib, ... }: | |
let | |
desktopName = "unar"; | |
mimeType = [ | |
"application/vnd.rar" | |
"application/zip" | |
"application/x-tar" | |
"application/gzip" | |
"application/x-bzip2" | |
"application/x-compressed-tar" | |
]; | |
in | |
{ | |
home.packages = [ pkgs.unar ]; | |
xdg = { | |
desktopEntries = { | |
"${desktopName}" = { | |
inherit mimeType; | |
name = "${desktopName}"; | |
exec = "${pkgs.unar}/bin/unar %u"; | |
type = "Application"; | |
terminal = false; | |
noDisplay = true; | |
}; | |
}; | |
mimeApps = { | |
enable = true; | |
defaultApplications = lib.trivial.pipe mimeType [ | |
(builtins.map (name: { inherit name; value = "${desktopName}.desktop"; })) | |
builtins.listToAttrs | |
]; | |
}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment