zsh: move from module to user config
This commit is contained in:
parent
d00df9171b
commit
cbc31f1083
@ -45,9 +45,6 @@
|
||||
repoPath = "ssh://uzu2y5b1@uzu2y5b1.repo.borgbase.com/./repo";
|
||||
};
|
||||
};
|
||||
shell = {
|
||||
zsh.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
system.stateVersion = "22.11";
|
||||
|
@ -33,9 +33,6 @@
|
||||
pass.enable = true;
|
||||
qbittorrent.enable = true;
|
||||
};
|
||||
shell = {
|
||||
zsh.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
system.stateVersion = "22.11";
|
||||
|
@ -43,9 +43,6 @@
|
||||
repoPath = "ssh://b9cjl9hq@b9cjl9hq.repo.borgbase.com/./repo";
|
||||
};
|
||||
};
|
||||
shell = {
|
||||
zsh.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
system.stateVersion = "22.11";
|
||||
|
@ -59,9 +59,6 @@
|
||||
audio.enable = true;
|
||||
};
|
||||
};
|
||||
shell = {
|
||||
zsh.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
system.stateVersion = "22.11";
|
||||
|
@ -185,9 +185,6 @@
|
||||
programs = {
|
||||
gpg.enable = true;
|
||||
};
|
||||
shell = {
|
||||
zsh.enable = true;
|
||||
};
|
||||
services = {
|
||||
borgmatic = {
|
||||
enable = true;
|
||||
|
@ -95,9 +95,6 @@
|
||||
repoPath = "ssh://iqwu22oq@iqwu22oq.repo.borgbase.com/./repo";
|
||||
};
|
||||
};
|
||||
shell = {
|
||||
zsh.enable = true;
|
||||
};
|
||||
system.desktop.gnome.enable = lib.mkForce false;
|
||||
system.desktop.hyprland.enable = true;
|
||||
};
|
||||
|
@ -19,6 +19,5 @@
|
||||
./programs/thunderbird.nix
|
||||
./programs/vscode.nix
|
||||
./programs/zoom.nix
|
||||
./shell/zsh
|
||||
];
|
||||
}
|
||||
|
@ -1,193 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.modules.shell.zsh;
|
||||
in
|
||||
{
|
||||
options.modules.shell.zsh = {
|
||||
enable = lib.mkOption {
|
||||
default = false;
|
||||
example = true;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
users.defaultUserShell = pkgs.zsh;
|
||||
|
||||
home.programs = {
|
||||
zsh = {
|
||||
enable = true;
|
||||
autocd = true;
|
||||
autosuggestion = {
|
||||
enable = true;
|
||||
strategy = [ "completion" ];
|
||||
};
|
||||
defaultKeymap = "viins";
|
||||
dotDir = ".config/zsh";
|
||||
enableCompletion = true;
|
||||
enableVteIntegration = true;
|
||||
|
||||
history = {
|
||||
append = true;
|
||||
extended = true;
|
||||
ignoreAllDups = true;
|
||||
ignoreDups = true;
|
||||
ignoreSpace = true;
|
||||
save = 1000000;
|
||||
size = 1000000;
|
||||
};
|
||||
|
||||
initExtra = ''
|
||||
## Colors
|
||||
autoload -U colors && colors
|
||||
|
||||
## Directories
|
||||
setopt AUTO_PUSHD
|
||||
setopt CDABLE_VARS
|
||||
setopt PUSHD_IGNORE_DUPS
|
||||
setopt PUSHD_SILENT
|
||||
setopt PUSHD_TO_HOME
|
||||
|
||||
## Expansion and globbing
|
||||
setopt EXTENDED_GLOB
|
||||
unsetopt GLOB_DOTS
|
||||
unsetopt NOMATCH
|
||||
|
||||
## History
|
||||
setopt BANG_HIST
|
||||
setopt HIST_VERIFY
|
||||
setopt INC_APPEND_HISTORY_TIME
|
||||
|
||||
## I/O
|
||||
setopt INTERACTIVE_COMMENTS
|
||||
setopt MULTIOS
|
||||
unsetopt CLOBBER
|
||||
|
||||
## Jobs
|
||||
setopt LONG_LIST_JOBS
|
||||
setopt AUTO_RESUME
|
||||
unsetopt BG_NICE
|
||||
unsetopt NOTIFY
|
||||
unsetopt HUP
|
||||
unsetopt CHECK_JOBS
|
||||
|
||||
## Shell emulation
|
||||
setopt APPEND_CREATE
|
||||
|
||||
## Prompt
|
||||
PS1="%B%{$fg[magenta]%}%~%{$reset_color%} $%b "
|
||||
|
||||
## Vi mode
|
||||
export KEYTIMEOUT=1
|
||||
|
||||
## Zsh line editor
|
||||
unsetopt BEEP
|
||||
'';
|
||||
|
||||
initExtraBeforeCompInit = ''
|
||||
setopt HASH_LIST_ALL
|
||||
'';
|
||||
|
||||
localVariables = {
|
||||
# Prevent zsh-vi-mode overriding other keybinds
|
||||
ZVM_INIT_MODE = "sourcing";
|
||||
};
|
||||
|
||||
plugins = with pkgs; [
|
||||
{
|
||||
name = "zsh-vi-mode";
|
||||
src = zsh-vi-mode;
|
||||
file = "share/zsh-vi-mode/zsh-vi-mode.plugin.zsh";
|
||||
}
|
||||
{
|
||||
name = "fast-syntax-highlighting";
|
||||
src = zsh-fast-syntax-highlighting;
|
||||
file = "share/zsh/site-functions/fast-syntax-highlighting.plugin.zsh";
|
||||
}
|
||||
{
|
||||
name = "jq-zsh-plugin";
|
||||
src = jq-zsh-plugin;
|
||||
file = "share/jq-zsh-plugin/jq.plugin.zsh";
|
||||
}
|
||||
{
|
||||
name = "zsh-autopair";
|
||||
src = zsh-autopair;
|
||||
file = "share/zsh/zsh-autopair/autopair.zsh";
|
||||
}
|
||||
{
|
||||
name = "zsh-forgit";
|
||||
src = zsh-forgit;
|
||||
file = "share/zsh/zsh-forgit/forgit.plugin.zsh";
|
||||
}
|
||||
{
|
||||
name = "zsh-fzf-tab";
|
||||
src = zsh-fzf-tab;
|
||||
file = "share/fzf-tab/fzf-tab.plugin.zsh";
|
||||
}
|
||||
];
|
||||
|
||||
sessionVariables = {
|
||||
MODE_INDICATOR = "";
|
||||
MODE_CURSOR_VIINS = "#b77ee0 blinking bar";
|
||||
MODE_CURSOR_REPLACE = "$MODE_CURSOR_VIINS #ff3334";
|
||||
MODE_CURSOR_VICMD = "#b77ee0 block";
|
||||
MODE_CURSOR_SEARCH = "#e7c547 steady underline";
|
||||
MODE_CURSOR_VISUAL = "$MODE_CURSOR_VICMD steady bar";
|
||||
MODE_CURSOR_VLINE = "$MODE_CURSOR_VISUAL #54ced6";
|
||||
ZVM_LINE_INIT_MODE = "i";
|
||||
};
|
||||
|
||||
shellAliases = {
|
||||
# Verbose file operations
|
||||
cp = "cp -iv";
|
||||
mv = "mv -iv";
|
||||
rm = "rm -v";
|
||||
mkdir = "mkdir -v";
|
||||
|
||||
# Colorize commands
|
||||
ls = "ls -h --color=auto --group-directories-first";
|
||||
|
||||
# Abbreviations
|
||||
e = "$EDITOR";
|
||||
f = "$FILE";
|
||||
g = "git";
|
||||
m = "neomutt";
|
||||
n = "$FILE";
|
||||
v = "$EDITOR";
|
||||
};
|
||||
};
|
||||
|
||||
broot.enable = true;
|
||||
|
||||
direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
|
||||
fzf = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
package = pkgs.unstable.fzf;
|
||||
};
|
||||
|
||||
mcfly.enable = true;
|
||||
navi.enable = true;
|
||||
nix-index.enable = true;
|
||||
};
|
||||
|
||||
user.packages = with pkgs; [
|
||||
bat
|
||||
btop
|
||||
fd
|
||||
jq
|
||||
nix-zsh-completions
|
||||
nnn
|
||||
ripgrep
|
||||
];
|
||||
};
|
||||
}
|
41
users/jordan/default.nix
Normal file
41
users/jordan/default.nix
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
self,
|
||||
...
|
||||
}:
|
||||
let
|
||||
name = "jordan";
|
||||
in
|
||||
{
|
||||
age.secrets."passwords/users/jordan".file = "${self.inputs.secrets}/passwords/users/jordan.age";
|
||||
|
||||
users.users.${name} = {
|
||||
description = "Jordan Holt";
|
||||
extraGroups = [
|
||||
"audio"
|
||||
"docker"
|
||||
"lxd"
|
||||
"networkmanager"
|
||||
"wheel"
|
||||
];
|
||||
group = "users";
|
||||
hashedPasswordFile = config.age.secrets."passwords/users/jordan".path;
|
||||
isNormalUser = true;
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILVHTjsyMIV4THNw6yz0OxAxGnC+41gX72UrPqTzR+OS jordan@vimium.com"
|
||||
];
|
||||
shell = pkgs.zsh;
|
||||
uid = 1000;
|
||||
};
|
||||
|
||||
home-manager.users.${name} = {
|
||||
imports = [
|
||||
./shell.nix
|
||||
];
|
||||
|
||||
home = {
|
||||
username = name;
|
||||
};
|
||||
};
|
||||
}
|
176
users/jordan/shell.nix
Normal file
176
users/jordan/shell.nix
Normal file
@ -0,0 +1,176 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
home.programs = {
|
||||
zsh = {
|
||||
enable = true;
|
||||
autocd = true;
|
||||
autosuggestion = {
|
||||
enable = true;
|
||||
strategy = [ "completion" ];
|
||||
};
|
||||
defaultKeymap = "viins";
|
||||
dotDir = ".config/zsh";
|
||||
enableCompletion = true;
|
||||
enableVteIntegration = true;
|
||||
|
||||
history = {
|
||||
append = true;
|
||||
extended = true;
|
||||
ignoreAllDups = true;
|
||||
ignoreDups = true;
|
||||
ignoreSpace = true;
|
||||
save = 1000000;
|
||||
size = 1000000;
|
||||
};
|
||||
|
||||
initExtra = ''
|
||||
## Colors
|
||||
autoload -U colors && colors
|
||||
|
||||
## Directories
|
||||
setopt AUTO_PUSHD
|
||||
setopt CDABLE_VARS
|
||||
setopt PUSHD_IGNORE_DUPS
|
||||
setopt PUSHD_SILENT
|
||||
setopt PUSHD_TO_HOME
|
||||
|
||||
## Expansion and globbing
|
||||
setopt EXTENDED_GLOB
|
||||
unsetopt GLOB_DOTS
|
||||
unsetopt NOMATCH
|
||||
|
||||
## History
|
||||
setopt BANG_HIST
|
||||
setopt HIST_VERIFY
|
||||
setopt INC_APPEND_HISTORY_TIME
|
||||
|
||||
## I/O
|
||||
setopt INTERACTIVE_COMMENTS
|
||||
setopt MULTIOS
|
||||
unsetopt CLOBBER
|
||||
|
||||
## Jobs
|
||||
setopt LONG_LIST_JOBS
|
||||
setopt AUTO_RESUME
|
||||
unsetopt BG_NICE
|
||||
unsetopt NOTIFY
|
||||
unsetopt HUP
|
||||
unsetopt CHECK_JOBS
|
||||
|
||||
## Shell emulation
|
||||
setopt APPEND_CREATE
|
||||
|
||||
## Prompt
|
||||
PS1="%B%{$fg[magenta]%}%~%{$reset_color%} $%b "
|
||||
|
||||
## Vi mode
|
||||
export KEYTIMEOUT=1
|
||||
|
||||
## Zsh line editor
|
||||
unsetopt BEEP
|
||||
'';
|
||||
|
||||
initExtraBeforeCompInit = ''
|
||||
setopt HASH_LIST_ALL
|
||||
'';
|
||||
|
||||
localVariables = {
|
||||
# Prevent zsh-vi-mode overriding other keybinds
|
||||
ZVM_INIT_MODE = "sourcing";
|
||||
};
|
||||
|
||||
plugins = with pkgs; [
|
||||
{
|
||||
name = "zsh-vi-mode";
|
||||
src = zsh-vi-mode;
|
||||
file = "share/zsh-vi-mode/zsh-vi-mode.plugin.zsh";
|
||||
}
|
||||
{
|
||||
name = "fast-syntax-highlighting";
|
||||
src = zsh-fast-syntax-highlighting;
|
||||
file = "share/zsh/site-functions/fast-syntax-highlighting.plugin.zsh";
|
||||
}
|
||||
{
|
||||
name = "jq-zsh-plugin";
|
||||
src = jq-zsh-plugin;
|
||||
file = "share/jq-zsh-plugin/jq.plugin.zsh";
|
||||
}
|
||||
{
|
||||
name = "zsh-autopair";
|
||||
src = zsh-autopair;
|
||||
file = "share/zsh/zsh-autopair/autopair.zsh";
|
||||
}
|
||||
{
|
||||
name = "zsh-forgit";
|
||||
src = zsh-forgit;
|
||||
file = "share/zsh/zsh-forgit/forgit.plugin.zsh";
|
||||
}
|
||||
{
|
||||
name = "zsh-fzf-tab";
|
||||
src = zsh-fzf-tab;
|
||||
file = "share/fzf-tab/fzf-tab.plugin.zsh";
|
||||
}
|
||||
];
|
||||
|
||||
sessionVariables = {
|
||||
MODE_INDICATOR = "";
|
||||
MODE_CURSOR_VIINS = "#b77ee0 blinking bar";
|
||||
MODE_CURSOR_REPLACE = "$MODE_CURSOR_VIINS #ff3334";
|
||||
MODE_CURSOR_VICMD = "#b77ee0 block";
|
||||
MODE_CURSOR_SEARCH = "#e7c547 steady underline";
|
||||
MODE_CURSOR_VISUAL = "$MODE_CURSOR_VICMD steady bar";
|
||||
MODE_CURSOR_VLINE = "$MODE_CURSOR_VISUAL #54ced6";
|
||||
ZVM_LINE_INIT_MODE = "i";
|
||||
};
|
||||
|
||||
shellAliases = {
|
||||
# Verbose file operations
|
||||
cp = "cp -iv";
|
||||
mv = "mv -iv";
|
||||
rm = "rm -v";
|
||||
mkdir = "mkdir -v";
|
||||
|
||||
# Colorize commands
|
||||
ls = "ls -h --color=auto --group-directories-first";
|
||||
|
||||
# Abbreviations
|
||||
e = "$EDITOR";
|
||||
f = "$FILE";
|
||||
g = "git";
|
||||
m = "neomutt";
|
||||
n = "$FILE";
|
||||
v = "$EDITOR";
|
||||
};
|
||||
};
|
||||
broot.enable = true;
|
||||
|
||||
direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
|
||||
fzf = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
package = pkgs.unstable.fzf;
|
||||
};
|
||||
|
||||
mcfly.enable = true;
|
||||
navi.enable = true;
|
||||
nix-index.enable = true;
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
bat
|
||||
btop
|
||||
fd
|
||||
jq
|
||||
nix-zsh-completions
|
||||
nnn
|
||||
ripgrep
|
||||
];
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user