about summary refs log tree commit diff stats
path: root/hm
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2024-01-13 11:38:29 +0100
committerSoispha <soispha@vhack.eu>2024-01-13 11:38:29 +0100
commit12e3c1ad669c7b06bca3ce698798592f3f2567b6 (patch)
treea590ea17f9843e2b3163392fc05b5d30c028eeca /hm
parentbuild(treewide): Update flake and shell library (diff)
downloadnixos-config-12e3c1ad669c7b06bca3ce698798592f3f2567b6.tar.gz
nixos-config-12e3c1ad669c7b06bca3ce698798592f3f2567b6.zip
fix(hm): Move the session variables to their associated service
Diffstat (limited to '')
-rw-r--r--hm/soispha/conf/alacritty/default.nix8
-rw-r--r--hm/soispha/conf/firefox/default.nix6
-rw-r--r--hm/soispha/conf/less/default.nix10
-rw-r--r--hm/soispha/conf/mpd/default.nix4
-rw-r--r--hm/soispha/conf/nvim/default.nix5
-rw-r--r--hm/soispha/conf/zsh/default.nix28
-rw-r--r--hm/soispha/files/wallpaper/default.nix14
-rw-r--r--hm/soispha/wms/river/default.nix6
8 files changed, 45 insertions, 36 deletions
diff --git a/hm/soispha/conf/alacritty/default.nix b/hm/soispha/conf/alacritty/default.nix
index f595c014..9048fc34 100644
--- a/hm/soispha/conf/alacritty/default.nix
+++ b/hm/soispha/conf/alacritty/default.nix
@@ -20,6 +20,14 @@
     ${lib.strings.fileContents ./yaml/window.yml}
   '';
 in {
+  home.sessionVariables = {
+    # This is **not** the TERM variable but a special one to signify my favorite terminal.
+    TERMINAL = "alacritty";
+
+    # These two here should be set by alacritty at start-up
+    # TERM = "alacritty";
+    # COLORTERM = "truecolor";
+  };
   programs.alacritty = {
     enable = true;
   };
diff --git a/hm/soispha/conf/firefox/default.nix b/hm/soispha/conf/firefox/default.nix
index e7903a92..c42b3f1c 100644
--- a/hm/soispha/conf/firefox/default.nix
+++ b/hm/soispha/conf/firefox/default.nix
@@ -94,8 +94,14 @@ in {
     home.sessionVariables = {
       # improve touch input & make scrolling smother
       MOZ_USE_XINPUT2 = "1";
+
       # improve wayland support
       MOZ_ENABLE_WAYLAND = 1;
+
+      # tell gtk to use portals
+      GTK_USE_PORTAL = 1;
+
+      BROWSER = "firefox";
     };
     programs.firefox = {
       enable = true;
diff --git a/hm/soispha/conf/less/default.nix b/hm/soispha/conf/less/default.nix
index fe7142f1..e5506fcd 100644
--- a/hm/soispha/conf/less/default.nix
+++ b/hm/soispha/conf/less/default.nix
@@ -1,8 +1,8 @@
-{
-  config,
-  pkgs,
-  ...
-}: {
+{config, ...}: {
+  home.sessionVariables = {
+    PAGER = "less";
+    MANPAGER = "less";
+  };
   programs.less = {
     enable = true;
     keys = ''
diff --git a/hm/soispha/conf/mpd/default.nix b/hm/soispha/conf/mpd/default.nix
index bbd345a7..49844b06 100644
--- a/hm/soispha/conf/mpd/default.nix
+++ b/hm/soispha/conf/mpd/default.nix
@@ -9,6 +9,10 @@
   playlistDirectory = "${dataDir}/playlists";
   runtimeDir = "/run/user/${builtins.toString osConfig.users.users.soispha.uid}/mpd";
 in {
+  home.sessionVariables = {
+    MPD_HOST = "/run/user/${builtins.toString osConfig.users.users.soispha.uid}/mpd/socket";
+  };
+
   systemd.user.services.mpd.Service.ExecStartPre = lib.mkForce ''
     ${pkgs.coreutils}/bin/mkdir -p "${dataDir}" "${playlistDirectory}" "${runtimeDir}"
   '';
diff --git a/hm/soispha/conf/nvim/default.nix b/hm/soispha/conf/nvim/default.nix
index 322597ec..2da80c22 100644
--- a/hm/soispha/conf/nvim/default.nix
+++ b/hm/soispha/conf/nvim/default.nix
@@ -7,6 +7,11 @@
     ./options
     ./plgs
   ];
+  home.sessionVariables = {
+    EDITOR = "nvim";
+    VISUAL = "nvim";
+    CODEEDITOR = "nvim";
+  };
   programs.nixvim = {
     enable = true;
 
diff --git a/hm/soispha/conf/zsh/default.nix b/hm/soispha/conf/zsh/default.nix
index a93dabce..8f36cf6c 100644
--- a/hm/soispha/conf/zsh/default.nix
+++ b/hm/soispha/conf/zsh/default.nix
@@ -4,7 +4,6 @@
   lib,
   shell_library,
   system,
-  osConfig,
   ...
 }: {
   # TODO: ADD THIS ADDON
@@ -79,32 +78,15 @@
       hisea = "history 0 | grep";
     };
     sessionVariables = {
-      EDITOR = "nvim";
       IVIEWER = "imv";
       READER = "zathura";
-      VISUAL = "nvim";
-      CODEEDITOR = "nvim";
-      TERMINAL = "alacritty";
-      BROWSER = "firefox";
-      COLORTERM = "truecolor";
-      PAGER = "less -R";
-      WM = "river";
-      WALLPAPER = "${config.home.homeDirectory}/media/pictures/wallpaper";
-
-      # FUNCNEST for more functions in functions
-      #FUNCNEST = "2000";
-
-      WALLPAPERDIR = "$HOME/media/pictures/wallpapers/";
-      LESS = "R";
-      MANPAGER = "less -R --use-color -Dd+r -Du+b";
+
       LIBVIRT_DEFAULT_URI = "qemu:///system";
 
       BEMENU_SCALE = "1.5";
       BEMENU_BACKEND = "wayland";
       BEMENU_OPTS = "--fn 'Source Code Pro 10' -c -l 30 -B 1 -W 0.9 --hf #ffffff";
 
-      MPD_HOST = "/run/user/${builtins.toString osConfig.users.users.soispha.uid}/mpd/socket";
-
       # Clean the home dir {{{
       CARGO_HOME = "${config.xdg.dataHome}/cargo";
 
@@ -115,8 +97,6 @@
       #GRADLE_USER_HOME = "${config.xdg.dataHome}/gradle";
       #GOPATH = "${config.xdg.dataHome}/go";
       #GTK2_RC_FILES = "${config.xdg.configHome}/gtk-2.0/gtkrc";
-      #LESSHISFILE = "${config.xdg.cacheHome}/less/history";
-      #LESSKEYIN = "${config.xdg.configHome}/less/lesskey";
       #RUSTUP_HOME = "${config.xdg.dataHome}/rustup";
       #NPM_CONFIG_USERCONFIG = "${config.xdg.configHome}/npm/npmrc";
       #NUGET_PACKAGES = "${config.xdg.cacheHome}/NuGetPackages";
@@ -130,16 +110,10 @@
       # }}}
 
       # Export Wayland env Vars {{{
-      # FIXME: This should not always be set to river <2023-12-28>
-      XDG_CURRENT_DESKTOP = "river";
-      DESKTOP_SESSION = "river";
-
-      GTK_USE_PORTAL = 1; # tell gtk to use portals
       QT_QPA_PLATFORM = "wayland";
       QT_QPA_PLATFORMTHEME = "qt5ct"; # needs qt5ct
       CLUTTER_BACKEND = "wayland";
       SDL_VIDEODRIVER = "wayland"; # might brake some things
-      MOZ_ENABLE_WAYLAND = "1";
       # }}}
     };
   };
diff --git a/hm/soispha/files/wallpaper/default.nix b/hm/soispha/files/wallpaper/default.nix
index 2c9b3368..119df225 100644
--- a/hm/soispha/files/wallpaper/default.nix
+++ b/hm/soispha/files/wallpaper/default.nix
@@ -1,8 +1,14 @@
 {config, ...}: {
-  home.file = {
-    wallpaper = {
-      source = ./abstract-nord.png;
-      target = "media/pictures/wallpaper";
+  home = {
+    sessionVariables = {
+      WALLPAPER = "${config.home.homeDirectory}/media/pictures/wallpaper";
+    };
+
+    file = {
+      wallpaper = {
+        source = ./abstract-nord.png;
+        target = "media/pictures/wallpaper";
+      };
     };
   };
 }
diff --git a/hm/soispha/wms/river/default.nix b/hm/soispha/wms/river/default.nix
index e887bdea..ba0725c0 100644
--- a/hm/soispha/wms/river/default.nix
+++ b/hm/soispha/wms/river/default.nix
@@ -41,6 +41,12 @@
     inherit mappings screen_setup env_vars;
   };
 in {
+  home.sessionVariables = {
+    WM = "river";
+    XDG_CURRENT_DESKTOP = "river";
+    DESKTOP_SESSION = "river";
+  };
+
   xdg.configFile."river/init".source =
     sysLib.writeShellScript {
       name = "river_init";