wm: Enable XDG MIME and set some defaults
This commit is contained in:
parent
835136165b
commit
9f48d6b9d9
@ -2,6 +2,7 @@
|
||||
let
|
||||
cfg = config.nixfiles.common.wm;
|
||||
inherit (lib) mkDefault;
|
||||
mkOverrideEach = pri: lib.mapAttrs (_:v: lib.mkOverride pri v);
|
||||
in
|
||||
{
|
||||
options.nixfiles.common.wm = {
|
||||
@ -47,6 +48,25 @@ in
|
||||
package = pkgs.swaylock-effects;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
# File associations
|
||||
xdg.mimeApps = {
|
||||
enable = true;
|
||||
defaultApplications = let
|
||||
defaultBrowser = [ "firefox.desktop" ];
|
||||
in mkOverrideEach 50 {
|
||||
"x-scheme-handler/https" = defaultBrowser;
|
||||
"x-scheme-handler/http" = defaultBrowser;
|
||||
"text/html" = defaultBrowser;
|
||||
"application/xhtml+xml" = defaultBrowser;
|
||||
"application/pdf" = defaultBrowser;
|
||||
};
|
||||
};
|
||||
|
||||
# this solves some inconsistent behavior with xdg-open
|
||||
xdg.portal.xdgOpenUsePortal = true;
|
||||
|
||||
services = {
|
||||
udiskie = {
|
||||
enable = mkDefault true;
|
||||
|
@ -3,6 +3,7 @@ let
|
||||
cfg = config.nixfiles.packageSets.multimedia;
|
||||
inherit (lib) optionals mkEnableOption mkIf;
|
||||
default = osConfig ? nixfiles && osConfig.nixfiles.packageSets.multimedia.enable;
|
||||
mkOverrideEach = pri: lib.mapAttrs (_:v: lib.mkOverride pri v);
|
||||
in
|
||||
{
|
||||
options.nixfiles.packageSets.multimedia = {
|
||||
@ -21,10 +22,29 @@ in
|
||||
krita
|
||||
inkscape
|
||||
obs-studio
|
||||
nomacs
|
||||
audacity
|
||||
] ++ [
|
||||
yt-dlp
|
||||
imagemagick
|
||||
ffmpeg
|
||||
];
|
||||
|
||||
xdg.mimeApps.defaultApplications = lib.mkMerge [
|
||||
# project files
|
||||
(mkOverrideEach 100 {
|
||||
"image/x-xcf" = [ "gimp.desktop" ];
|
||||
"image/x-compressed-xcf" = [ "gimp.desktop" ];
|
||||
"image/x-krita" = [ "krita.desktop" ];
|
||||
"application/x-audacity-project" = [ "audacity.desktop" ];
|
||||
"application/x-audacity-project+sqlite3" = [ "audacity.desktop" ];
|
||||
"image/svg+xml" = [ "org.inkscape.Inkscape.desktop" ];
|
||||
"image/svg+xml-compressed" = [ "org.inkscape.Inkscape.desktop" ];
|
||||
})
|
||||
# general files
|
||||
(with pkgs; mkOverrideEach 150 (config.lib.xdg.mimeAssociations [ nomacs mpv ]))
|
||||
# rest of the files
|
||||
(with pkgs; mkOverrideEach 200 (config.lib.xdg.mimeAssociations [ inkscape gimp audacity ]))
|
||||
];
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user