nixos-config/users/simon/modules/xdg.nix

33 lines
928 B
Nix

# SPDX-FileCopyrightText: 2020-2023 Simon Bruder <simon@sbruder.de>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
{ lib, pkgs, nixosConfig, ... }:
{
xdg.mimeApps = {
enable = nixosConfig.sbruder.gui.enable;
defaultApplications =
let
browser = "librewolf.desktop";
in
{
"application/pdf" = "org.pwmt.zathura.desktop";
"image/jpeg" = "mpv.desktop";
"image/png" = "mpv.desktop";
"text/html" = browser;
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
};
};
# Some programs overwrite the mimeapps.list symlink with a normal file which
# makes home-manager activation fail
xdg.configFile = lib.mkIf nixosConfig.sbruder.gui.enable {
"mimeapps.list".force = true;
};
home.packages = with pkgs; [
xdg-utils # qt programs require xdg-open in path to use a reasonable program (i.e. not firefox)
];
}