nixos-config/modules/cli/default.nix

125 lines
2.9 KiB
Nix
Raw Normal View History

2021-08-03 16:11:50 +00:00
{ config, pkgs, lib, ... }:
2020-09-18 13:54:09 +00:00
{
2021-10-11 17:08:18 +00:00
imports = [ ./powerline.nix ];
sconfig.powerline.enable = lib.mkDefault true;
2020-09-24 05:45:48 +00:00
environment.systemPackages = with pkgs; [
2021-08-23 04:57:12 +00:00
darkhttpd
2021-07-17 23:34:52 +00:00
dnsutils
2021-10-21 20:58:22 +00:00
dstat
2021-07-17 23:34:26 +00:00
du-dust
2020-09-24 05:45:48 +00:00
entr
2021-07-17 23:34:52 +00:00
file
2020-09-24 05:45:48 +00:00
gcc
2021-10-21 20:58:22 +00:00
iftop
2021-08-23 04:57:55 +00:00
inetutils
2021-10-21 20:58:22 +00:00
iotop
2020-10-24 01:50:14 +00:00
jq
2021-07-17 23:34:52 +00:00
lm_sensors
ncdu
2021-04-05 23:08:19 +00:00
nix-index
2021-11-12 19:56:01 +00:00
nix-prefetch-github
2021-05-26 17:03:14 +00:00
nix-top
2021-07-17 23:34:52 +00:00
nixpkgs-fmt
openssl
psmisc
pv
pwgen
python3
rsync
sqlite
tcpdump
tree
unzip
usbutils
wget
whois
zip
2020-09-18 13:54:09 +00:00
(writeShellScriptBin "dirt" "while sleep 1; do grep '^Dirty:' /proc/meminfo ; done")
(writeShellScriptBin "nix-roots" "nix-store --gc --print-roots | grep -v ^/proc/")
2020-09-18 13:54:09 +00:00
2021-08-16 05:01:42 +00:00
(writeShellScriptBin "pip-install" "exec python -m ensurepip --user")
2021-04-30 02:21:47 +00:00
2021-12-22 15:26:22 +00:00
(writeScriptBin "zram-ratio" ''
#!${pkgs.python3}/bin/python
(orig_data_size, compr_data_size, mem_used_total)=list(
map(int,filter(None,open('/sys/block/zram0/mm_stat').read().split(' ')))
)[:3]
print("compression ratio:", orig_data_size/mem_used_total)
'')
2020-09-24 05:45:48 +00:00
(writeScriptBin "zfsram" ''
#!${pkgs.python3}/bin/python
for ln in open('/proc/spl/kstat/zfs/arcstats').readlines():
if ln.startswith('size '):
print(str(int(ln.split(' ')[-1])/(1024*1024*1024))[:5],'GB')
'')
2020-10-01 15:40:28 +00:00
2021-06-28 17:20:20 +00:00
];
2020-09-18 13:54:09 +00:00
2022-01-22 18:35:35 +00:00
environment.variables.HTOPRC = "/dev/null";
2021-11-09 16:34:10 +00:00
programs.htop = {
enable = true;
settings = {
hide_userland_threads = 1;
highlight_base_name = 1;
show_program_path = 0;
2021-11-12 16:04:17 +00:00
tree_sort_direction = -1;
2021-11-09 16:34:10 +00:00
tree_view = 1;
};
};
2021-11-09 16:17:19 +00:00
programs.git = {
enable = true;
config = {
2022-02-10 06:46:28 +00:00
alias.glog = "log --all --decorate --oneline --graph";
alias.logl = "log --oneline -n10";
alias.logo = "log --oneline";
2021-11-09 16:17:19 +00:00
pull.ff = "only";
init.defaultBranch = "main";
};
};
2020-12-20 05:51:18 +00:00
programs.tmux = {
enable = true;
terminal = "screen-256color";
};
2020-09-24 05:45:48 +00:00
programs.bash.interactiveShellInit = ''
stty -ixon
alias p=python3
2021-11-10 01:53:49 +00:00
alias hd='hexdump -C'
2020-12-22 22:10:04 +00:00
alias catc='${pkgs.vimpager-latest}/bin/vimpager --force-passthrough'
alias nix-env="echo nix-env is disabled #"
2022-02-18 16:50:16 +00:00
alias nix-index='nix-index -f="$(nix eval nixpkgs#path)"'
2022-01-06 20:23:55 +00:00
alias nix-what-depends-on='nix-store --query --referrers'
2022-01-20 02:25:05 +00:00
alias day='date "+%Y-%m-%d"'
2020-09-24 05:45:48 +00:00
'';
2021-06-04 14:45:50 +00:00
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
configure = {
2021-08-25 19:23:54 +00:00
packages.sconfig.start = with pkgs.vimPlugins; [
vim-gitgutter
vim-nix
];
2021-06-04 14:45:50 +00:00
customRC = ''
2021-08-25 19:23:54 +00:00
set encoding=utf-8
scriptencoding utf-8
set list nowrap scrolloff=9 updatetime=300 number
highlight GitGutterAdd ctermfg=10
highlight GitGutterChange ctermfg=11
highlight GitGutterDelete ctermfg=9
let g:gitgutter_sign_removed = ''
let g:gitgutter_sign_removed_first_line = ''
let g:gitgutter_sign_modified_removed = '~~'
2021-06-04 14:45:50 +00:00
'';
};
};
2020-09-18 13:54:09 +00:00
}