mirror of
https://github.com/thegeneralist01/config.git
synced 2026-03-10 02:30:29 +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
|
|
@ -44,7 +44,7 @@
|
||||||
"scanner"
|
"scanner"
|
||||||
"docker"
|
"docker"
|
||||||
];
|
];
|
||||||
shell = pkgs.zsh;
|
shell = pkgs.nushell;
|
||||||
home = "/home/thegeneralist";
|
home = "/home/thegeneralist";
|
||||||
homeMode = "0750";
|
homeMode = "0750";
|
||||||
hashedPasswordFile = config.age.secrets.password.path;
|
hashedPasswordFile = config.age.secrets.password.path;
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,8 @@ in {
|
||||||
vivid
|
vivid
|
||||||
ripgrep
|
ripgrep
|
||||||
yazi
|
yazi
|
||||||
|
lazygit
|
||||||
|
yaziPlugins.lazygit
|
||||||
jq
|
jq
|
||||||
yq-go
|
yq-go
|
||||||
eza
|
eza
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@
|
||||||
environment.shellAliases = {
|
environment.shellAliases = {
|
||||||
todo = /* sh */ ''rg "todo|fixme" --colors match:fg:yellow --colors match:style:bold'';
|
todo = /* sh */ ''rg "todo|fixme" --colors match:fg:yellow --colors match:style:bold'';
|
||||||
todos = /* sh */ "nvim ~/todo.md";
|
todos = /* sh */ "nvim ~/todo.md";
|
||||||
|
bgr = "batgrep";
|
||||||
|
brg = "batgrep";
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.sharedModules = [{
|
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;
|
package = pkgs.nushell;
|
||||||
in {
|
in
|
||||||
home-manager.sharedModules = [(homeArgs: let
|
{
|
||||||
config' = homeArgs.config;
|
home-manager.sharedModules = [
|
||||||
|
(
|
||||||
|
homeArgs:
|
||||||
|
let
|
||||||
|
config' = homeArgs.config;
|
||||||
|
|
||||||
environmentVariables = let
|
environmentVariables =
|
||||||
variablesMap = config'.variablesMap
|
let
|
||||||
|> mapAttrsToList (name: value: [
|
variablesMap =
|
||||||
{ name = "\$${name}"; inherit value; }
|
config'.variablesMap
|
||||||
{ name = "\${${name}}"; inherit value; }
|
|> mapAttrsToList (
|
||||||
])
|
name: value: [
|
||||||
|> flatten
|
{
|
||||||
|> listToAttrs;
|
name = "\$${name}";
|
||||||
in config.environment.variables
|
inherit value;
|
||||||
|> mapAttrs (const <| replaceStrings (attrNames variablesMap) (attrValues variablesMap))
|
}
|
||||||
|> filterAttrs (name: const <| name != "TERM");
|
{
|
||||||
in {
|
name = "\${${name}}";
|
||||||
shells."0" = package;
|
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 = {
|
programs.nushell = {
|
||||||
enable = true;
|
enable = true;
|
||||||
inherit package;
|
inherit package;
|
||||||
|
|
||||||
inherit environmentVariables;
|
inherit environmentVariables;
|
||||||
|
|
||||||
shellAliases = config.environment.shellAliases
|
shellAliases =
|
||||||
|> filterAttrs (_: value: value != null);
|
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
|
{ config, lib, pkgs, ... }: let
|
||||||
inherit (lib) concatStringsSep const flatten getAttr mapAttrsToList mkForce unique;
|
inherit (lib) concatStringsSep const flatten getAttr mapAttrsToList unique;
|
||||||
in {
|
in {
|
||||||
users.defaultUserShell = pkgs.zsh;
|
users.defaultUserShell = pkgs.zsh;
|
||||||
|
|
||||||
|
|
@ -10,8 +10,8 @@ in {
|
||||||
|> unique
|
|> unique
|
||||||
|> concatStringsSep ":";
|
|> concatStringsSep ":";
|
||||||
|
|
||||||
environment.shellAliases = {
|
# environment.shellAliases = {
|
||||||
ls = mkForce null;
|
# ls = mkForce null;
|
||||||
l = mkForce null;
|
# l = mkForce null;
|
||||||
};
|
# };
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue