1
0
mirror of https://github.com/ellmau/nixos.git synced 2025-12-19 09:29:36 +01:00
nixos/modules/zsh.nix
Stefan Ellmauthaler 1e6e85ae2b
Swayfy (#5)
* switch to sway

* Add greetd pam integration, Add waybar base config

* waybar (multiple modules do not behave as documented)
* nm-applet
* systemd-integration due to "normal" call via greetd

configure mako
adding base commands for nm-applet, blueman-applet

* add kanshi

* swayconfig keybindings for special multimedia keys

* waybar base stylefile + basic modules

* Add more portals to wayland/sway and fix fonts

* Add nixosConfiguration-awareness to the homemanager module

* Add alacritty.nix for home-manager configuration

* Add formatter to flake

* Format with alejandra style

* Add apheleia to emacs

* Add local configuration to use alejandra in this flake with emacs
2022-08-22 16:39:47 +02:00

70 lines
2.2 KiB
Nix

{
config,
pkgs,
lib,
...
}:
with lib; {
options.elss.zsh.enable = mkEnableOption "Setup systemwide zsh";
config = let
inherit (elss.withConfig config) mapAllUsers;
cfg = config.elss.zsh;
in
mkIf cfg.enable {
environment = {
shells = [pkgs.zsh];
pathsToLink = ["/share/zsh/"];
sessionVariables = rec {
XDG_CACHE_HOME = "\${HOME}/.cache";
XDG_CONFIG_HOME = "\${HOME}/.config";
XDG_BIN_HOME = "\${HOME}/.local/bin";
XDG_DATA_HOME = "\${HOME}/.local/share";
PATH = [
"\${XDG_BIN_HOME}"
];
};
};
programs = {
zsh = {
enable = true;
enableCompletion = true;
enableGlobalCompInit = true;
autosuggestions.enable = true;
syntaxHighlighting = {
enable = true;
highlighters = ["main" "brackets" "root" "line"];
#styles = { cursor = "standout,underline"; };
};
setOptions = ["auto_pushd" "correct" "nocaseglob" "rcexpandparam" "numericglobsort" "nobeep" "appendhistory"];
shellInit = ''
if [[ $TERM == "dumb" ]]; then
INSIDE_EMACS=1
fi;
'';
interactiveShellInit = ''
source ${pkgs.zsh-nix-shell}/share/zsh-nix-shell/nix-shell.plugin.zsh
zstyle -e ':completion:*:approximate:*' max-errors 'reply=( $(( ($#PREFIX + $#SUFFIX) / 3 )) )'
zstyle ':completion:*:descriptions' format "- %d -"
zstyle ':completion:*:corrections' format "- %d - (errors %e})"
zstyle ':completion:*:default' list-prompt '%S%M matches%s'
zstyle ':completion:*:manuals' separate-sections true
zstyle ':completion:*:manuals.(^1*)' insert-sections true
zstyle ':completion:*' menu select
zstyle ':completion:*' verbose yes
zstyle ':completion:*' squeeze-slashes true
zstyle ':completion:*:*:kill:*' menu yes select
zstyle ':completion:*:kill:*' force-list always
'';
};
};
users.users = mapAllUsers (
_: {shell = pkgs.zsh;}
);
};
}