nix-config/home/modules/xdg.nix
Tim Schubert 0a6e4f99c4
Some checks are pending
Continuous Integration / Checks (push) Waiting to run
feat: configure sway
2024-11-24 18:48:14 +01:00

53 lines
1.4 KiB
Nix

{ config
, pkgs
, lib
, ...
}:
with lib; let
apps = {
"x-scheme-handler/mailto" = "evolution.desktop";
"message/rfc822" = "evolution.desktop";
"x-scheme-handler/http" = "firefox.desktop";
"x-scheme-handler/https" = "firefox.desktop";
"x-scheme-handler/ftp" = "firefox.desktop";
"x-scheme-handler/chrome" = "firefox.desktop";
"text/html" = "firefox.desktop";
"application/x-extension-htm" = "firefox.desktop";
"application/x-extension-html" = "firefox.desktop";
"application/x-extension-shtml" = "firefox.desktop";
"application/xhtml+xml" = "firefox.desktop";
"application/x-extension-xhtml" = "firefox.desktop";
"application/x-extension-xht" = "firefox.desktop";
"application/pdf" = "evince.desktop";
};
cfg = config.dadada.home.xdg;
in
{
options.dadada.home.xdg = {
enable = mkEnableOption "Enable XDG config";
};
config = mkIf cfg.enable {
xdg = {
enable = true;
configHome = "${config.home.homeDirectory}/.config";
mimeApps = {
enable = false;
associations.added = apps;
defaultApplications = apps;
};
userDirs = {
desktop = "\$HOME/.desktop";
download = "\$HOME/tmp";
music = "\$HOME/lib/music";
videos = "\$HOME/lib/videos";
pictures = "\$HOME/lib/pictures";
documents = "\$HOME/lib";
};
};
home.packages = with pkgs; [
evince
firefox
xdg_utils
];
};
}