mirror of
https://github.com/thegeneralist01/config.git
synced 2026-03-07 10:59:55 +01:00
- fix: make nushell central's default shell - fix: ls aliases - add batgrep aliases - add lazygit
70 lines
1.4 KiB
Nix
70 lines
1.4 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
inherit (lib)
|
|
attrNames
|
|
attrValues
|
|
const
|
|
filterAttrs
|
|
flatten
|
|
listToAttrs
|
|
mapAttrs
|
|
mapAttrsToList
|
|
readFile
|
|
replaceStrings
|
|
;
|
|
|
|
package = pkgs.nushell;
|
|
in
|
|
{
|
|
home-manager.sharedModules = [
|
|
(
|
|
homeArgs:
|
|
let
|
|
config' = homeArgs.config;
|
|
|
|
environmentVariables =
|
|
let
|
|
variablesMap =
|
|
config'.variablesMap
|
|
|> mapAttrsToList (
|
|
name: value: [
|
|
{
|
|
name = "\$${name}";
|
|
inherit value;
|
|
}
|
|
{
|
|
name = "\${${name}}";
|
|
inherit value;
|
|
}
|
|
]
|
|
)
|
|
|> flatten
|
|
|> listToAttrs;
|
|
in
|
|
config.environment.variables
|
|
|> mapAttrs (const <| replaceStrings (attrNames variablesMap) (attrValues variablesMap))
|
|
|> filterAttrs (name: const <| name != "TERM");
|
|
in
|
|
{
|
|
shells."0" = package;
|
|
|
|
programs.nushell = {
|
|
enable = true;
|
|
inherit package;
|
|
|
|
inherit environmentVariables;
|
|
|
|
shellAliases =
|
|
config.environment.shellAliases // { ls = "ls"; };
|
|
|
|
configFile.text = readFile ./0_nushell.nu;
|
|
};
|
|
}
|
|
)
|
|
];
|
|
}
|