From d81af3d6ebf56489820f90d5d942e82a5332df6d Mon Sep 17 00:00:00 2001 From: Tomo <68489118+Tomodachi94@users.noreply.github.com> Date: Wed, 27 Mar 2024 23:03:40 -0700 Subject: [PATCH] use lib.getExe instead of manual /bin hardcoding This makes swapping out otherwise-equivalent packages easier, and it's just more pleasing to the eye :) --- home/common/git/default.nix | 4 ++-- home/common/nvim/default.nix | 4 ++-- home/linux/i3/default.nix | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/home/common/git/default.nix b/home/common/git/default.nix index dbcd49e..a7384a6 100644 --- a/home/common/git/default.nix +++ b/home/common/git/default.nix @@ -26,14 +26,14 @@ defaultBranch = "main"; }; core = { - editor = "${pkgs.neovim}/bin/nvim"; + editor = "${pkgs.lib.getExe pkgs.neovim}"; }; color = { ui = "auto"; }; diff = { algorithm = "histogram"; - tool = "${pkgs.neovim}/bin/nvim -d"; + tool = "${pkgs.lib.getExe pkgs.neovim} -d"; }; help = { autocorrect = 20; diff --git a/home/common/nvim/default.nix b/home/common/nvim/default.nix index 0622dcc..6ac6f16 100644 --- a/home/common/nvim/default.nix +++ b/home/common/nvim/default.nix @@ -6,8 +6,8 @@ in { imports = [ ./nix ]; home.sessionVariables = { - EDITOR = "${pkgs.neovim}/bin/nvim"; - VISUAL = "${pkgs.neovim}/bin/nvim"; + EDITOR = "${pkgs.lib.getExe pkgs.neovim}"; + VISUAL = "${pkgs.lib.getExe pkgs.neovim}"; }; xdg.configFile."nvim/lua".source = ./lua; xdg.configFile."nvim/snips".source = ./snips; diff --git a/home/linux/i3/default.nix b/home/linux/i3/default.nix index 92855bc..3749372 100644 --- a/home/linux/i3/default.nix +++ b/home/linux/i3/default.nix @@ -13,7 +13,7 @@ ## end manual config ## ''; onChange = '' - if [ ${pkgs.xorg.xprop}/bin/xprop -root | ${pkgs.gnugrep} i3 ]; then + if [ ${pkgs.lib.getExe pkgs.xorg.xprop} -root | ${pkgs.lib.getExe pkgs.gnugrep} i3 ]; then noteEcho "Reloading i3 to apply changes" ${pkgs.i3}/bin/i3-msg reload else