qenya: xdg-mime-apps: make default app configuration declarative

This commit is contained in:
Katherina Walshe-Grey 2024-09-12 12:44:58 +01:00
parent afb16a55f3
commit 9fa74d52c1
2 changed files with 18 additions and 0 deletions

View file

@ -7,6 +7,7 @@
./git.nix ./git.nix
./tmux.nix ./tmux.nix
./vscode.nix ./vscode.nix
./xdg-mime-apps.nix
./zsh.nix ./zsh.nix
]; ];

View file

@ -0,0 +1,17 @@
{ config, lib, pkgs, osConfig, ... }:
let
isGraphical = osConfig.services.xserver.enable;
in
{
xdg.mimeApps = {
enable = isGraphical;
defaultApplications = {
"x-scheme-handler/http" = "firefox.desktop";
"x-scheme-handler/https" = "firefox.desktop";
"image/gif" = [ "org.gnome.Loupe.desktop" "org.kde.gwenview.desktop" ];
"image/jpeg" = [ "org.gnome.Loupe.desktop" "org.kde.gwenview.desktop" ];
"image/png" = [ "org.gnome.Loupe.desktop" "org.kde.gwenview.desktop" ];
};
};
}