This commit is contained in:
zastian@mrthoddata.com
2025-09-15 13:04:52 +01:00
parent cdb912796e
commit 935257bc4b
7 changed files with 638 additions and 139 deletions

View File

@@ -3,81 +3,97 @@
lib,
pkgs,
window_manager,
inputs,
...
}:
{
xdg = {
enable = true;
portal = {
enable = true;
config.common.default = [
"hyprland;kde"
"river"
"kde"
"gtk"
];
xdgOpenUsePortal = true;
extraPortals = with pkgs; [
xdg-desktop-portal-wlr
xdg-desktop-portal-gtk
xdg-desktop-portal-hyprland
inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland
kdePackages.xdg-desktop-portal-kde
];
};
mime.enable = true;
mimeApps = {
enable = true;
defaultApplications =
let
browser = [ "zen-beta.desktop" ];
browser = [ "zen-beta.desktop" ];
fileManager = [ "pcmanfm.desktop" ];
editor = [ "emacs.desktop" ];
player = [ "mpv.desktop" ];
viewer = [ "imv-dir.desktop" ];
reader = [ "org.pwmt.zathura.desktop" ];
in
{
"application/pdf" = reader;
editor = [ "emacs.desktop" ];
player = [ "mpv.desktop" ];
viewer = [ "imv-dir.desktop" ];
reader = [ "org.pwmt.zathura.desktop" ];
in {
# Documents
"application/pdf" = reader;
"application/epub" = reader;
"text/html" = browser;
"text/xml" = browser;
"text/plain" = editor;
# Text / markup
"text/plain" = editor;
"application/x-wine-extension-ini" = editor;
"text/html" = browser;
"text/xml" = browser;
"application/json" = browser;
"application/xml" = browser;
"application/xhtml+xml" = browser;
"application/xhtml_xml" = browser;
"application/rdf+xml" = browser;
"application/rss+xml" = browser;
"application/x-extension-htm" = browser;
"application/x-extension-html" = browser;
# Web / XML-ish
"application/json" = browser;
"application/xml" = browser;
"application/xhtml+xml" = browser;
"application/xhtml_xml" = browser;
"application/rdf+xml" = browser;
"application/rss+xml" = browser;
"application/x-extension-htm" = browser;
"application/x-extension-html" = browser;
"application/x-extension-shtml" = browser;
"application/x-extension-xht" = browser;
"application/x-extension-xht" = browser;
"application/x-extension-xhtml" = browser;
# URL schemes
"x-scheme-handler/about" = browser;
"x-scheme-handler/ftp" = browser;
"x-scheme-handler/http" = browser;
"x-scheme-handler/ftp" = browser;
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
# Files / directories
"inode/directory" = fileManager;
"application/zip" = fileManager;
# Audio
"audio/mpeg" = player;
"audio/aac" = player;
"audio/aac" = player;
"audio/flac" = player;
"audio/wav" = player;
"video/mp4" = player;
"video/vnd.mpegurl" = player;
"video/x-matroska" = player;
"audio/wav" = player;
# Video
"video/mp4" = player;
"video/vnd.mpegurl" = player;
"video/x-matroska" = player;
"application/x-mpegURL" = player;
"image/gif" = viewer;
# Images
"image/gif" = viewer;
"image/jpeg" = viewer;
"image/png" = viewer;
"image/png" = viewer;
"image/webp" = viewer;
};
};
@@ -85,13 +101,14 @@
userDirs = {
enable = true;
createDirectories = true;
download = "${config.home.homeDirectory}/Downloads";
documents = "${config.home.homeDirectory}/Documents";
desktop = "${config.home.homeDirectory}/Desktop";
videos = "${config.home.homeDirectory}/Videos";
pictures = "${config.home.homeDirectory}/Pictures";
music = "${config.home.homeDirectory}/Music";
templates = "${config.home.homeDirectory}/.local/share/templates";
download = "${config.home.homeDirectory}/Downloads";
documents = "${config.home.homeDirectory}/Documents";
desktop = "${config.home.homeDirectory}/Desktop";
videos = "${config.home.homeDirectory}/Videos";
pictures = "${config.home.homeDirectory}/Pictures";
music = "${config.home.homeDirectory}/Music";
templates = "${config.home.homeDirectory}/.local/share/templates";
publicShare = "${config.home.homeDirectory}/.local/share/public";
};
@@ -100,7 +117,8 @@
--enable-features=UseOzonePlatform
--ozone-platform-hint=wayland
'';
#configFile."hypr/hyprland.conf".onChange = "hyprctl reload";
# Example:
# configFile."hypr/hyprland.conf".onChange = "hyprctl reload";
};
}