refactor: extract shell setup
This commit is contained in:
parent
f6f01771ab
commit
c2afb2c5d1
18 changed files with 33 additions and 58 deletions
13
shell/bat.nix
Normal file
13
shell/bat.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ theme, ... }:
|
||||
|
||||
let
|
||||
theme_name = "Solarized (${theme})";
|
||||
in
|
||||
{
|
||||
programs = {
|
||||
bat = {
|
||||
enable = true;
|
||||
config.theme = theme_name;
|
||||
};
|
||||
};
|
||||
}
|
8
shell/carapace.nix
Normal file
8
shell/carapace.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{ ... }:
|
||||
{
|
||||
programs.carapace = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
}
|
||||
|
25
shell/default.nix
Normal file
25
shell/default.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
difftastic
|
||||
htop
|
||||
jq
|
||||
unzip
|
||||
xclip
|
||||
];
|
||||
|
||||
imports = [
|
||||
./bat.nix
|
||||
./carapace.nix
|
||||
./direnv.nix
|
||||
./eza.nix
|
||||
./fzf.nix
|
||||
./ripgrep.nix
|
||||
./rsync.nix
|
||||
./shell_aliases.nix
|
||||
./starship.nix
|
||||
./tree.nix
|
||||
./zoxide.nix
|
||||
./zsh.nix
|
||||
];
|
||||
}
|
11
shell/direnv.nix
Normal file
11
shell/direnv.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
programs = {
|
||||
direnv = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
8
shell/eza.nix
Normal file
8
shell/eza.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{ ... }:
|
||||
{
|
||||
programs.eza = {
|
||||
enable = true;
|
||||
git = true;
|
||||
extraOptions = [ "--group-directories-first" ];
|
||||
};
|
||||
}
|
10
shell/fzf.nix
Normal file
10
shell/fzf.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
programs = {
|
||||
fzf = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
};
|
||||
}
|
9
shell/ripgrep.nix
Normal file
9
shell/ripgrep.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
programs = {
|
||||
ripgrep = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
5
shell/rsync.nix
Normal file
5
shell/rsync.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
home.packages = [ pkgs.rsync ];
|
||||
}
|
11
shell/shell_aliases.nix
Normal file
11
shell/shell_aliases.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
home.shellAliases = {
|
||||
g = "git";
|
||||
gg = "git graph";
|
||||
gs = "git status";
|
||||
gd = "git diff";
|
||||
k = "kubectl";
|
||||
};
|
||||
}
|
11
shell/starship.nix
Normal file
11
shell/starship.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ lib, ... }:
|
||||
|
||||
{
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
settings = {
|
||||
format = lib.concatStrings [ "$all" "$directory" "$character" ];
|
||||
hostname.format = "[$ssh_symbol$hostname]($style) ";
|
||||
};
|
||||
};
|
||||
}
|
5
shell/tree.nix
Normal file
5
shell/tree.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
home.packages = [ pkgs.tree ];
|
||||
}
|
9
shell/zoxide.nix
Normal file
9
shell/zoxide.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
programs.zoxide = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
}
|
||||
|
29
shell/zsh.nix
Normal file
29
shell/zsh.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{ theme, ... }:
|
||||
let
|
||||
zsh_autosuggest_highlight_style = if theme == "light" then "fg=180" else "fg=10";
|
||||
in
|
||||
{
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
history.size = 10000;
|
||||
|
||||
autosuggestion = {
|
||||
enable = true;
|
||||
highlight = zsh_autosuggest_highlight_style;
|
||||
};
|
||||
|
||||
syntaxHighlighting = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
initExtra = ''
|
||||
function set_win_title(){
|
||||
local TITLE=$(git config --get remote.origin.url || echo "$PWD")
|
||||
echo -ne "\033]0; $(basename "$TITLE") \007"
|
||||
}
|
||||
|
||||
precmd_functions+=(set_win_title)
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue