This commit is contained in:
parent
30f81b2b79
commit
d9d4e43c35
17 changed files with 310 additions and 276 deletions
|
|
@ -8,7 +8,6 @@
|
|||
{
|
||||
imports = [
|
||||
./machine-or-home-config.nix
|
||||
./xdg.nix
|
||||
];
|
||||
|
||||
system.stateVersion = machine.stateVersion;
|
||||
|
|
|
|||
156
defaults/xdg.nix
156
defaults/xdg.nix
|
|
@ -1,156 +0,0 @@
|
|||
{ ... }@inputs:
|
||||
let
|
||||
browsers = [
|
||||
"firefox.desktop"
|
||||
];
|
||||
|
||||
defaultApps = {
|
||||
text = [
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaanvim.desktop"
|
||||
];
|
||||
image = [ "org.gnome.Loupe.desktop" ];
|
||||
audio = [ "mpv.desktop" ];
|
||||
video = [ "mpv.desktop" ];
|
||||
directory = [
|
||||
"nautilus.desktop"
|
||||
"org.gnome.Nautilus.desktop"
|
||||
];
|
||||
mail = [ ] ++ browsers;
|
||||
calendar = [ ] ++ browsers;
|
||||
browser = [ ] ++ browsers;
|
||||
office = [ "libreoffice.desktop" ];
|
||||
pdf = [ ] ++ browsers;
|
||||
ebook = [ ];
|
||||
magnet = [ ];
|
||||
signal = [ "signal.desktop" ];
|
||||
};
|
||||
|
||||
mimeMap = {
|
||||
text = [
|
||||
"text/plain"
|
||||
"text/english"
|
||||
"application/x-zerosize"
|
||||
"text/x-makefile"
|
||||
"text/x-c++hdr"
|
||||
"text/x-c++src"
|
||||
"text/x-chdr"
|
||||
"text/x-csrc"
|
||||
"text/x-java"
|
||||
"text/x-moc"
|
||||
"text/x-pascal"
|
||||
"text/x-tcl"
|
||||
"text/x-tex"
|
||||
"application/x-shellscript"
|
||||
"text/x-c"
|
||||
"text/x-c++"
|
||||
];
|
||||
image = [
|
||||
"image/bmp"
|
||||
"image/gif"
|
||||
"image/jpeg"
|
||||
"image/jpg"
|
||||
"image/png"
|
||||
"image/svg+xml"
|
||||
"image/tiff"
|
||||
"image/vnd.microsoft.icon"
|
||||
"image/webp"
|
||||
];
|
||||
audio = [
|
||||
"audio/aac"
|
||||
"audio/mpeg"
|
||||
"audio/ogg"
|
||||
"audio/opus"
|
||||
"audio/wav"
|
||||
"audio/webm"
|
||||
"audio/x-matroska"
|
||||
];
|
||||
video = [
|
||||
"video/mp2t"
|
||||
"video/mp4"
|
||||
"video/mpeg"
|
||||
"video/ogg"
|
||||
"video/webm"
|
||||
"video/x-flv"
|
||||
"video/x-matroska"
|
||||
"video/x-msvideo"
|
||||
];
|
||||
directory = [ "inode/directory" ];
|
||||
mail = [ "x-scheme-handler/mailto" ];
|
||||
calendar = [
|
||||
"text/calendar"
|
||||
"x-scheme-handler/webcal"
|
||||
];
|
||||
browser = [
|
||||
"text/html"
|
||||
"x-scheme-handler/about"
|
||||
"x-scheme-handler/http"
|
||||
"x-scheme-handler/https"
|
||||
"x-scheme-handler/unknown"
|
||||
];
|
||||
office = [
|
||||
"application/vnd.oasis.opendocument.text"
|
||||
"application/vnd.oasis.opendocument.spreadsheet"
|
||||
"application/vnd.oasis.opendocument.presentation"
|
||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||
"application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
||||
"application/msword"
|
||||
"application/vnd.ms-excel"
|
||||
"application/vnd.ms-powerpoint"
|
||||
"application/rtf"
|
||||
];
|
||||
pdf = [ "application/pdf" ];
|
||||
ebook = [ "application/epub+zip" ];
|
||||
magnet = [ "x-scheme-handler/magnet" ];
|
||||
signal = [ "signal.desktop" ];
|
||||
};
|
||||
|
||||
associations =
|
||||
with inputs.lib;
|
||||
with builtins;
|
||||
listToAttrs (
|
||||
flatten (mapAttrsToList (key: map (type: attrsets.nameValuePair type defaultApps."${key}")) mimeMap)
|
||||
);
|
||||
removedAssociations = {
|
||||
"text/plain" = "dev.zed.Zed.desktop";
|
||||
"application/x-zerosize" = "dev.zed.Zed.desktop";
|
||||
};
|
||||
in
|
||||
{
|
||||
custom.program.homedirs = {
|
||||
home-config =
|
||||
{ config, ... }:
|
||||
{
|
||||
xdg = {
|
||||
enable = true;
|
||||
mime.enable = true;
|
||||
configHome = "${config.home.homeDirectory}/.config";
|
||||
userDirs = {
|
||||
enable = true;
|
||||
documents = "${config.home.homeDirectory}/Documents";
|
||||
desktop = "${config.home.homeDirectory}/Documents";
|
||||
download = "${config.home.homeDirectory}/Downloads";
|
||||
music = "${config.home.homeDirectory}/Documents/personal/music";
|
||||
pictures = "${config.home.homeDirectory}/Documents/personal/pictures";
|
||||
};
|
||||
configFile."mimeapps.list".force = true;
|
||||
mimeApps = {
|
||||
enable = true;
|
||||
associations.added = associations;
|
||||
associations.removed = removedAssociations;
|
||||
defaultApplications = associations;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
xdg = {
|
||||
mime = {
|
||||
enable = true;
|
||||
defaultApplications = associations;
|
||||
addedAssociations = associations;
|
||||
inherit removedAssociations;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue