Manage default applications with home-manager
This commit is contained in:
parent
b6b5d5901c
commit
62265a466c
1 changed files with 75 additions and 1 deletions
76
home.nix
76
home.nix
|
@ -7,7 +7,81 @@
|
|||
];
|
||||
|
||||
xsession.enable = true;
|
||||
xdg.userDirs.enable = true;
|
||||
|
||||
xdg = {
|
||||
userDirs.enable = true;
|
||||
|
||||
mimeApps = {
|
||||
enable = true;
|
||||
|
||||
defaultApplications =
|
||||
let
|
||||
applications = {
|
||||
telegram = {
|
||||
mimeApp = "org.telegram.desktop.desktop";
|
||||
mimeTypes = [ "x-scheme-handler/tg" ];
|
||||
};
|
||||
|
||||
librewolf = {
|
||||
mimeApp = "librewolf.desktop";
|
||||
|
||||
mimeTypes = [
|
||||
"x-scheme-handler/http"
|
||||
"text/html"
|
||||
"application/xhtml+xml"
|
||||
"x-scheme-handler/https"
|
||||
"application/pdf"
|
||||
];
|
||||
};
|
||||
|
||||
gnomeTextEditor = {
|
||||
mimeApp = "org.gnome.TextEditor.desktop";
|
||||
mimeTypes = [ "text/plain" ];
|
||||
};
|
||||
|
||||
thunderbird = {
|
||||
mimeApp = "thunderbird.desktop";
|
||||
mimeTypes = [ "x-scheme-handler/mailto" ];
|
||||
};
|
||||
|
||||
loupe = {
|
||||
mimeApp = "org.gnome.Loupe.desktop";
|
||||
mimeTypes = [
|
||||
"image/jpeg"
|
||||
"image/png"
|
||||
"image/gif"
|
||||
"image/webp"
|
||||
"image/tiff"
|
||||
"image/x-tga"
|
||||
"image/vnd-ms.dds"
|
||||
"image/x-dds"
|
||||
"image/bmp"
|
||||
"image/vnd.microsoft.icon"
|
||||
"image/vnd.radiance"
|
||||
"image/x-exr"
|
||||
"image/x-portable-bitmap"
|
||||
"image/x-portable-graymap"
|
||||
"image/x-portable-pixmap"
|
||||
"image/x-portable-anymap"
|
||||
"image/x-qoi"
|
||||
"image/svg+xml"
|
||||
"image/svg+xml-compressed"
|
||||
"image/avif"
|
||||
"image/heic"
|
||||
"image/jxl"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
mimeTypesForApp = { mimeApp, mimeTypes }: map
|
||||
(
|
||||
mimeType: { "${mimeType}" = mimeApp; }
|
||||
)
|
||||
mimeTypes;
|
||||
in
|
||||
lib.zipAttrs (lib.flatten (map mimeTypesForApp (builtins.attrValues applications)));
|
||||
};
|
||||
};
|
||||
|
||||
home = {
|
||||
username = "pim";
|
||||
|
|
Loading…
Reference in a new issue