nixos-config/profiles/applications-setup.nix

48 lines
1.7 KiB
Nix
Raw Normal View History

{ config, pkgs, ... }: {
startupApplications = with config.defaultApplications; [
browser.cmd
];
environment.sessionVariables = {
EDITOR = config.defaultApplications.editor.cmd;
VISUAL = config.defaultApplications.editor.cmd;
};
home-manager.users.balsoft = {
home.activation."mimeapps-remove" = {
before = [ "checkLinkTargets" ];
after = [ ];
data = "rm -f /home/balsoft/.config/mimeapps.list";
};
xdg.mimeApps = {
enable = true;
defaultApplications = with config.defaultApplications;
builtins.mapAttrs (name: value:
if value ? desktop then [ "${value.desktop}.desktop" ] else value) {
2021-11-15 14:16:26 +04:00
"inode/directory" = fm;
"text/html" = browser;
2023-01-24 17:51:04 +04:00
"image/*" = { desktop = "org.kde.gwenview"; };
"application/zip" = archive;
"application/rar" = archive;
"application/7z" = archive;
"application/*tar" = archive;
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
"x-scheme-handler/about" = browser;
"x-scheme-handler/mailto" = mail;
"x-scheme-handler/matrix" = matrix;
"application/pdf" = { desktop = "org.kde.okular"; };
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" =
text_processor;
"application/msword" = text_processor;
"application/vnd.oasis.opendocument.text" = text_processor;
"text/csv" = spreadsheet;
"application/vnd.oasis.opendocument.spreadsheet" = spreadsheet;
2023-01-20 20:09:41 +04:00
"text/plain" = editor;
"text/*" = editor;
};
};
};
}