mirror of
https://github.com/thegeneralist01/config.git
synced 2026-05-30 08:37:01 +02:00
fix nushell not being default shell
This commit is contained in:
parent
8c109011cc
commit
181b787ce5
5 changed files with 174 additions and 93 deletions
|
|
@ -1,44 +1,14 @@
|
|||
{ lib, ... }: {
|
||||
{ ... }: {
|
||||
home-manager.sharedModules = [
|
||||
(homeArgs: let
|
||||
direnv = lib.getExe homeArgs.config.programs.direnv.package;
|
||||
in {
|
||||
{
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
enableNushellIntegration = false;
|
||||
enableZshIntegration = false;
|
||||
};
|
||||
|
||||
programs.nushell.extraConfig = lib.mkAfter /* nu */ ''
|
||||
$env.config = ($env.config? | default {})
|
||||
$env.config.hooks = ($env.config.hooks? | default {})
|
||||
$env.config.hooks.pre_prompt = (
|
||||
$env.config.hooks.pre_prompt?
|
||||
| default []
|
||||
| append {||
|
||||
${direnv} export json
|
||||
| from json --strict
|
||||
| default {}
|
||||
| items {|key, value|
|
||||
let value = do (
|
||||
{
|
||||
"PATH": {
|
||||
from_string: {|s| $s | split row (char esep) | path expand --no-symlink }
|
||||
to_string: {|v| $v | path expand --no-symlink | str join (char esep) }
|
||||
}
|
||||
}
|
||||
| merge ($env.ENV_CONVERSIONS? | default {})
|
||||
| get -o $key
|
||||
| get -o from_string
|
||||
| if ($in | is-empty) { {|x| $x} } else { $in }
|
||||
) $value
|
||||
return [ $key $value ]
|
||||
}
|
||||
| into record
|
||||
| load-env
|
||||
}
|
||||
)
|
||||
'';
|
||||
})
|
||||
programs.nushell = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue