From 2c8a4dd99efd61298bc18393e7fcbf6063db8671 Mon Sep 17 00:00:00 2001 From: adikro Date: Sun, 8 Feb 2026 18:03:39 +0100 Subject: ... --- hm/conf/conf.nix | 1 + hm/conf/xdg-dirs.nix | 40 ++++++++++++++++++++-------------------- hm/conf/xdg-mime.nix | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 20 deletions(-) create mode 100644 hm/conf/xdg-mime.nix (limited to 'hm/conf') diff --git a/hm/conf/conf.nix b/hm/conf/conf.nix index 6c54d8a..57f9ba1 100644 --- a/hm/conf/conf.nix +++ b/hm/conf/conf.nix @@ -4,5 +4,6 @@ ./clip.nix ./git.nix ./xdg-dirs.nix + ./xdg-mime.nix ]; } diff --git a/hm/conf/xdg-dirs.nix b/hm/conf/xdg-dirs.nix index d779dba..ee34bd0 100644 --- a/hm/conf/xdg-dirs.nix +++ b/hm/conf/xdg-dirs.nix @@ -19,9 +19,9 @@ in download = "${config.home.homeDirectory}/dl"; documents = "${config.home.homeDirectory}/docs"; - + pictures = "${toString cfg.mediaPath}/pics"; - videos = "${toString cfg.mediaPath}/vids"; + videos = "${toString cfg.mediaPath}/vids"; desktop = null; music = null; @@ -29,25 +29,25 @@ in templates = null; extraConfig = { - XDG_PROJECTS_DIR = "${config.home.homeDirectory}/proj"; - XDG_GAMES_DIR = "${config.home.homeDirectory}/games"; - XDG_MEDIA_DIR = "${toString cfg.mediaPath}"; - XDG_SS_DIR = "${toString cfg.mediaPath}/pics/ss"; - XDG_CLIPS_DIR = "${toString cfg.mediaPath}/vids/clips"; - XDG_MOVIES_DIR = "${toString cfg.mediaPath}/movies"; - XDG_ANIME_DIR = "${toString cfg.mediaPath}/anime"; - XDG_ARCHIVE_DIR = "${toString cfg.mediaPath}/archive"; + PROJECTS = "${config.home.homeDirectory}/proj"; + GAMES = "${config.home.homeDirectory}/games"; + MEDIA = "${toString cfg.mediaPath}"; + SS = "${toString cfg.mediaPath}/pics/ss"; + CLIPS = "${toString cfg.mediaPath}/vids/clips"; + MOVIES = "${toString cfg.mediaPath}/movies"; + ANIME = "${toString cfg.mediaPath}/anime"; + ARCHIVE = "${toString cfg.mediaPath}/archive"; }; }; - home.sessionVariables = { - XDG_PROJECTS_DIR = "${config.home.homeDirectory}/proj"; - XDG_GAMES_DIR = "${config.home.homeDirectory}/games"; - XDG_MEDIA_DIR = "${toString cfg.mediaPath}"; - XDG_SS_DIR = "${toString cfg.mediaPath}/pics/ss"; - XDG_CLIPS_DIR = "${toString cfg.mediaPath}/vids/clips"; - XDG_MOVIES_DIR = "${toString cfg.mediaPath}/movies"; - XDG_ANIME_DIR = "${toString cfg.mediaPath}/anime"; - XDG_ARCHIVE_DIR = "${toString cfg.mediaPath}/archive"; - }; + home.sessionVariables = { + PROJECTS = "${config.home.homeDirectory}/proj"; + GAMES = "${config.home.homeDirectory}/games"; + MEDIA = "${toString cfg.mediaPath}"; + SS = "${toString cfg.mediaPath}/pics/ss"; + CLIPS = "${toString cfg.mediaPath}/vids/clips"; + MOVIES = "${toString cfg.mediaPath}/movies"; + ANIME = "${toString cfg.mediaPath}/anime"; + ARCHIVE = "${toString cfg.mediaPath}/archive"; + }; }; } diff --git a/hm/conf/xdg-mime.nix b/hm/conf/xdg-mime.nix new file mode 100644 index 0000000..0f55c5d --- /dev/null +++ b/hm/conf/xdg-mime.nix @@ -0,0 +1,49 @@ +{ config, lib, ... }: +let + cfg = config.hm.conf.xdg-mime; +in +{ + options.hm.conf.xdg-mime = { + enable = lib.mkEnableOption "sets the default applications"; + }; + config = lib.mkIf cfg.enable { + xdg.mimeApps = { + enable = true; + defaultApplications = { + "application/pdf" = [ "org.pwmt.zathura.desktop" ]; + "application/x-bzpdf" = [ "org.pwmt.zathura.desktop" ]; + "application/x-gzpdf" = [ "org.pwmt.zathura.desktop" ]; + "application/epub+zip" = [ "org.pwmt.zathura.desktop" ]; + + "image/png" = [ "nsxiv.desktop" ]; + "image/jpeg" = [ "nsxiv.desktop" ]; + "image/gif" = [ "nsxiv.desktop" ]; + "image/webp" = [ "nsxiv.desktop" ]; + "image/bmp" = [ "nsxiv.desktop" ]; + + "video/mp4" = [ "mpv.desktop" ]; + "video/x-matroska" = [ "mpv.desktop" ]; + "video/webm" = [ "mpv.desktop" ]; + "video/quicktime" = [ "mpv.desktop" ]; + + "audio/mpeg" = [ "mpv.desktop" ]; + "audio/flac" = [ "mpv.desktop" ]; + "audio/wav" = [ "mpv.desktop" ]; + "audio/ogg" = [ "mpv.desktop" ]; + + "text/html" = [ "firefox.desktop" ]; + "x-scheme-handler/http" = [ "firefox.desktop" ]; + "x-scheme-handler/https" = [ "firefox.desktop" ]; + "inode/directory" = [ "thunar.desktop" ]; + }; + }; + home.sessionVariables = { + EDITOR = "nvim"; + VISUAL = "nvim"; + BROWSER = "librewolf"; + TERMINAL = "foot"; + GPG_TTY = "$(tty)"; + COLORTERM = "truecolor"; + }; + }; +} -- cgit v1.3