mirror of
https://github.com/RGBCube/ncc
synced 2025-07-27 18:17:44 +00:00
nushell: use more hm stuff as that is sane now
This commit is contained in:
parent
648f6ec70f
commit
e5df996588
4 changed files with 25 additions and 30 deletions
|
@ -77,7 +77,7 @@ in {
|
|||
|
||||
home-manager.sharedModules = [
|
||||
(homeArgs: let
|
||||
homeConfig = homeArgs.config;
|
||||
config' = homeArgs.config;
|
||||
|
||||
gitUrl = self.best.services.forgejo.settings.server.ROOT_URL;
|
||||
gitDomain = head <| match "https://(.*)/" gitUrl;
|
||||
|
@ -96,8 +96,8 @@ in {
|
|||
'';
|
||||
|
||||
programs.git = enabled {
|
||||
userName = homeConfig.programs.jujutsu.settings.user.name;
|
||||
userEmail = homeConfig.programs.jujutsu.settings.user.email;
|
||||
userName = config'.programs.jujutsu.settings.user.name;
|
||||
userEmail = config'.programs.jujutsu.settings.user.email;
|
||||
|
||||
lfs = enabled;
|
||||
|
||||
|
|
|
@ -18,6 +18,8 @@ $env.config.cursor_shape.emacs = "line"
|
|||
$env.config.cursor_shape.vi_insert = "line"
|
||||
$env.config.cursor_shape.vi_normal = "block"
|
||||
|
||||
$env.CARAPACE_BRIDGES = "inshellisense,carapace,zsh,fish,bash"
|
||||
|
||||
$env.config.completions.algorithm = "substring"
|
||||
$env.config.completions.sort = "smart"
|
||||
$env.config.completions.case_sensitive = false
|
||||
|
@ -536,8 +538,3 @@ def --wrapped jc [...arguments: string@"nu-complete jc"]: [any -> table, any ->
|
|||
$run.stdout | from json
|
||||
}
|
||||
}
|
||||
|
||||
source ~/.config/nushell/zoxide.nu
|
||||
|
||||
$env.CARAPACE_BRIDGES = "inshellisense,carapace,zsh,fish,bash"
|
||||
source ~/.config/nushell/carapace.nu
|
||||
|
|
|
@ -27,48 +27,47 @@ in {
|
|||
fish # For completions.
|
||||
zsh # For completions.
|
||||
inshellisense # For completions.
|
||||
|
||||
zoxide # For better cd.
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
home-manager.sharedModules = [(homeArgs: let
|
||||
homeConfig = homeArgs.config;
|
||||
config' = homeArgs.config;
|
||||
in {
|
||||
xdg.configFile = {
|
||||
"nushell/carapace.nu".source = pkgs.runCommand "carapace.nu" {} ''
|
||||
${getExe pkgs.carapace} _carapace nushell > $out
|
||||
'';
|
||||
|
||||
"nushell/zoxide.nu".source = pkgs.runCommand "zoxide.nu" {} ''
|
||||
${getExe pkgs.zoxide} init nushell --cmd cd > $out
|
||||
'';
|
||||
|
||||
"nushell/ls_colors.txt".source = pkgs.runCommand "ls_colors.txt" {} ''
|
||||
${getExe pkgs.vivid} generate gruvbox-dark-hard > $out
|
||||
'';
|
||||
programs.carapace = enabled {
|
||||
enableNushellIntegration = true;
|
||||
};
|
||||
|
||||
programs.direnv = enabled {
|
||||
nix-direnv = enabled;
|
||||
|
||||
enableNushellIntegration = true;
|
||||
|
||||
nix-direnv = enabled;
|
||||
};
|
||||
|
||||
programs.zoxide = enabled {
|
||||
enableNushellIntegration = true;
|
||||
|
||||
options = [ "--cmd cd" ];
|
||||
};
|
||||
|
||||
programs.nushell = enabled {
|
||||
configFile.text = readFile ./config.nu;
|
||||
envFile.text = readFile ./environment.nu;
|
||||
|
||||
extraConfig = ''
|
||||
$env.LS_COLORS = open ${pkgs.runCommand "ls_colors.txt" {} ''
|
||||
${getExe pkgs.vivid} generate gruvbox-dark-hard > $out
|
||||
''}
|
||||
'';
|
||||
|
||||
environmentVariables = let
|
||||
environmentVariables = config.environment.variables;
|
||||
|
||||
homeVariables = homeConfig.home.sessionVariables;
|
||||
homeVariables = config'.home.sessionVariables;
|
||||
# homeVariablesExtra = pkgs.runCommand "home-variables-extra.env" {} ''
|
||||
# alias export=echo
|
||||
# # echo foo > $out
|
||||
# # FIXME
|
||||
# eval $(cat ${homeConfig.home.sessionVariablesPackage}/etc/profile.d/hm-session-vars.sh) > $out
|
||||
# eval $(cat ${config'.home.sessionVariablesPackage}/etc/profile.d/hm-session-vars.sh) > $out
|
||||
# ''
|
||||
# # |> (aaa: (_: break _) aaa)
|
||||
# |> readFile
|
||||
|
@ -79,7 +78,7 @@ in {
|
|||
# |> foldl' (x: y: x // y) {};
|
||||
homeVariablesExtra = {};
|
||||
in environmentVariables // homeVariables // homeVariablesExtra
|
||||
|> mapAttrs (const <| replaceString "$HOME" homeConfig.home.homeDirectory);
|
||||
|> mapAttrs (const <| replaceString "$HOME" config'.home.homeDirectory);
|
||||
|
||||
shellAliases = removeAttrs config.environment.shellAliases [ "ls" "l" ] // {
|
||||
cdtmp = "cd (mktemp --directory)";
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
# Crickets...
|
Loading…
Add table
Add a link
Reference in a new issue