Add shell aliases and eza program configuration
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
{ pkgs
|
{ pkgs
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
# nix tooling
|
|
||||||
{
|
{
|
||||||
|
home.shellAliases = {
|
||||||
|
sudo = "sudo --preserve-env=PATH";
|
||||||
|
};
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
alejandra
|
|
||||||
deadnix
|
|
||||||
statix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.direnv = {
|
programs.direnv = {
|
||||||
|
|||||||
@@ -1,36 +1,11 @@
|
|||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
let
|
|
||||||
d = config.xdg.dataHome;
|
|
||||||
c = config.xdg.configHome;
|
|
||||||
cache = config.xdg.cacheHome;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./nushell
|
./nushell
|
||||||
./common.nix
|
./common.nix
|
||||||
./starship.nix
|
./starship.nix
|
||||||
./terminals.nix
|
./git.nix
|
||||||
|
./eza.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# add environment variables
|
|
||||||
home.sessionVariables = {
|
|
||||||
# clean up ~
|
|
||||||
LESSHISTFILE = cache + "/less/history";
|
|
||||||
LESSKEY = c + "/less/lesskey";
|
|
||||||
WINEPREFIX = d + "/wine";
|
|
||||||
|
|
||||||
# set default applications
|
|
||||||
EDITOR = "vim";
|
|
||||||
BROWSER = "firefox";
|
|
||||||
TERMINAL = "alacritty";
|
|
||||||
|
|
||||||
# enable scrolling in git diff
|
|
||||||
DELTA_PAGER = "less -R";
|
|
||||||
|
|
||||||
MANPAGER = "sh -c 'col -bx | bat -l man -p'";
|
|
||||||
};
|
|
||||||
|
|
||||||
home.shellAliases = {
|
|
||||||
k = "kubectl";
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
10
home/shell/eza.nix
Normal file
10
home/shell/eza.nix
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{ config
|
||||||
|
, ...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
programs.eza = {
|
||||||
|
enable = true;
|
||||||
|
enableAliases = true;
|
||||||
|
icons = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,12 +1,75 @@
|
|||||||
{ config, ... }: {
|
{ config, lib, ... }: {
|
||||||
home.sessionVariables.STARSHIP_CACHE = "${config.xdg.cacheHome}/starship";
|
|
||||||
|
|
||||||
programs.starship = {
|
programs.starship = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
character = {
|
add_newline = false;
|
||||||
success_symbol = "[›](bold green)";
|
format = lib.concatStrings [
|
||||||
error_symbol = "[›](bold red)";
|
"[](blue)"
|
||||||
|
"[$username:$hostname](bold white bg:blue)"
|
||||||
|
"[](bg:#769ff0 fg:blue)"
|
||||||
|
"$directory"
|
||||||
|
"[](fg:#769ff0 bg:#394260)"
|
||||||
|
"$git_branch"
|
||||||
|
"$git_status"
|
||||||
|
"[](fg:#394260 bg:#212736)"
|
||||||
|
"[](fg:#212736 bg:#1d2230)"
|
||||||
|
"$time"
|
||||||
|
"[ ](fg:#1d2230)"
|
||||||
|
" $character"
|
||||||
|
];
|
||||||
|
command_timeout = 5000;
|
||||||
|
|
||||||
|
# Disable the blank line at the start of the prompt
|
||||||
|
# add_newline = false
|
||||||
|
|
||||||
|
# You can also replace your username with a neat symbol like to save some space
|
||||||
|
username = {
|
||||||
|
show_always = true;
|
||||||
|
format = "$user";
|
||||||
|
};
|
||||||
|
|
||||||
|
hostname = {
|
||||||
|
ssh_only = false;
|
||||||
|
format = "$hostname";
|
||||||
|
disabled = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
directory = {
|
||||||
|
style = "fg:#e3e5e5 bg:#769ff0";
|
||||||
|
format = "[ $path ]($style)";
|
||||||
|
truncation_length = 3;
|
||||||
|
truncation_symbol = "…/";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Here is how you can shorten some long paths by text replacement
|
||||||
|
# similar to mapped_locations in Oh My Posh:
|
||||||
|
directory.substitutions = {
|
||||||
|
"Documents" = " ";
|
||||||
|
"Downloads" = " ";
|
||||||
|
"Music" = " ";
|
||||||
|
"Pictures" = " ";
|
||||||
|
};
|
||||||
|
# Keep in mind that the order matters. For ezample:
|
||||||
|
# "Important Documents" = " "
|
||||||
|
# will not be replaced, because "Documents" was already substituted before.
|
||||||
|
# So either put "Important Documents" before "Documents" or use the substituted version:
|
||||||
|
# "Important " = " "
|
||||||
|
git_branch = {
|
||||||
|
symbol = "";
|
||||||
|
style = "bg:#4C566A";
|
||||||
|
format = "[ $symbol $branch ]($style)";
|
||||||
|
};
|
||||||
|
git_status = {
|
||||||
|
style = "bg:#394260";
|
||||||
|
format =
|
||||||
|
"[[($all_status$ahead_behind )](fg:#769ff0 bg:#394260)]($style)";
|
||||||
|
};
|
||||||
|
time = {
|
||||||
|
disabled = false;
|
||||||
|
time_format = "%R";
|
||||||
|
style = "bg:#33658A";
|
||||||
|
format = "[ $time ]($style)";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user