From 848c6fbca2ec980b7d70860ac85c3b610b7d5e9c Mon Sep 17 00:00:00 2001 From: ryan4yin Date: Sun, 14 May 2023 19:40:12 +0800 Subject: [PATCH] fix: set EDITOR=vim --- home/programs/xdg.nix | 2 +- home/shell/default.nix | 7 ++++--- modules/system.nix | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/home/programs/xdg.nix b/home/programs/xdg.nix index c8a5b6f8..f386accd 100644 --- a/home/programs/xdg.nix +++ b/home/programs/xdg.nix @@ -11,7 +11,7 @@ "application/xhtml+xml" = browser; "text/html" = browser; "x-scheme-handler/about" = browser; - "x-scheme-handler/chrome" = ["chromium-browser.desktop"]; + # "x-scheme-handler/chrome" = ["chromium-browser.desktop"]; "x-scheme-handler/ftp" = browser; "x-scheme-handler/http" = browser; "x-scheme-handler/https" = browser; diff --git a/home/shell/default.nix b/home/shell/default.nix index f1320435..70485387 100644 --- a/home/shell/default.nix +++ b/home/shell/default.nix @@ -2,7 +2,7 @@ d = config.xdg.dataHome; c = config.xdg.configHome; cache = config.xdg.cacheHome; -in { +in rec { imports = [ ./nushell ./common.nix @@ -19,7 +19,6 @@ in { }; # add environment variables - # 注意不要用 home.sessionVariables 或 home.xxx.sessionVariables,这俩参数没用 systemd.user.sessionVariables = { # clean up ~ LESSHISTFILE = cache + "/less/history"; @@ -28,7 +27,7 @@ in { XAUTHORITY = "$XDG_RUNTIME_DIR/Xauthority"; # set default applications - EDITOR = "vim"; + EDITOR = "vim"; # this variable not work, need to set environment.variables.EDITOR instead. BROWSER = "firefox"; TERMINAL = "alacritty"; @@ -38,6 +37,8 @@ in { MANPAGER = "sh -c 'col -bx | bat -l man -p'"; }; + home.sessionVariables = systemd.user.sessionVariables; + home.shellAliases = { k = "kubectl"; }; diff --git a/modules/system.nix b/modules/system.nix index 93c8aace..11afbb45 100644 --- a/modules/system.nix +++ b/modules/system.nix @@ -157,6 +157,7 @@ minicom ]; + environment.variables.EDITOR = "vim"; # Enable sound with pipewire. sound.enable = true;