aboutsummaryrefslogtreecommitdiffstats
path: root/modules/home.legacy/conf/xdg
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-04-07 12:50:26 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-04-07 12:50:26 +0200
commit0863607a87572acda6276b6251778f2294d21ae6 (patch)
tree50092b650e944c07859cdb10d47ec27dcb6ff4ad /modules/home.legacy/conf/xdg
parentrefactor(modules/legacy/ytcc): Remove (diff)
downloadnixos-config-0863607a87572acda6276b6251778f2294d21ae6.zip
refactor(modules/xdg): Migrate to by-name and fix firefox dep in url-handler
Diffstat (limited to 'modules/home.legacy/conf/xdg')
-rw-r--r--modules/home.legacy/conf/xdg/default.nix59
-rwxr-xr-xmodules/home.legacy/conf/xdg/url-handler.sh18
-rw-r--r--modules/home.legacy/conf/xdg/xdg_vars.nix29
3 files changed, 0 insertions, 106 deletions
diff --git a/modules/home.legacy/conf/xdg/default.nix b/modules/home.legacy/conf/xdg/default.nix
deleted file mode 100644
index ad0cd226..00000000
--- a/modules/home.legacy/conf/xdg/default.nix
+++ /dev/null
@@ -1,59 +0,0 @@
-{
- pkgs,
- lib,
- ...
-}: let
- url-handler = pkgs.writeShellApplication {
- name = "url-handler";
- text = builtins.readFile ./url-handler.sh;
- inheritPath = false;
- runtimeInputs = [
- pkgs.rofi
- pkgs.libnotify
- pkgs.zathura
- pkgs.tskm
- ];
- };
-in {
- imports = [
- ./xdg_vars.nix
- ];
-
- xdg = {
- mimeApps = {
- enable = true;
- defaultApplications = {
- "application/pdf" = ["url-handler.desktop"];
- "application/x-pdf" = ["url-handler.desktop"];
-
- "text/html" = ["url-handler.desktop"];
- "text/xml" = ["url-handler.desktop"];
- "x-scheme-handler/http" = ["url-handler.desktop"];
- "x-scheme-handler/https" = ["url-handler.desktop"];
- "x-scheme-handler/about" = ["url-handler.desktop"];
- "x-scheme-handler/unknown" = ["url-handler.desktop"];
- };
- };
- desktopEntries = {
- url-handler = {
- name = "url-handler";
- genericName = "Web Browser";
- exec = "${lib.getExe url-handler} %u";
- terminal = false;
- categories = [
- "Application"
- "Network"
- "WebBrowser"
- ];
- mimeType = [
- "text/html"
- "text/xml"
- "x-scheme-handler/http"
- "x-scheme-handler/https"
- "x-scheme-handler/about"
- "x-scheme-handler/unknown"
- ];
- };
- };
- };
-}
diff --git a/modules/home.legacy/conf/xdg/url-handler.sh b/modules/home.legacy/conf/xdg/url-handler.sh
deleted file mode 100755
index f15df384..00000000
--- a/modules/home.legacy/conf/xdg/url-handler.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/env sh
-
-project="$({
- tskm projects list
- echo nvim zathura
-} | rofi -sep "$(printf "\n")" -dmenu)"
-
-if [ "$project" = "nvim" ]; then
- "$TERMINAL" -e nvim "$1"
-elif [ "$project" = "zathura" ]; then
- zathura "$1"
-elif [ "$project" ]; then
- firefox -P "$project" "$1"
-else
- notify-send "(URL HANDLER) No project selected" && exit 1
-fi
-
-# vim: ft=sh
diff --git a/modules/home.legacy/conf/xdg/xdg_vars.nix b/modules/home.legacy/conf/xdg/xdg_vars.nix
deleted file mode 100644
index aa2f30d4..00000000
--- a/modules/home.legacy/conf/xdg/xdg_vars.nix
+++ /dev/null
@@ -1,29 +0,0 @@
-{config, ...}: let
- inherit (config.xdg) dataHome;
-in {
- # FIXME: Move these options in relevant modules, that are connected to their software.
- # <2024-10-21>
-
- # Variables that only have to be set because special applications fail to set reasonable
- # defaults (mostly understandable because of backwards-compatibility, but yeah)
- home.sessionVariables = {
- CARGO_HOME = "${dataHome}/cargo";
- GRADLE_USER_HOME = "${dataHome}/gradle";
-
- #_JAVA_OPTIONS = lib.concatStringsSep " " [
- # ''-Djava.util.prefs.userRoot="${config.xdg.configHome}/java"''
- # ''-Djavafx.cachedir="${config.xdg.cacheHome}/openjfx"''
- # ];
- #GOPATH = "${config.xdg.dataHome}/go";
- #GTK2_RC_FILES = "${config.xdg.configHome}/gtk-2.0/gtkrc";
- #RUSTUP_HOME = "${config.xdg.dataHome}/rustup";
- #NPM_CONFIG_USERCONFIG = "${config.xdg.configHome}/npm/npmrc";
- #NUGET_PACKAGES = "${config.xdg.cacheHome}/NuGetPackages";
- #XAUTHORITY = "${config.xdg.stateHome}/Xauthority";
- #COMPDUMPFILE = "${config.xdg.dataHome}/zsh/.zcompdump}";
- #IPYTHONDIR = "${config.xdg.configHome}/ipython";
- #PARALLEL_HOME = "${config.xdg.configHome}/parallel";
- #STACK_XDG = "1";
- #WINEPREFIX = "${config.xdg.dataHome}/wine";
- };
-}