nix-config/modules/basic-tools/default.nix

134 lines
2.8 KiB
Nix
Raw Normal View History

{ lib, config, pkgs, inputs, ... }:
2022-05-25 19:27:42 +02:00
{
2023-01-22 23:07:29 +01:00
imports = [
./fzf.nix
];
2022-05-25 19:27:42 +02:00
environment.systemPackages = with pkgs; [
bat
fd
file
2022-06-17 13:12:25 +02:00
git
2022-05-25 19:27:42 +02:00
gnupg
htop
irssi
killall
neovim
ripgrep
tealdeer
traceroute
2022-09-27 01:16:19 +02:00
tcpdump
2022-05-25 19:27:42 +02:00
tree
(aspellWithDicts (ps: with ps; [ en en-science en-computers ru de ]))
exfatprogs
nmap
bind
nnn
2023-01-09 18:23:59 +01:00
ranger
2022-05-25 19:27:42 +02:00
man-pages
2022-09-28 21:42:37 +02:00
wlsunset
2022-10-03 13:06:00 +02:00
screen
2022-05-25 19:27:42 +02:00
];
nix = {
extraOptions = ''
experimental-features = nix-command flakes
'';
};
# override default nix shell nixpkgs# behaviour to use current flake lock
nix.registry =
let flakes = lib.filterAttrs (name: value: value ? outputs) inputs.self.inputs;
in builtins.mapAttrs (name: v: { flake = v; }) flakes;
nix.nixPath = lib.mapAttrsToList (name: value: "${name}=${value.outPath}") inputs.self.inputs;
2022-05-25 19:27:42 +02:00
programs.tmux = {
enable = true;
keyMode = "vi";
escapeTime = 0;
historyLimit = 50000;
aggressiveResize = true;
terminal = "tmux-256color";
};
# set appropriate environ variables
environment.variables = {
EDITOR = "nvim";
2023-01-24 11:26:32 +01:00
PAGER = "less";
LESS = "-X -R -F";
2022-05-25 19:27:42 +02:00
};
environment.shellAliases = {
2022-09-27 01:16:19 +02:00
ls = "ls --color=auto";
l = "ls -l";
la = "ls -la";
ll = "ls -lah";
lt = "ls --tree";
2022-05-25 19:27:42 +02:00
vim = "nvim";
2022-06-11 23:28:31 +02:00
mutt = "neomutt";
2022-08-08 19:27:10 +02:00
grep = "grep --color=auto";
2023-01-24 11:26:32 +01:00
nix-build="${pkgs.nix-output-monitor}/bin/nom-build";
nix-shell="${pkgs.nix-output-monitor}/bin/nom-shell";
2022-05-25 19:27:42 +02:00
};
users.defaultUserShell = pkgs.zsh;
programs.zsh = {
enable = true;
enableCompletion = true;
syntaxHighlighting.enable = true;
interactiveShellInit = ''
bindkey -e
export HISTFILE="$HOME/.zsh_history"
export HISTSIZE=10000000
export SAVEHIST=10000000
2023-01-24 15:12:42 +01:00
setopt HIST_IGNORE_ALL_DUPS
2023-01-22 02:18:01 +01:00
# allow comments
setopt interactivecomments
2023-01-24 11:26:32 +01:00
# hacky wrapper for nix, so we can use nom automagically
export _nom_cmd=${pkgs.nix-output-monitor}/bin/nom
function nix {
case $1 in
build|shell|develop)
echo \[SUBSTITUTION\] ''$_nom_cmd ''${@:1} 1>&2
''$_nom_cmd ''${@:1}
;;
*)
${pkgs.nix}/bin/nix $@
esac
}
2022-05-25 19:27:42 +02:00
'';
promptInit = ''
2022-09-28 21:42:37 +02:00
source ${pkgs.liquidprompt}/share/zsh/plugins/liquidprompt/liquidprompt
2022-05-25 19:27:42 +02:00
'';
};
environment.etc.liquidpromptrc = {
text = ''
LP_ENABLE_SSH_COLORS=1
LP_ENABLE_TITLE=1
LP_ENABLE_SCREEN_TITLE=1
2022-09-28 21:42:37 +02:00
LP_ENABLE_TEMP=0
LP_ENABLE_SVN=0
2023-01-14 12:57:53 +01:00
LP_BATTERY_THRESHOLD=15
2022-09-28 21:42:37 +02:00
LP_SSH_COLORS=1
2022-05-25 19:27:42 +02:00
'';
};
2022-06-17 13:12:25 +02:00
2022-05-25 19:27:42 +02:00
programs.iftop.enable = true;
programs.mosh.enable = true;
2022-10-03 13:06:00 +02:00
programs.screen.screenrc = ''
defscrollback 10000
startup_message off
hardstatus on
hardstatus alwayslastline
hardstatus string "%w"
'';
2022-05-25 19:27:42 +02:00
}