1
Fork 0
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:
TheGeneralist 2026-02-15 15:28:54 +01:00
parent 6d6c3975f5
commit 462724af45
Signed by: thegeneralist01
SSH key fingerprint: SHA256:pp9qddbCNmVNoSjevdvQvM5z0DHN7LTa8qBMbcMq/R4
5 changed files with 72 additions and 33 deletions

View file

@ -44,7 +44,7 @@
"scanner"
"docker"
];
shell = pkgs.zsh;
shell = pkgs.nushell;
home = "/home/thegeneralist";
homeMode = "0750";
hashedPasswordFile = config.age.secrets.password.path;

View file

@ -39,6 +39,8 @@ in {
vivid
ripgrep
yazi
lazygit
yaziPlugins.lazygit
jq
yq-go
eza

View file

@ -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 = [{

View file

@ -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;
};
}
)
];
}

View file

@ -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;
# };
}