1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-07-30 03:27:45 +00:00

nushell: fix environment variables

This commit is contained in:
RGBCube 2025-07-09 19:26:40 +03:00
parent 9cf452debf
commit 6178801ec3
Signed by: RGBCube
SSH key fingerprint: SHA256:CzqbPcfwt+GxFYNnFVCqoN5Itn4YFrshg1TrnACpA5M

View file

@ -1,5 +1,5 @@
{ config, lib, pkgs, ... }: let { config, lib, pkgs, ... }: let
inherit (lib) attrValues enabled filter first foldl' getExe last match mkIf nameValuePair optionalAttrs readFile removeAttrs splitString; inherit (lib) attrValues const enabled getExe mapAttrs mkIf optionalAttrs readFile removeAttrs replaceString;
in { in {
environment = optionalAttrs config.isLinux { environment = optionalAttrs config.isLinux {
sessionVariables.SHELLS = getExe pkgs.nushell; sessionVariables.SHELLS = getExe pkgs.nushell;
@ -131,7 +131,8 @@ in {
# |> map (keyAndValue: nameValuePair (first keyAndValue) (last keyAndValue)) # |> map (keyAndValue: nameValuePair (first keyAndValue) (last keyAndValue))
# |> foldl' (x: y: x // y) {}; # |> foldl' (x: y: x // y) {};
homeVariablesExtra = {}; homeVariablesExtra = {};
in environmentVariables // homeVariables // homeVariablesExtra; in environmentVariables // homeVariables // homeVariablesExtra
|> mapAttrs (const <| replaceString "$HOME" homeConfig.home.homeDirectory);
shellAliases = removeAttrs config.environment.shellAliases [ "ls" "l" ] // { shellAliases = removeAttrs config.environment.shellAliases [ "ls" "l" ] // {
cdtmp = "cd (mktemp --directory)"; cdtmp = "cd (mktemp --directory)";