refactor: mimeapps: port from home-manager -> nixos
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
./keyring.nix
|
./keyring.nix
|
||||||
./kitty.nix
|
./kitty.nix
|
||||||
./libreoffice.nix
|
./libreoffice.nix
|
||||||
|
./mime.nix
|
||||||
./mpv.nix
|
./mpv.nix
|
||||||
./neovim.nix
|
./neovim.nix
|
||||||
./newsflash.nix
|
./newsflash.nix
|
||||||
|
41
hosts/common/home/mime.nix
Normal file
41
hosts/common/home/mime.nix
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
{ config, lib, sane-lib, ...}:
|
||||||
|
|
||||||
|
let
|
||||||
|
www = config.sane.web-browser.browser.desktop;
|
||||||
|
pdf = "org.gnome.Evince.desktop";
|
||||||
|
md = "obsidian.desktop";
|
||||||
|
thumb = "org.gnome.gThumb.desktop";
|
||||||
|
video = "vlc.desktop";
|
||||||
|
# audio = "mpv.desktop";
|
||||||
|
audio = "vlc.desktop";
|
||||||
|
in
|
||||||
|
lib.mkIf config.sane.home-manager.enable
|
||||||
|
{
|
||||||
|
|
||||||
|
# the xdg mime type for a file can be found with:
|
||||||
|
# - `xdg-mime query filetype path/to/thing.ext`
|
||||||
|
xdg.mime.enable = true;
|
||||||
|
xdg.mime.defaultApplications = {
|
||||||
|
# HTML
|
||||||
|
"text/html" = [ www ];
|
||||||
|
"x-scheme-handler/http" = [ www ];
|
||||||
|
"x-scheme-handler/https" = [ www ];
|
||||||
|
"x-scheme-handler/about" = [ www ];
|
||||||
|
"x-scheme-handler/unknown" = [ www ];
|
||||||
|
# RICH-TEXT DOCUMENTS
|
||||||
|
"application/pdf" = [ pdf ];
|
||||||
|
"text/markdown" = [ md ];
|
||||||
|
# IMAGES
|
||||||
|
"image/heif" = [ thumb ]; # apple codec
|
||||||
|
"image/png" = [ thumb ];
|
||||||
|
"image/jpeg" = [ thumb ];
|
||||||
|
# VIDEO
|
||||||
|
"video/mp4" = [ video ];
|
||||||
|
"video/quicktime" = [ video ];
|
||||||
|
"video/x-matroska" = [ video ];
|
||||||
|
# AUDIO
|
||||||
|
"audio/flac" = [ audio ];
|
||||||
|
"audio/mpeg" = [ audio ];
|
||||||
|
"audio/x-vorbis+ogg" = [ audio ];
|
||||||
|
};
|
||||||
|
}
|
@@ -51,41 +51,6 @@ in
|
|||||||
home.username = "colin";
|
home.username = "colin";
|
||||||
home.homeDirectory = "/home/colin";
|
home.homeDirectory = "/home/colin";
|
||||||
|
|
||||||
# the xdg mime type for a file can be found with:
|
|
||||||
# - `xdg-mime query filetype path/to/thing.ext`
|
|
||||||
xdg.mimeApps.enable = true;
|
|
||||||
xdg.mimeApps.defaultApplications = let
|
|
||||||
www = sysconfig.sane.web-browser.browser.desktop;
|
|
||||||
pdf = "org.gnome.Evince.desktop";
|
|
||||||
md = "obsidian.desktop";
|
|
||||||
thumb = "org.gnome.gThumb.desktop";
|
|
||||||
video = "vlc.desktop";
|
|
||||||
# audio = "mpv.desktop";
|
|
||||||
audio = "vlc.desktop";
|
|
||||||
in {
|
|
||||||
# HTML
|
|
||||||
"text/html" = [ www ];
|
|
||||||
"x-scheme-handler/http" = [ www ];
|
|
||||||
"x-scheme-handler/https" = [ www ];
|
|
||||||
"x-scheme-handler/about" = [ www ];
|
|
||||||
"x-scheme-handler/unknown" = [ www ];
|
|
||||||
# RICH-TEXT DOCUMENTS
|
|
||||||
"application/pdf" = [ pdf ];
|
|
||||||
"text/markdown" = [ md ];
|
|
||||||
# IMAGES
|
|
||||||
"image/heif" = [ thumb ]; # apple codec
|
|
||||||
"image/png" = [ thumb ];
|
|
||||||
"image/jpeg" = [ thumb ];
|
|
||||||
# VIDEO
|
|
||||||
"video/mp4" = [ video ];
|
|
||||||
"video/quicktime" = [ video ];
|
|
||||||
"video/x-matroska" = [ video ];
|
|
||||||
# AUDIO
|
|
||||||
"audio/flac" = [ audio ];
|
|
||||||
"audio/mpeg" = [ audio ];
|
|
||||||
"audio/x-vorbis+ogg" = [ audio ];
|
|
||||||
};
|
|
||||||
|
|
||||||
programs = lib.mkMerge [
|
programs = lib.mkMerge [
|
||||||
{
|
{
|
||||||
home-manager.enable = true; # this lets home-manager manage dot-files in user dirs, i think
|
home-manager.enable = true; # this lets home-manager manage dot-files in user dirs, i think
|
||||||
|
Reference in New Issue
Block a user