Add zsh as an option thank you Jerry 😉

This commit is contained in:
Tyler Kelley 2024-02-09 04:46:04 +00:00
commit 045ad1f07e
5 changed files with 67 additions and 4 deletions

View File

@ -1,7 +1,7 @@
{ config, pkgs, ... }: { config, lib, pkgs, ... }:
let inherit (import ../../options.nix) flakeDir; in let inherit (import ../../options.nix) flakeDir theShell; in
{ lib.mkIf (theShell == "bash") {
# Configure Bash # Configure Bash
programs.bash = { programs.bash = {
enable = true; enable = true;

View File

@ -17,6 +17,7 @@
./swappy.nix ./swappy.nix
./swaylock.nix ./swaylock.nix
./swaync.nix ./swaync.nix
./zsh.nix
# Place Home Files Like Pictures # Place Home Files Like Pictures
./files.nix ./files.nix

59
config/home/zsh.nix Normal file
View File

@ -0,0 +1,59 @@
{ config, lib, pkgs, ... }:
let inherit (import ../../options.nix) flakeDir theShell; in
lib.mkIf (theShell == "zsh") {
programs.zsh = {
enable = true;
syntaxHighlighting.enable = true;
enableAutosuggestions = true;
historySubstringSearch.enable = true;
profileExtra = ''
#if [ -z "$DISPLAY" ] && [ "$XDG_VNTR" = 1 ]; then
# exec Hyprland
#fi
'';
initExtra = ''
zstyle ":completion:*" menu select
zstyle ":completion:*" matcher-list "" "m:{a-z0A-Z}={A-Za-z}" "r:|=*" "l:|=* r:|=*"
if type nproc &>/dev/null; then
export MAKEFLAGS="$MAKEFLAGS -j$(($(nproc)-1))"
fi
bindkey '^[[3~' delete-char # Key Del
bindkey '^[[5~' beginning-of-buffer-or-history # Key Page Up
bindkey '^[[6~' end-of-buffer-or-history # Key Page Down
bindkey '^[[1;3D' backward-word # Key Alt + Left
bindkey '^[[1;3C' forward-word # Key Alt + Right
bindkey '^[[H' beginning-of-line # Key Home
bindkey '^[[F' end-of-line # Key End
neofetch
if [ -f $HOME/.zshrc-personal ]; then
source $HOME/.zshrc-personal
fi
eval "$(starship init zsh)"
'';
initExtraFirst = ''
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt autocd nomatch
unsetopt beep extendedglob notify
autoload -Uz compinit
compinit
'';
sessionVariables = {
};
shellAliases = {
sv="sudo vim";
flake-rebuild="sudo nixos-rebuild switch --flake ${flakeDir}";
flake-update="sudo nix flake update ${flakeDir}";
gcCleanup="nix-collect-garbage --delete-old && sudo nix-collect-garbage -d && sudo /run/current-system/bin/switch-to-configuration boot";
v="nvim";
ls="lsd";
ll="lsd -l";
la="lsd -a";
lal="lsd -al";
".."="cd ..";
};
};
}

View File

@ -24,6 +24,7 @@ in {
theSecondKBDLayout = "pl"; theSecondKBDLayout = "pl";
theLCVariables = "en_US.UTF-8"; theLCVariables = "en_US.UTF-8";
theTimezone = "America/Chicago"; theTimezone = "America/Chicago";
theShell = "bash"; # Possible options: bash, zsh
cpuType = "intel"; cpuType = "intel";
gpuType = "amd"; gpuType = "amd";

View File

@ -4,7 +4,7 @@
let let
inherit (import ./options.nix) inherit (import ./options.nix)
theLocale theTimezone gitUsername theLocale theTimezone gitUsername
wallpaperDir wallpaperGit theShell wallpaperDir wallpaperGit
theLCVariables theKBDLayout; theLCVariables theKBDLayout;
in { in {
imports = imports =
@ -43,6 +43,8 @@ in {
isNormalUser = true; isNormalUser = true;
description = "${gitUsername}"; description = "${gitUsername}";
extraGroups = [ "networkmanager" "wheel" "libvirtd" ]; extraGroups = [ "networkmanager" "wheel" "libvirtd" ];
shell = pkgs.${theShell};
ignoreShellProgramCheck = true;
packages = with pkgs; []; packages = with pkgs; [];
}; };