Files
NixOsConfig/modules/home/xdg.nix
T
Claude 7dd6853124 Normalize file modes to 644
All tracked files were committed as 755; only Nix reads them.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JZ16yf4acmaSiHq81vyQ6Z
2026-10-12 20:41:48 +00:00

68 lines
1.9 KiB
Nix

# XDG base dirs, the user folders and default applications.
# Documents, Downloads, Music, Pictures and Videos are separate subvolumes on
# the data SSD mounted into $HOME (my.disks); Desktop, Templates and Public
# are plain directories on the system disk. Home-manager's default folder
# names already match, so only the unwanted ones are changed.
{
config,
lib,
...
}:
let
cfg = config.my.home.xdg;
firefox = "firefox.desktop";
fileManager = "Dolphin.desktop";
imageViewer = "org.gnome.Loupe.desktop";
mediaPlayer = "mpv.desktop";
pdfViewer = "org.pwmt.zathura.desktop";
archiveManager = "org.gnome.FileRoller.desktop";
in
{
options.my.home.xdg.enable = lib.mkEnableOption "XDG directories and default applications";
config = lib.mkIf cfg.enable {
xdg = {
enable = true;
userDirs = {
enable = true;
createDirectories = true;
# No ~/Projects: code lives wherever the user clones it.
projects = null;
};
mimeApps = {
enable = true;
defaultApplications = {
"text/html" = firefox;
"x-scheme-handler/http" = firefox;
"x-scheme-handler/https" = firefox;
"x-scheme-handler/about" = firefox;
"x-scheme-handler/unknown" = firefox;
"inode/directory" = fileManager;
"image/*" = imageViewer;
"video/*" = mediaPlayer;
"audio/*" = mediaPlayer;
"application/pdf" = pdfViewer;
"application/zip" = archiveManager;
"application/x-tar" = archiveManager;
"application/x-7z-compressed" = archiveManager;
"application/vnd.rar" = archiveManager;
};
};
# "Open in terminal" actions (desktop entries with Terminal=true) use WezTerm.
terminal-exec = {
enable = true;
settings.default = [ "org.wezfurlong.wezterm.desktop" ];
};
};
};
}