311 current 1970-01-01 01:00:00 23.11.20240514.9ddcaff 6.1.90 *

This commit is contained in:
Max Känner 2024-05-18 20:00:18 +02:00
parent 2283f4b660
commit bcc917a2da
6 changed files with 186 additions and 118 deletions

View File

@ -10,6 +10,8 @@
sway.enable = true;
sway.laptop = true;
shell.enable = true;
# Home Manager needs a bit of information about you and the paths it should
# manage.
home.username = "max";
@ -57,10 +59,6 @@
prusa-slicer
];
home.sessionVariables = {
EDITOR = "${pkgs.neovim}/bin/nvim";
};
xdg.enable = true;
services.nextcloud-client.enable = true;

View File

@ -1,10 +1,22 @@
{...}: {
programs.bat = {
enable = true;
config = {
map-syntax = ["*.ino:C++"];
theme = "Solarized (dark)";
style = "numbers,changes,header-filename,header-filesize";
{
lib,
config,
...
}: let
cfg = config.shell.bat;
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";
};
};
};
}

View File

@ -1,37 +1,50 @@
{pkgs, ...}: {
programs.btop = {
enable = true;
settings = {
color_theme = "${pkgs.btop}/share/btop/themes/adapta.theme";
theme_background = true;
rounded_corners = true;
graph_symbol = "braille";
shown_boxes = "proc cpu mem net";
update_ms = 1000;
proc_sorting = "cpu lazy";
proc_colors = true;
proc_gradient = true;
proc_per_core = true;
proc_mem_bytes = true;
cpu_graph_upper = "total";
cpu_single_graph = true;
show_uptime = true;
check_temp = true;
cpu_sensor = "Auto";
show_coretemp = true;
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";
{
lib,
config,
pkgs,
...
}: let
cfg = config.shell.btop;
in {
options = {
shell.btop.enable = lib.mkEnableOption "btop, a system monitor";
};
config = lib.mkIf cfg.enable {
programs.btop = {
enable = true;
settings = {
color_theme = "${pkgs.btop}/share/btop/themes/adapta.theme";
theme_background = true;
rounded_corners = true;
graph_symbol = "braille";
shown_boxes = "proc cpu mem net";
update_ms = 1000;
proc_sorting = "cpu lazy";
proc_colors = true;
proc_gradient = true;
proc_per_core = true;
proc_mem_bytes = true;
cpu_graph_upper = "total";
cpu_single_graph = true;
show_uptime = true;
check_temp = true;
cpu_sensor = "Auto";
show_coretemp = true;
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";
};
};
};
}

View File

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

View 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";
};
};
}

View File

@ -1,79 +1,88 @@
{pkgs, ...}: {
programs.zsh = {
enable = true;
enableAutosuggestions = true;
enableCompletion = true;
defaultKeymap = "emacs";
dotDir = ".config/zsh";
history.expireDuplicatesFirst = true;
history.path = "$ZDOTDIR/.zsh_history";
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";
};
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
'';
{
lib,
config,
pkgs,
...
}: let
cfg = config.shell.zsh;
in {
options = {
shell.zsh.enable = lib.mkEnableOption "Zsh, an advanced shell";
};
programs.starship = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
settings = {
add_newline = false;
command_timeout = 5000;
character = {
success_symbol = "[](bold green)";
error_symbol = "[](bold red)";
config = lib.mkIf cfg.enable {
programs.zsh = {
enable = true;
enableAutosuggestions = true;
enableCompletion = true;
defaultKeymap = "emacs";
dotDir = ".config/zsh";
history.expireDuplicatesFirst = true;
history.path = "$ZDOTDIR/.zsh_history";
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 = {
min_time = 500;
show_milliseconds = true;
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 = {
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 = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
options = ["--cmd cd"];
programs.zoxide = {
enable = true;
enableZshIntegration = true;
options = ["--cmd cd"];
};
};
home.packages = with pkgs; [neovim];
}