311 current 1970-01-01 01:00:00 23.11.20240514.9ddcaff 6.1.90 *
This commit is contained in:
parent
2283f4b660
commit
bcc917a2da
@ -10,6 +10,8 @@
|
|||||||
sway.enable = true;
|
sway.enable = true;
|
||||||
sway.laptop = true;
|
sway.laptop = true;
|
||||||
|
|
||||||
|
shell.enable = true;
|
||||||
|
|
||||||
# Home Manager needs a bit of information about you and the paths it should
|
# Home Manager needs a bit of information about you and the paths it should
|
||||||
# manage.
|
# manage.
|
||||||
home.username = "max";
|
home.username = "max";
|
||||||
@ -57,10 +59,6 @@
|
|||||||
prusa-slicer
|
prusa-slicer
|
||||||
];
|
];
|
||||||
|
|
||||||
home.sessionVariables = {
|
|
||||||
EDITOR = "${pkgs.neovim}/bin/nvim";
|
|
||||||
};
|
|
||||||
|
|
||||||
xdg.enable = true;
|
xdg.enable = true;
|
||||||
|
|
||||||
services.nextcloud-client.enable = true;
|
services.nextcloud-client.enable = true;
|
||||||
|
@ -1,10 +1,22 @@
|
|||||||
{...}: {
|
{
|
||||||
programs.bat = {
|
lib,
|
||||||
enable = true;
|
config,
|
||||||
config = {
|
...
|
||||||
map-syntax = ["*.ino:C++"];
|
}: let
|
||||||
theme = "Solarized (dark)";
|
cfg = config.shell.bat;
|
||||||
style = "numbers,changes,header-filename,header-filesize";
|
in {
|
||||||
|
options = {
|
||||||
|
shell.bat.enable = lib.mkEnableOption "bat, a cat replacement with syntax highlighting";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
programs.bat = {
|
||||||
|
enable = true;
|
||||||
|
config = {
|
||||||
|
map-syntax = ["*.ino:C++"];
|
||||||
|
theme = "Solarized (dark)";
|
||||||
|
style = "numbers,changes,header-filename,header-filesize";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,37 +1,50 @@
|
|||||||
{pkgs, ...}: {
|
{
|
||||||
programs.btop = {
|
lib,
|
||||||
enable = true;
|
config,
|
||||||
settings = {
|
pkgs,
|
||||||
color_theme = "${pkgs.btop}/share/btop/themes/adapta.theme";
|
...
|
||||||
theme_background = true;
|
}: let
|
||||||
rounded_corners = true;
|
cfg = config.shell.btop;
|
||||||
graph_symbol = "braille";
|
in {
|
||||||
shown_boxes = "proc cpu mem net";
|
options = {
|
||||||
update_ms = 1000;
|
shell.btop.enable = lib.mkEnableOption "btop, a system monitor";
|
||||||
proc_sorting = "cpu lazy";
|
};
|
||||||
proc_colors = true;
|
|
||||||
proc_gradient = true;
|
config = lib.mkIf cfg.enable {
|
||||||
proc_per_core = true;
|
programs.btop = {
|
||||||
proc_mem_bytes = true;
|
enable = true;
|
||||||
cpu_graph_upper = "total";
|
settings = {
|
||||||
cpu_single_graph = true;
|
color_theme = "${pkgs.btop}/share/btop/themes/adapta.theme";
|
||||||
show_uptime = true;
|
theme_background = true;
|
||||||
check_temp = true;
|
rounded_corners = true;
|
||||||
cpu_sensor = "Auto";
|
graph_symbol = "braille";
|
||||||
show_coretemp = true;
|
shown_boxes = "proc cpu mem net";
|
||||||
temp_scale = "celsius";
|
update_ms = 1000;
|
||||||
base_10_sizes = false;
|
proc_sorting = "cpu lazy";
|
||||||
show_cpu_freq = true;
|
proc_colors = true;
|
||||||
clock_format = "%H:%M";
|
proc_gradient = true;
|
||||||
background_update = true;
|
proc_per_core = true;
|
||||||
mem_graphs = true;
|
proc_mem_bytes = true;
|
||||||
show_swap = true;
|
cpu_graph_upper = "total";
|
||||||
show_io_stat = true;
|
cpu_single_graph = true;
|
||||||
net_download = 128;
|
show_uptime = true;
|
||||||
net_upload = 128;
|
check_temp = true;
|
||||||
net_auto = false;
|
cpu_sensor = "Auto";
|
||||||
show_battery = true;
|
show_coretemp = true;
|
||||||
selected_battery = "Auto";
|
temp_scale = "celsius";
|
||||||
|
base_10_sizes = false;
|
||||||
|
show_cpu_freq = true;
|
||||||
|
clock_format = "%H:%M";
|
||||||
|
background_update = true;
|
||||||
|
mem_graphs = true;
|
||||||
|
show_swap = true;
|
||||||
|
show_io_stat = true;
|
||||||
|
net_download = 128;
|
||||||
|
net_upload = 128;
|
||||||
|
net_auto = false;
|
||||||
|
show_battery = true;
|
||||||
|
selected_battery = "Auto";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,20 @@
|
|||||||
{...}: {
|
{
|
||||||
imports = [./zsh.nix ./bat.nix ./btop.nix];
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
cfg = config.shell;
|
||||||
|
in {
|
||||||
|
imports = [./zsh.nix ./bat.nix ./btop.nix ./neovim.nix];
|
||||||
|
|
||||||
|
options = {
|
||||||
|
shell.enable = lib.mkEnableOption "my shell environment";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
shell.zsh.enable = lib.mkDefault true;
|
||||||
|
shell.neovim.enable = lib.mkDefault true;
|
||||||
|
shell.btop.enable = lib.mkDefault true;
|
||||||
|
shell.bat.enable = lib.mkDefault true;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
19
modules/home/shell/neovim.nix
Normal file
19
modules/home/shell/neovim.nix
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
cfg = config.shell.neovim;
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
shell.neovim.enable = lib.mkEnableOption "neovim";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
home.packages = with pkgs; [neovim];
|
||||||
|
home.sessionVariables = {
|
||||||
|
EDITOR = "${pkgs.neovim}/bin/nvim";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
@ -1,79 +1,88 @@
|
|||||||
{pkgs, ...}: {
|
{
|
||||||
programs.zsh = {
|
lib,
|
||||||
enable = true;
|
config,
|
||||||
enableAutosuggestions = true;
|
pkgs,
|
||||||
enableCompletion = true;
|
...
|
||||||
defaultKeymap = "emacs";
|
}: let
|
||||||
dotDir = ".config/zsh";
|
cfg = config.shell.zsh;
|
||||||
history.expireDuplicatesFirst = true;
|
in {
|
||||||
history.path = "$ZDOTDIR/.zsh_history";
|
options = {
|
||||||
historySubstringSearch.enable = true;
|
shell.zsh.enable = lib.mkEnableOption "Zsh, an advanced shell";
|
||||||
shellAliases = {
|
|
||||||
ls = "${pkgs.eza}/bin/eza --icons -a --group-directories-first";
|
|
||||||
diff = "${pkgs.diffutils}/bin/diff --color=auto";
|
|
||||||
grep = "${pkgs.gnugrep}/bin/grep --color=auto";
|
|
||||||
ip = "${pkgs.iproute2}/bin/ip --color=auto";
|
|
||||||
mkdir = "${pkgs.coreutils}/bin/mkdir -p";
|
|
||||||
gst = "${pkgs.git}/bin/git status";
|
|
||||||
gc = "${pkgs.git}/bin/git commit";
|
|
||||||
ga = "${pkgs.git}/bin/git add";
|
|
||||||
gpl = "${pkgs.git}/bin/git pull";
|
|
||||||
gpu = "${pkgs.git}/bin/git push";
|
|
||||||
gd = "${pkgs.git}/bin/git diff";
|
|
||||||
gch = "${pkgs.git}/bin/git checkout";
|
|
||||||
gs = "${pkgs.git}/bin/git switch";
|
|
||||||
gre = "${pkgs.git}/bin/git restore";
|
|
||||||
gr = "${pkgs.git}/bin/git remote";
|
|
||||||
gcl = "${pkgs.git}/bin/git clone";
|
|
||||||
glg = "${pkgs.git}/bin/git log --graph --abbrev-commit --decorate --format=format:'%C(bold green)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold yellow)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all";
|
|
||||||
gb = "${pkgs.git}/bin/git branch";
|
|
||||||
gm = "${pkgs.git}/bin/git merge";
|
|
||||||
gf = "${pkgs.git}/bin/git fetch";
|
|
||||||
};
|
|
||||||
syntaxHighlighting.enable = true;
|
|
||||||
syntaxHighlighting.highlighters = ["main" "brackets"];
|
|
||||||
initExtra = ''
|
|
||||||
# auto completion
|
|
||||||
bindkey '^I' complete-word
|
|
||||||
bindkey '^[[Z' autosuggest-accept
|
|
||||||
# backspace
|
|
||||||
bindkey '^[[3' delete-char
|
|
||||||
# home / end go to beginning / end of line
|
|
||||||
bindkey '^[[H' beginning-of-line
|
|
||||||
bindkey '^[[F' end-of-line
|
|
||||||
# ctrl+arrow jump word
|
|
||||||
bindkey '^[[1;5D' backward-word
|
|
||||||
bindkey '^[[1;5C' forward-word
|
|
||||||
# ctrl+entf and ctrl+backspace delete word
|
|
||||||
bindkey '^[[3;5~' delete-word
|
|
||||||
bindkey '^H' backward-delete-word
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.starship = {
|
config = lib.mkIf cfg.enable {
|
||||||
enable = true;
|
programs.zsh = {
|
||||||
enableBashIntegration = true;
|
enable = true;
|
||||||
enableZshIntegration = true;
|
enableAutosuggestions = true;
|
||||||
settings = {
|
enableCompletion = true;
|
||||||
add_newline = false;
|
defaultKeymap = "emacs";
|
||||||
command_timeout = 5000;
|
dotDir = ".config/zsh";
|
||||||
character = {
|
history.expireDuplicatesFirst = true;
|
||||||
success_symbol = "[](bold green)";
|
history.path = "$ZDOTDIR/.zsh_history";
|
||||||
error_symbol = "[](bold red)";
|
historySubstringSearch.enable = true;
|
||||||
|
shellAliases = {
|
||||||
|
ls = "${pkgs.eza}/bin/eza --icons -a --group-directories-first";
|
||||||
|
diff = "${pkgs.diffutils}/bin/diff --color=auto";
|
||||||
|
grep = "${pkgs.gnugrep}/bin/grep --color=auto";
|
||||||
|
ip = "${pkgs.iproute2}/bin/ip --color=auto";
|
||||||
|
mkdir = "${pkgs.coreutils}/bin/mkdir -p";
|
||||||
|
gst = "${pkgs.git}/bin/git status";
|
||||||
|
gc = "${pkgs.git}/bin/git commit";
|
||||||
|
ga = "${pkgs.git}/bin/git add";
|
||||||
|
gpl = "${pkgs.git}/bin/git pull";
|
||||||
|
gpu = "${pkgs.git}/bin/git push";
|
||||||
|
gd = "${pkgs.git}/bin/git diff";
|
||||||
|
gch = "${pkgs.git}/bin/git checkout";
|
||||||
|
gs = "${pkgs.git}/bin/git switch";
|
||||||
|
gre = "${pkgs.git}/bin/git restore";
|
||||||
|
gr = "${pkgs.git}/bin/git remote";
|
||||||
|
gcl = "${pkgs.git}/bin/git clone";
|
||||||
|
glg = "${pkgs.git}/bin/git log --graph --abbrev-commit --decorate --format=format:'%C(bold green)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold yellow)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all";
|
||||||
|
gb = "${pkgs.git}/bin/git branch";
|
||||||
|
gm = "${pkgs.git}/bin/git merge";
|
||||||
|
gf = "${pkgs.git}/bin/git fetch";
|
||||||
};
|
};
|
||||||
cmd_duration = {
|
syntaxHighlighting.enable = true;
|
||||||
min_time = 500;
|
syntaxHighlighting.highlighters = ["main" "brackets"];
|
||||||
show_milliseconds = true;
|
initExtra = ''
|
||||||
|
# auto completion
|
||||||
|
bindkey '^I' complete-word
|
||||||
|
bindkey '^[[Z' autosuggest-accept
|
||||||
|
# backspace
|
||||||
|
bindkey '^[[3' delete-char
|
||||||
|
# home / end go to beginning / end of line
|
||||||
|
bindkey '^[[H' beginning-of-line
|
||||||
|
bindkey '^[[F' end-of-line
|
||||||
|
# ctrl+arrow jump word
|
||||||
|
bindkey '^[[1;5D' backward-word
|
||||||
|
bindkey '^[[1;5C' forward-word
|
||||||
|
# ctrl+entf and ctrl+backspace delete word
|
||||||
|
bindkey '^[[3;5~' delete-word
|
||||||
|
bindkey '^H' backward-delete-word
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.starship = {
|
||||||
|
enable = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
settings = {
|
||||||
|
add_newline = false;
|
||||||
|
command_timeout = 5000;
|
||||||
|
character = {
|
||||||
|
success_symbol = "[](bold green)";
|
||||||
|
error_symbol = "[](bold red)";
|
||||||
|
};
|
||||||
|
cmd_duration = {
|
||||||
|
min_time = 500;
|
||||||
|
show_milliseconds = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
programs.zoxide = {
|
programs.zoxide = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableBashIntegration = true;
|
enableZshIntegration = true;
|
||||||
enableZshIntegration = true;
|
options = ["--cmd cd"];
|
||||||
options = ["--cmd cd"];
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
home.packages = with pkgs; [neovim];
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user