1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-07-31 12:07:48 +00:00

Compare commits

...

2 commits

Author SHA1 Message Date
6178801ec3
nushell: fix environment variables 2025-07-09 19:26:44 +03:00
9cf452debf
nushell: use direnv 2025-07-09 19:17:04 +03:00

View file

@ -1,5 +1,5 @@
{ 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 {
environment = optionalAttrs config.isLinux {
sessionVariables.SHELLS = getExe pkgs.nushell;
@ -103,6 +103,12 @@ in {
};
};
programs.direnv = enabled {
nix-direnv = enabled;
enableNushellIntegration = true;
};
programs.nushell = enabled {
configFile.text = readFile ./config.nu;
envFile.text = readFile ./environment.nu;
@ -125,7 +131,8 @@ in {
# |> map (keyAndValue: nameValuePair (first keyAndValue) (last keyAndValue))
# |> foldl' (x: y: x // y) {};
homeVariablesExtra = {};
in environmentVariables // homeVariables // homeVariablesExtra;
in environmentVariables // homeVariables // homeVariablesExtra
|> mapAttrs (const <| replaceString "$HOME" homeConfig.home.homeDirectory);
shellAliases = removeAttrs config.environment.shellAliases [ "ls" "l" ] // {
cdtmp = "cd (mktemp --directory)";