From 23ceb8e6a7453602066900d5e06b37daf8c34fb6 Mon Sep 17 00:00:00 2001 From: RGBCube Date: Tue, 16 Jan 2024 14:27:26 +0300 Subject: [PATCH] Set helix alias in helix.nix --- modules/helix.nix | 20 ++++++++++++++++++-- modules/nushell/environment.nix.nu | 12 ------------ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/modules/helix.nix b/modules/helix.nix index 91b928e..2f9cbec 100644 --- a/modules/helix.nix +++ b/modules/helix.nix @@ -1,8 +1,24 @@ { ulib, lib, pkgs, upkgs, ... }: with ulib; merge (homeConfiguration { - programs.nushell.environmentVariables.EDITOR = "hx"; - programs.nushell.shellAliases.x = "hx"; + programs.nushell = { + environmentVariables.EDITOR = "hx"; + shellAliases.x = "hx"; + + configFile.text = lib.mkAfter '' + def --wrapped hx [...arguments] { + if ($env.TERM | str contains "kitty") { + kitty @ set-spacing padding=0 + } + + ^hx $arguments + + if ($env.TERM | str contains "kitty") { + kitty @ set-spacing padding=${toString theme.padding} + } + } + ''; + }; programs.helix = enabled { languages.language = [ diff --git a/modules/nushell/environment.nix.nu b/modules/nushell/environment.nix.nu index 3954162..7049327 100644 --- a/modules/nushell/environment.nix.nu +++ b/modules/nushell/environment.nix.nu @@ -23,17 +23,5 @@ def --env mc [path: path] { cd $path } -def --wrapped hx [...arguments] { - if ($env.TERM | str contains "kitty") { - kitty @ set-spacing padding=0 - } - - ^hx $arguments - - if ($env.TERM | str contains "kitty") { - kitty @ set-spacing padding=${toString theme.padding} - } -} - use ${upkgs.nuScripts}/modules/background_task/task.nu ''