mirror of
https://github.com/ItsDrike/nixdots
synced 2024-12-25 06:04:33 +00:00
Add xdg settings
This commit is contained in:
parent
a89f7f7576
commit
3ada18683e
|
@ -2,5 +2,6 @@ _: {
|
|||
imports = [
|
||||
./graphical
|
||||
./terminal
|
||||
./xdg
|
||||
];
|
||||
}
|
||||
|
|
14
home/programs/xdg/default.nix
Normal file
14
home/programs/xdg/default.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{config, ...}: {
|
||||
imports = [
|
||||
./mime-apps.nix
|
||||
./user-dirs.nix
|
||||
];
|
||||
|
||||
xdg = {
|
||||
enable = true;
|
||||
cacheHome = "${config.home.homeDirectory}/.cache";
|
||||
configHome = "${config.home.homeDirectory}/.config";
|
||||
dataHome = "${config.home.homeDirectory}/.local/share";
|
||||
stateHome = "${config.home.homeDirectory}/.local/state";
|
||||
};
|
||||
}
|
42
home/programs/xdg/mime-apps.nix
Normal file
42
home/programs/xdg/mime-apps.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
# Manage $XDG_CONFIG_HOME/mimeapps.list
|
||||
{
|
||||
xdg.mimeApps = {
|
||||
enable = true;
|
||||
associations.added = let
|
||||
browser = "firefox.desktop";
|
||||
textEditor = browser; # nvim doesn't work properly with xdg-open, just use the browser
|
||||
fileManager = "pcmanfm-qt.desktop";
|
||||
archiveManager = "org.gnome.FileRoller.desktop";
|
||||
imageViewer = "org.nomacs.ImageLounge.desktop";
|
||||
videoPlayer = "mpv.desktop";
|
||||
audioPlayer = "mpv.desktop";
|
||||
in {
|
||||
"text/html" = [browser];
|
||||
"x-scheme-handler/http" = [browser];
|
||||
"x-scheme-handler/https" = [browser];
|
||||
"x-scheme-handler/about" = [browser];
|
||||
"x-scheme-handler/unknown" = [browser];
|
||||
"application/x-extension-htm" = [browser];
|
||||
"application/x-extension-html" = [browser];
|
||||
"application/x-extension-shtml" = [browser];
|
||||
"application/xhtml+xml" = [browser];
|
||||
"application/x-extension-xhtml" = [browser];
|
||||
"application/x-extension-xht" = [browser];
|
||||
|
||||
"inode/directory" = [fileManager];
|
||||
"application/zip" = [archiveManager];
|
||||
"application/x-xz-compressed-tar" = [archiveManager];
|
||||
|
||||
"image/*" = [imageViewer];
|
||||
"audio/*" = [audioPlayer];
|
||||
"video/*" = [videoPlayer];
|
||||
|
||||
"text/plain" = [textEditor];
|
||||
"application/json" = [textEditor];
|
||||
|
||||
"x-scheme-handler/spotify" = ["spotify.desktop"];
|
||||
"x-scheme-handler/tg" = ["telegramdesktop.desktop"];
|
||||
"x-scheme-handler/msteams" = ["teams.desktop"]; # I need it for school, don't judge me
|
||||
};
|
||||
};
|
||||
}
|
22
home/programs/xdg/user-dirs.nix
Normal file
22
home/programs/xdg/user-dirs.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
# Manage $XDG_CONFIG_HOME/user-dirs.dirs
|
||||
{ config, ... }: {
|
||||
xdg.userDirs = {
|
||||
enable = true;
|
||||
createDirectories = true;
|
||||
|
||||
desktop = null;
|
||||
documents = null;
|
||||
download = "${config.home.homeDirectory}/Downloads";
|
||||
|
||||
publicShare = "${config.home.homeDirectory}/.local/share/public";
|
||||
templates = "${config.home.homeDirectory}/.local/share/templates";
|
||||
|
||||
music = "${config.home.homeDirectory}/Media/Music";
|
||||
pictures = "${config.home.homeDirectory}/Media/Pictures";
|
||||
videos = "${config.home.homeDirectory}/Media/Videos";
|
||||
|
||||
extraConfig = {
|
||||
XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue