mirror of
https://github.com/itme-brain/nixos.git
synced 2026-03-23 16:29:42 -04:00
init
This commit is contained in:
commit
259d9ed5a0
111 changed files with 7219 additions and 0 deletions
30
user/modules/gui/default.nix
Normal file
30
user/modules/gui/default.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{ lib, config, ... }:
|
||||
|
||||
let
|
||||
programs = config.programs;
|
||||
|
||||
defaultBrowser =
|
||||
if programs.firefox.enable then "firefox.desktop"
|
||||
else if programs.brave.enable then "brave-browser.desktop"
|
||||
else if programs.chromium.enable then "chromium.desktop"
|
||||
else null;
|
||||
|
||||
types = [
|
||||
"text/html" "application/xhtml+xml"
|
||||
"x-scheme-handler/http" "x-scheme-handler/https"
|
||||
"application/pdf"
|
||||
"image/png" "image/jpeg" "image/jpg" "image/gif"
|
||||
"image/webp" "image/avif" "image/bmp" "image/tiff" "image/svg+xml"
|
||||
"video/mp4" "video/webm" "video/mkv" "video/avi"
|
||||
"video/x-matroska" "video/quicktime"
|
||||
];
|
||||
|
||||
in
|
||||
{
|
||||
xdg.mimeApps = lib.mkIf (defaultBrowser != null) {
|
||||
enable = true;
|
||||
defaultApplications = builtins.listToAttrs (
|
||||
map (t: { name = t; value = [ defaultBrowser ]; }) types
|
||||
);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue