refactor: complete rewrite
This commit is contained in:
parent
19a4bbda3c
commit
8e81943cf9
399 changed files with 3396 additions and 8042 deletions
13
modules/home/console/shell/bash/default.nix
Normal file
13
modules/home/console/shell/bash/default.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
lib,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
inherit (osConfig.ooknet.host) admin;
|
||||
cfg = osConfig.ooknet.console.shell.bash;
|
||||
in {
|
||||
config = mkIf (cfg.enable || admin.shell == "bash") {
|
||||
programs.bash.enable = true;
|
||||
};
|
||||
}
|
||||
7
modules/home/console/shell/default.nix
Normal file
7
modules/home/console/shell/default.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
imports = [
|
||||
./fish
|
||||
./zsh
|
||||
./bash
|
||||
];
|
||||
}
|
||||
24
modules/home/console/shell/fish/aliases.nix
Normal file
24
modules/home/console/shell/fish/aliases.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) getExe;
|
||||
inherit (pkgs) bat eza dust nh;
|
||||
in {
|
||||
programs.fish = {
|
||||
shellAliases = {
|
||||
cat = "${getExe bat}";
|
||||
ls = "${getExe eza} -a --icons --group-directories-first";
|
||||
lst = "${getExe eza} -T -L 5 --icons --group-directories-first";
|
||||
du = "${getExe dust}";
|
||||
gitroot = "cd (git rev-parse --show-toplevel)";
|
||||
};
|
||||
shellAbbrs = {
|
||||
f = "cd $FLAKE";
|
||||
fe = "$EDITOR $FLAKE";
|
||||
|
||||
nswitch = "${getExe nh} os switch";
|
||||
};
|
||||
};
|
||||
}
|
||||
10
modules/home/console/shell/fish/binds.nix
Normal file
10
modules/home/console/shell/fish/binds.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
programs.fish = {
|
||||
functions = {
|
||||
fish_user_key_bindings = ''
|
||||
bind --preset -M insert \cf nvim '+Telescope find_files' $FLAKE
|
||||
bind --preset -M insert \ec fzf_cd_widget
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
66
modules/home/console/shell/fish/default.nix
Normal file
66
modules/home/console/shell/fish/default.nix
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (osConfig.ooknet.host) admin;
|
||||
|
||||
cfg = config.ooknet.home.fish;
|
||||
in {
|
||||
imports = [
|
||||
./plugins.nix
|
||||
./binds.nix
|
||||
./aliases.nix
|
||||
];
|
||||
|
||||
options.ooknet.home.fish.enable = mkEnableOption "";
|
||||
|
||||
config = mkIf (cfg.enable || admin.shell == "fish") {
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
# disable the default greeting
|
||||
functions = {fish_greeting = "";};
|
||||
interactiveShellInit =
|
||||
# Use vim bindings and cursors
|
||||
''
|
||||
fish_vi_key_bindings
|
||||
set fish_cursor_default block blink
|
||||
set fish_cursor_insert line blink
|
||||
set fish_cursor_replace_one underscore blink
|
||||
set fish_cursor_visual block
|
||||
''
|
||||
+
|
||||
# Use terminal colors
|
||||
''
|
||||
set -U fish_color_autosuggestion brblack
|
||||
set -U fish_color_cancel -r
|
||||
set -U fish_color_command brgreen
|
||||
set -U fish_color_comment brmagenta
|
||||
set -U fish_color_cwd green
|
||||
set -U fish_color_cwd_root red
|
||||
set -U fish_color_end brmagenta
|
||||
set -U fish_color_error brred
|
||||
set -U fish_color_escape brcyan
|
||||
set -U fish_color_history_current --bold
|
||||
set -U fish_color_host normal
|
||||
set -U fish_color_match --background=brblue
|
||||
set -U fish_color_normal normal
|
||||
set -U fish_color_operator cyan
|
||||
set -U fish_color_param brblue
|
||||
set -U fish_color_quote yellow
|
||||
set -U fish_color_redirection bryellow
|
||||
set -U fish_color_search_match 'bryellow' '--background=brblack'
|
||||
set -U fish_color_selection 'white' '--bold' '--background=brblack'
|
||||
set -U fish_color_status red
|
||||
set -U fish_color_user brgreen
|
||||
set -U fish_color_valid_path --underline
|
||||
set -U fish_pager_color_completion normal
|
||||
set -U fish_pager_color_description yellow
|
||||
set -U fish_pager_color_prefix 'white' '--bold' '--underline'
|
||||
set -U fish_pager_color_progress 'brwhite' '--background=cyan'
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
18
modules/home/console/shell/fish/plugins.nix
Normal file
18
modules/home/console/shell/fish/plugins.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{pkgs, ...}: {
|
||||
programs.fish = {
|
||||
plugins = [
|
||||
{
|
||||
name = "done";
|
||||
inherit (pkgs.fishPlugins.done) src;
|
||||
}
|
||||
{
|
||||
name = "autopair";
|
||||
inherit (pkgs.fishPlugins.autopair) src;
|
||||
}
|
||||
{
|
||||
name = "colored-man-pages";
|
||||
inherit (pkgs.fishPlugins.colored-man-pages) src;
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
32
modules/home/console/shell/zsh/default.nix
Normal file
32
modules/home/console/shell/zsh/default.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (osConfig.ooknet.host) admin;
|
||||
|
||||
cfg = config.ooknet.home.zsh;
|
||||
in {
|
||||
imports = [
|
||||
./plugins.nix
|
||||
];
|
||||
|
||||
options.ooknet.home.zsh.enable = mkEnableOption "";
|
||||
|
||||
config = mkIf (cfg.enable || admin.shell == "zsh") {
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
autocd = true;
|
||||
enableCompletion = true;
|
||||
autosuggestion.enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
dotDir = ".config/zsh";
|
||||
history = {
|
||||
expireDuplicatesFirst = true;
|
||||
path = "${config.xdg.dataHome}/zsh_history";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
14
modules/home/console/shell/zsh/plugins.nix
Normal file
14
modules/home/console/shell/zsh/plugins.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{pkgs, ...}: {
|
||||
programs.zsh.plugins = [
|
||||
{
|
||||
name = "fast-syntax-highlighting";
|
||||
file = "fast-syntax-highlighting";
|
||||
src = "${pkgs.zsh-fast-syntax-highlighting}/share/zsh/site-functions";
|
||||
}
|
||||
{
|
||||
name = "zsh-autopair";
|
||||
file = "autopair.zsh";
|
||||
src = "${pkgs.zsh-autopair}/share/zsh/zsh-autopair";
|
||||
}
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue