Skip to content

Commit

Permalink
feat(nushell): parse home.shellVariables
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelroses committed Apr 11, 2024
1 parent 4c4ffbe commit 6c502fc
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions home/isabel/configs/shell/nushell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
self,
config,
...
}: {
}: let
inherit (lib) getExe mapAttrs escapeShellArg escapeShellArgs concatMapStrings;
in {
# FIXME: this is a workaround for nushell not loading the configuration on darwin systems
imports = [self.homeManagerModules.nushell];
disabledModules = ["programs/nushell.nix"];
Expand All @@ -14,15 +16,17 @@

shellAliases = builtins.removeAttrs config.home.shellAliases ["mkdir"];

environmentVariables = {
DIRENV_LOG_FORMAT = "''";
SHELL = "'${lib.getExe pkgs.nushell}'";
PATH = "($env.PATH | split row (char esep) | append [${lib.escapeShellArgs config.home.sessionPath}])";
};
environmentVariables =
{
DIRENV_LOG_FORMAT = "''";
SHELL = "'${getExe pkgs.nushell}'";
PATH = "($env.PATH | split row (char esep) | append [${escapeShellArgs config.home.sessionPath}])";
}
// mapAttrs (_: v: (escapeShellArg v)) config.home.sessionVariables;

extraConfig = let
completions = cmds: ''
${lib.concatMapStrings (cmd: ''
${concatMapStrings (cmd: ''
source "${pkgs.nu_scripts}/share/nu_scripts/custom-completions/${cmd}/${cmd}-completions.nu"
'')
cmds}
Expand Down

0 comments on commit 6c502fc

Please sign in to comment.