shell customization
This commit is contained in:
parent
1d2edfb87f
commit
4cf3e09d41
@ -17,11 +17,17 @@
|
|||||||
desktop.gnome.enable = true;
|
desktop.gnome.enable = true;
|
||||||
|
|
||||||
# Shell management
|
# Shell management
|
||||||
|
sh.oh-my-posh.enable = false;
|
||||||
sh.bash = {
|
sh.bash = {
|
||||||
enable = true;
|
enable = true;
|
||||||
oh-my-posh.enable = false;
|
oh-my-posh.enable = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
sh.zsh = {
|
||||||
|
enable = false;
|
||||||
|
oh-my-posh.enable = false;
|
||||||
|
};
|
||||||
|
|
||||||
# Application lists
|
# Application lists
|
||||||
app_list = {
|
app_list = {
|
||||||
hacking.enable = false;
|
hacking.enable = false;
|
||||||
@ -38,7 +44,7 @@
|
|||||||
vscode.enable = false;
|
vscode.enable = false;
|
||||||
git.enable = false;
|
git.enable = false;
|
||||||
neovim.enable = false;
|
neovim.enable = false;
|
||||||
firefox.enable = false;
|
firefox.enable = true;
|
||||||
spotify.enable = false;
|
spotify.enable = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -26,10 +26,29 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
sh.bash = {
|
sh.bash = {
|
||||||
enable = lib.mkDefault true;
|
enable =
|
||||||
oh-my-posh.enable = lib.mkDefault true;
|
if userSettings.shell == "bash"
|
||||||
|
then lib.mkDefault true
|
||||||
|
else lib.mkDefault false;
|
||||||
|
oh-my-posh.enable =
|
||||||
|
if userSettings.shell == "bash"
|
||||||
|
then lib.mkDefault true
|
||||||
|
else lib.mkDefault false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
sh.zsh = {
|
||||||
|
enable =
|
||||||
|
if userSettings.shell == "zsh"
|
||||||
|
then lib.mkDefault true
|
||||||
|
else lib.mkDefault false;
|
||||||
|
oh-my-posh.enable =
|
||||||
|
if userSettings.shell == "zsh"
|
||||||
|
then lib.mkDefault true
|
||||||
|
else lib.mkDefault false;
|
||||||
|
};
|
||||||
|
|
||||||
|
sh.oh-my-posh.enable = lib.mkDefault true;
|
||||||
|
|
||||||
program = {
|
program = {
|
||||||
kitty.enable =
|
kitty.enable =
|
||||||
if userSettings.terminal == "kitty"
|
if userSettings.terminal == "kitty"
|
||||||
|
|||||||
@ -5,13 +5,24 @@
|
|||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
options = {
|
options = {
|
||||||
sh.bash.oh-my-posh.enable = lib.mkEnableOption "enable oh-my-posh";
|
sh.oh-my-posh.enable = lib.mkEnableOption "enable oh-my-posh";
|
||||||
|
sh.bash.oh-my-posh.enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "enable oh-my-posh for bash";
|
||||||
|
};
|
||||||
|
sh.zsh.oh-my-posh.enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "enable oh-my-posh for zsh";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf config.sh.bash.oh-my-posh.enable {
|
config = lib.mkIf config.sh.oh-my-posh.enable {
|
||||||
programs.oh-my-posh = {
|
programs.oh-my-posh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableBashIntegration = true;
|
enableBashIntegration = if config.sh.bash.enable == true then true else false;
|
||||||
|
enableZshIntegration = if config.sh.zsh.enable == true then true else false;
|
||||||
settings = {
|
settings = {
|
||||||
"$schema" = "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json";
|
"$schema" = "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json";
|
||||||
"blocks" = [
|
"blocks" = [
|
||||||
|
|||||||
@ -5,45 +5,67 @@
|
|||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
options = {
|
options = {
|
||||||
sh.bash.enable =
|
sh.bash.enable = lib.mkEnableOption "enables shell bash";
|
||||||
lib.mkEnableOption "enables shell tools";
|
sh.zsh.enable = lib.mkEnableOption "enables shell zsh";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf config.sh.bash.enable {
|
config = lib.mkMerge [
|
||||||
programs.bash = {
|
(lib.mkIf config.sh.bash.enable {
|
||||||
enable = true;
|
programs.bash = {
|
||||||
enableCompletion = true;
|
enable = true;
|
||||||
|
enableCompletion = true;
|
||||||
|
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
#vim = "nvim";
|
ls = "${pkgs.eza}/bin/eza --icons";
|
||||||
ls = "${pkgs.eza}/bin/eza --icons";
|
ll = "${pkgs.eza}/bin/eza -alh --icons";
|
||||||
ll = "${pkgs.eza}/bin/eza -alh --icons";
|
l = "${pkgs.eza}/bin/eza -lh --icons=auto";
|
||||||
l = "${pkgs.eza}/bin/eza -lh --icons=auto";
|
tree = "${pkgs.eza}/bin/eza --tree --icons";
|
||||||
tree = "${pkgs.eza}/bin/eza --tree --icons";
|
open = "rifle";
|
||||||
open = "rifle";
|
ip = "ip -c";
|
||||||
ip = "ip -c";
|
s = "kitten ssh";
|
||||||
s = "kitten ssh";
|
diff = "diff --color";
|
||||||
diff = "diff --color";
|
respawn = "clear; ${pkgs.pfetch}/bin/pfetch";
|
||||||
respawn = "clear; ${pkgs.pfetch}/bin/pfetch";
|
mkdir = "mkdir -p";
|
||||||
mkdir = "mkdir -p";
|
cat = "${pkgs.bat}/bin/bat --style plain";
|
||||||
cat = "${pkgs.bat}/bin/bat --style plain";
|
rasp = "s foglar@192.168.8.140";
|
||||||
rasp = "s foglar@192.168.8.140";
|
hist = "history | awk '{for (i=2; i<=NF; i++) printf \$i\" \"; print \"\"}' | fzf | wl-copy";
|
||||||
hist = "history | awk '{for (i=2; i<=NF; i++) printf \$i\" \"; print \"\"}' | fzf | wl-copy";
|
cdx = "${pkgs.zoxide}/bin/zoxide query --interactive";
|
||||||
cdx = "${pkgs.zoxide}/bin/zoxide query --interactive";
|
|
||||||
|
|
||||||
#distrobox-enter = "distrobox-enter --root";
|
#distrobox-enter = "distrobox-enter --root";
|
||||||
#distrobox-create = "distrobox-create --root";
|
#distrobox-create = "distrobox-create --root";
|
||||||
#distrobox-list = "distrobox-list --root";
|
#distrobox-list = "distrobox-list --root";
|
||||||
|
};
|
||||||
|
|
||||||
|
bashrcExtra = ''
|
||||||
|
${pkgs.pfetch}/bin/pfetch'';
|
||||||
};
|
};
|
||||||
|
|
||||||
bashrcExtra = ''
|
home.sessionVariables = {
|
||||||
${pkgs.pfetch}/bin/pfetch'';
|
XDG_DATA_HOME = "$HOME/.local/share";
|
||||||
};
|
XDG_PICTURES_DIR = "$HOME/Pictures/Screenshots/";
|
||||||
|
};
|
||||||
|
})
|
||||||
|
(lib.mkIf config.sh.zsh.enable {
|
||||||
|
programs.zsh = {
|
||||||
|
enable = true;
|
||||||
|
enableCompletion = true;
|
||||||
|
autosuggestion.enable = true;
|
||||||
|
syntaxHighlighting.enable = true;
|
||||||
|
|
||||||
home.sessionVariables = {
|
shellAliases = {
|
||||||
FLAKE = "/home/foglar/dotfiles";
|
ls = "${pkgs.eza}/bin/eza --icons";
|
||||||
XDG_DATA_HOME = "$HOME/.local/share";
|
ll = "${pkgs.eza}/bin/eza -alh --icons";
|
||||||
XDG_PICTURES_DIR = "$HOME/Pictures/Screenshots/";
|
l = "${pkgs.eza}/bin/eza -lh --icons=auto";
|
||||||
};
|
tree = "${pkgs.eza}/bin/eza --tree --icons";
|
||||||
};
|
open = "rifle";
|
||||||
|
ip = "ip -c";
|
||||||
|
s = "kitten ssh";
|
||||||
|
diff = "diff --color";
|
||||||
|
respawn = "clear; ${pkgs.pfetch}/bin/pfetch";
|
||||||
|
mkdir = "mkdir -p";
|
||||||
|
cat = "${pkgs.bat}/bin/bat --style plain";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -46,5 +46,14 @@
|
|||||||
"image/jpeg" = "org.gnome.Loupe.desktop";
|
"image/jpeg" = "org.gnome.Loupe.desktop";
|
||||||
"image/png" = "org.gnome.Loupe.desktop";
|
"image/png" = "org.gnome.Loupe.desktop";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
programs.zsh.enable =
|
||||||
|
if userSettings.shell == "zsh"
|
||||||
|
then lib.mkDefault true
|
||||||
|
else lib.mkDefault false;
|
||||||
|
users.defaultUserShell =
|
||||||
|
if userSettings.shell == "zsh"
|
||||||
|
then pkgs.zsh
|
||||||
|
else pkgs.bash;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user