mirror of
https://github.com/thegeneralist01/config.git
synced 2026-03-07 10:59:55 +01:00
cli changes
- fix: make nushell central's default shell - fix: ls aliases - add batgrep aliases - add lazygit
This commit is contained in:
parent
6d6c3975f5
commit
462724af45
5 changed files with 72 additions and 33 deletions
|
|
@ -39,6 +39,8 @@ in {
|
|||
vivid
|
||||
ripgrep
|
||||
yazi
|
||||
lazygit
|
||||
yaziPlugins.lazygit
|
||||
jq
|
||||
yq-go
|
||||
eza
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
environment.shellAliases = {
|
||||
todo = /* sh */ ''rg "todo|fixme" --colors match:fg:yellow --colors match:style:bold'';
|
||||
todos = /* sh */ "nvim ~/todo.md";
|
||||
bgr = "batgrep";
|
||||
brg = "batgrep";
|
||||
};
|
||||
|
||||
home-manager.sharedModules = [{
|
||||
|
|
|
|||
|
|
@ -1,35 +1,70 @@
|
|||
{ config, lib, pkgs, ... }: let
|
||||
inherit (lib) attrNames attrValues const filterAttrs flatten listToAttrs mapAttrs mapAttrsToList readFile replaceStrings;
|
||||
{
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
programs.nushell = {
|
||||
enable = true;
|
||||
inherit package;
|
||||
|
||||
inherit environmentVariables;
|
||||
inherit environmentVariables;
|
||||
|
||||
shellAliases = config.environment.shellAliases
|
||||
|> filterAttrs (_: value: value != null);
|
||||
shellAliases =
|
||||
config.environment.shellAliases // { ls = "ls"; };
|
||||
|
||||
configFile.text = readFile ./0_nushell.nu;
|
||||
};
|
||||
})];
|
||||
configFile.text = readFile ./0_nushell.nu;
|
||||
};
|
||||
}
|
||||
)
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{ config, lib, pkgs, ... }: let
|
||||
inherit (lib) concatStringsSep const flatten getAttr mapAttrsToList mkForce unique;
|
||||
inherit (lib) concatStringsSep const flatten getAttr mapAttrsToList unique;
|
||||
in {
|
||||
users.defaultUserShell = pkgs.zsh;
|
||||
|
||||
|
|
@ -10,8 +10,8 @@ in {
|
|||
|> unique
|
||||
|> concatStringsSep ":";
|
||||
|
||||
environment.shellAliases = {
|
||||
ls = mkForce null;
|
||||
l = mkForce null;
|
||||
};
|
||||
# environment.shellAliases = {
|
||||
# ls = mkForce null;
|
||||
# l = mkForce null;
|
||||
# };
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue