mirror of
https://codeberg.org/privacy1st/nix-git
synced 2025-01-09 04:51:20 +01:00
zsh and bash config
This commit is contained in:
parent
acc4535638
commit
7de5d49b7b
@ -11,7 +11,6 @@
|
|||||||
../../modules/power-management.nix
|
../../modules/power-management.nix
|
||||||
../../modules/ntfs.nix
|
../../modules/ntfs.nix
|
||||||
#../../modules/ssh-fde-unlock.nix
|
#../../modules/ssh-fde-unlock.nix
|
||||||
../../modules/zsh.nix
|
|
||||||
../../modules/nitrokey-gpg-smartcard.nix
|
../../modules/nitrokey-gpg-smartcard.nix
|
||||||
../../modules/ssh-client.nix
|
../../modules/ssh-client.nix
|
||||||
../../modules/ssh-server.nix
|
../../modules/ssh-server.nix
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
|
|
||||||
../../modules/ssh-fde-unlock.nix
|
../../modules/ssh-fde-unlock.nix
|
||||||
#../../modules/git.nix
|
#../../modules/git.nix
|
||||||
../../modules/zsh.nix
|
|
||||||
#../../modules/ssh-client.nix
|
#../../modules/ssh-client.nix
|
||||||
./ssh-client-root.nix
|
./ssh-client-root.nix
|
||||||
../../modules/ssh-server.nix
|
../../modules/ssh-server.nix
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
|
|
||||||
../../modules/ssh-fde-unlock.nix
|
../../modules/ssh-fde-unlock.nix
|
||||||
#../../modules/git.nix
|
#../../modules/git.nix
|
||||||
../../modules/zsh.nix
|
|
||||||
#../../modules/ssh-client.nix
|
#../../modules/ssh-client.nix
|
||||||
../../modules/ssh-server.nix
|
../../modules/ssh-server.nix
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
../../modules/usb-mtp-ptp.nix
|
../../modules/usb-mtp-ptp.nix
|
||||||
../../modules/ntfs.nix
|
../../modules/ntfs.nix
|
||||||
../../modules/git.nix
|
../../modules/git.nix
|
||||||
../../modules/zsh.nix
|
|
||||||
../../modules/nitrokey-gpg-smartcard.nix
|
../../modules/nitrokey-gpg-smartcard.nix
|
||||||
../../modules/ssh-client.nix
|
../../modules/ssh-client.nix
|
||||||
../../modules/ssh-server.nix
|
../../modules/ssh-server.nix
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
../../modules/tuxedo-rs.nix
|
../../modules/tuxedo-rs.nix
|
||||||
../../modules/ntfs.nix
|
../../modules/ntfs.nix
|
||||||
../../modules/git.nix
|
../../modules/git.nix
|
||||||
../../modules/zsh.nix
|
|
||||||
../../modules/nitrokey-gpg-smartcard.nix
|
../../modules/nitrokey-gpg-smartcard.nix
|
||||||
../../modules/ssh-client.nix
|
../../modules/ssh-client.nix
|
||||||
../../modules/ssh-server.nix
|
../../modules/ssh-server.nix
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
../../modules/headless.nix
|
../../modules/headless.nix
|
||||||
|
|
||||||
../../modules/ssh-fde-unlock.nix
|
../../modules/ssh-fde-unlock.nix
|
||||||
../../modules/zsh.nix
|
|
||||||
../../modules/ssh-server.nix
|
../../modules/ssh-server.nix
|
||||||
../../modules/docker.nix
|
../../modules/docker.nix
|
||||||
|
|
||||||
|
@ -1,10 +1,17 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
# Shell settings
|
||||||
|
#.
|
||||||
|
./bash.nix # bash settings.
|
||||||
|
./zsh.nix # zsh as default shell for yoda and root.
|
||||||
|
./fzf.nix # Fuzzy command history and file search.
|
||||||
|
|
||||||
# DNS settings.
|
# DNS settings.
|
||||||
|
#
|
||||||
# TODO add nix option
|
# TODO add nix option
|
||||||
./dns.nix
|
./dns.nix # Encrypted DNS queries to custom name servers.
|
||||||
#./dns-unencrypted.nix
|
#./dns-unencrypted.nix # Custom name servers.
|
||||||
|
|
||||||
# Nix garbage collection.
|
# Nix garbage collection.
|
||||||
./nix-gc.nix
|
./nix-gc.nix
|
||||||
|
27
modules/bash.nix
Normal file
27
modules/bash.nix
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
let
|
||||||
|
bash-config = {
|
||||||
|
enable = true;
|
||||||
|
enableCompletion = true;
|
||||||
|
historySize = 1000;
|
||||||
|
historyControl = [
|
||||||
|
"erasedups"
|
||||||
|
"ignoredups"
|
||||||
|
"ignorespace"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
# Bash is always enabled, there is no way to disable it ^^
|
||||||
|
#programs.bash.enable = true;
|
||||||
|
|
||||||
|
# Required by home-manager programs.bash.enableCompletion
|
||||||
|
environment.pathsToLink = [ "/share/bash-completion" ];
|
||||||
|
|
||||||
|
home-manager.users.yoda = { osConfig, config, pkgs, ... }: {
|
||||||
|
programs.bash = bash-config;
|
||||||
|
};
|
||||||
|
home-manager.users.root = { osConfig, config, pkgs, ... }: {
|
||||||
|
programs.bash = bash-config;
|
||||||
|
};
|
||||||
|
}
|
37
modules/fzf.nix
Normal file
37
modules/fzf.nix
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
let
|
||||||
|
# Fuzzy shell history and file search.
|
||||||
|
#
|
||||||
|
# Use fzf to search your command history (with STRG + r) and do file searches (with STRG + t).
|
||||||
|
#
|
||||||
|
# Resources:
|
||||||
|
# https://martinheinz.dev/blog/110
|
||||||
|
# https://fryboyter.de/fuzzy-finder-fuer-die-zsh/
|
||||||
|
# https://fryboyter.de/suche-mit-fzf-beschleunigen/
|
||||||
|
#
|
||||||
|
fzf-config = {
|
||||||
|
enable = true;
|
||||||
|
# Replace the default command `find` with faster `fd`.
|
||||||
|
# Why `fd` is better than `ripgrep` in this case: https://www.reddit.com/r/linux4noobs/comments/egb644/fzf_newcomer_fd_or_ripgrep/
|
||||||
|
defaultCommand = "fd --type f";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
home-manager.users.yoda = { osConfig, config, pkgs, ... }: {
|
||||||
|
programs.fzf = fzf-config;
|
||||||
|
};
|
||||||
|
home-manager.users.root = { osConfig, config, pkgs, ... }: {
|
||||||
|
programs.fzf = fzf-config;
|
||||||
|
};
|
||||||
|
|
||||||
|
users.users.yoda = {
|
||||||
|
packages = with pkgs; [
|
||||||
|
fd
|
||||||
|
];
|
||||||
|
};
|
||||||
|
users.users.root = {
|
||||||
|
packages = with pkgs; [
|
||||||
|
fd
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
@ -1,14 +1,36 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
let
|
let
|
||||||
|
# https://nixos.wiki/wiki/Zsh
|
||||||
zsh-config = {
|
zsh-config = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
autosuggestion.enable = true;
|
||||||
|
syntaxHighlighting.enable = true;
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
#ll = "ls -l";
|
#ll = "ls -l";
|
||||||
#update = "sudo nixos-rebuild switch";
|
#update = "sudo nixos-rebuild switch";
|
||||||
};
|
};
|
||||||
history.size = 1000;
|
|
||||||
history.ignoreDups = true;
|
# Keep a detailed history to analyse it later:
|
||||||
#history.ignoreAllDups = true;
|
# https://github.com/bamos/zsh-history-analysis/blob/master/README.md
|
||||||
|
#
|
||||||
|
# View tail of history:
|
||||||
|
# history -i -10
|
||||||
|
#
|
||||||
|
# Keep a long history (for later analysis).
|
||||||
|
history.size = 100000;
|
||||||
|
# Record datetime time of commands (for later analysis).
|
||||||
|
# Instead of just `ls`, this will store e.g. `: 1736166069:0;ls`.
|
||||||
|
history.extended = true;
|
||||||
|
# Do not record an event that was just recorded again.
|
||||||
|
history.ignoreDups = false;
|
||||||
|
# Delete an old recorded event if a new event is a duplicate.
|
||||||
|
history.ignoreAllDups = false;
|
||||||
|
# Do not record if first char is space.
|
||||||
|
history.ignoreSpace = true;
|
||||||
|
# Share between sessions.
|
||||||
|
history.share = true;
|
||||||
|
# Don't record commands if they match the ignore pattern.
|
||||||
|
history.ignorePatterns = [ "history *" ];
|
||||||
|
|
||||||
oh-my-zsh = {
|
oh-my-zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -25,7 +47,7 @@ let
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
# https://nixos.wiki/wiki/Command_Shell
|
# https://nixos.wiki/wiki/Command_Shell
|
||||||
# https://nixos.wiki/wiki/Zsh
|
# When adding a new shell, always enable the shell system-wide, even if it's already enabled in your Home Manager configuration, otherwise it won't source the necessary files.
|
||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
users.defaultUserShell = pkgs.zsh;
|
users.defaultUserShell = pkgs.zsh;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user