136 lines
3.6 KiB
Nix
136 lines
3.6 KiB
Nix
{ self, inputs, ... }:
|
|
let
|
|
username = "john";
|
|
in
|
|
{
|
|
flake.modules = {
|
|
nixos.zsh = { pkgs, ... }: {
|
|
users.users."${username}".shell = pkgs.zsh;
|
|
programs.zsh.enable = true;
|
|
# Already being imported by the john.nix module
|
|
# home-manager.sharedModules = [
|
|
# inputs.self.modules.homeManager.zsh
|
|
# ];
|
|
};
|
|
|
|
homeManager.zsh = { pkgs, config, ... }: {
|
|
programs.zsh = {
|
|
enable = true;
|
|
package = pkgs.zsh;
|
|
enableCompletion = true;
|
|
autosuggestion.enable = true;
|
|
# syntaxHighlighting.enable = true;
|
|
initContent = "HOST=$(hostname -s)";
|
|
dotDir = "${config.xdg.configHome}/zsh";
|
|
history = {
|
|
append = true;
|
|
ignoreAllDups = true;
|
|
ignorePatterns = [
|
|
"history"
|
|
"ls"
|
|
"eza"
|
|
"clear"
|
|
];
|
|
save = 1000;
|
|
size = 1000;
|
|
share = true;
|
|
};
|
|
oh-my-zsh = {
|
|
enable = true;
|
|
# theme = "risto";
|
|
theme = "agnoster";
|
|
plugins = [
|
|
"sudo"
|
|
"dotenv"
|
|
"git"
|
|
"ssh"
|
|
"ssh-agent"
|
|
];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
perSystem = { config, self', pkgs, lib, ... }: {
|
|
packages.jsl-zsh =
|
|
let
|
|
ignorePatterns = [
|
|
"ls" "eza" "history" "clear"
|
|
];
|
|
aliasStr = lib.concatStringsSep "\n" (
|
|
lib.mapAttrsToList (k: v: "alias -- ${lib.escapeShellArg k}=${lib.escapeShellArg v}") {
|
|
ls = "eza";
|
|
ll = "eza -l";
|
|
la = "eza -a";
|
|
lt = "eza --tree";
|
|
lla = "eza -la";
|
|
ds = "gdu -i /snap /";
|
|
lzd = "lazydocker";
|
|
});
|
|
in
|
|
(inputs.wrappers.wrapperModules.zsh.apply {
|
|
inherit pkgs;
|
|
binName = "jsl-zsh";
|
|
env = {
|
|
LANG = "en_US.UTF-8";
|
|
COLORTERM = "truecolor";
|
|
};
|
|
settings = {
|
|
completion = {
|
|
enable = true;
|
|
extraCompletions = true;
|
|
caseInsensitive = true;
|
|
fuzzySearch = true;
|
|
};
|
|
autoSuggestions = {
|
|
enable = true;
|
|
strategy = [ "history" "completion" ];
|
|
};
|
|
history = {
|
|
append = true;
|
|
expanded = true;
|
|
share = true;
|
|
ignoreAllDups = true;
|
|
ignoreSpace = true;
|
|
};
|
|
integrations = {
|
|
fzf.enable = true;
|
|
starship = {
|
|
enable = true;
|
|
package = self'.packages.starship;
|
|
};
|
|
zoxide.enable = true;
|
|
};
|
|
};
|
|
extraRC = ''
|
|
HISTFILE=$HOME/.zsh_history
|
|
HISTORY_IGNORE=${lib.escapeShellArg "(${lib.concatStringsSep "|" ignorePatterns})"}
|
|
|
|
HOSTNAME=$(hostname -s)
|
|
|
|
eval "$(direnv hook zsh)"
|
|
|
|
${aliasStr}
|
|
'';
|
|
extraPackages = with pkgs; [
|
|
lazydocker
|
|
self'.packages.shell-tools
|
|
];
|
|
}).wrapper;
|
|
|
|
packages.starship = (inputs.wrappers.wrapperModules.starship.apply {
|
|
inherit pkgs;
|
|
settings = lib.recursiveUpdate (lib.importTOML (pkgs.fetchurl {
|
|
url = https://starship.rs/presets/toml/catppuccin-powerline.toml;
|
|
sha256 = "0bd8zx0bpri63rnb9dva0rav75d3i2wrzw44h63m75hq5220r26g";
|
|
})) {
|
|
palette = "catppuccin_mocha";
|
|
add_newline = true;
|
|
line_break.disabled = false;
|
|
git_status.diverged = "⇕⇡\${ahead_count}⇣\${behind_count}";
|
|
cmd_duration.format = " $duration";
|
|
# python.disabled = true;
|
|
};
|
|
}).wrapper;
|
|
};
|
|
} |