This commit is contained in:
iofq 2023-04-23 23:57:06 -05:00
commit 1a5d89af7a
29 changed files with 911 additions and 0 deletions

View file

@ -0,0 +1,34 @@
{ pkgs, ... }:
{
programs.gpg = {
enable = true;
settings = {
personal-cipher-preferences = "AES256 AES192 AES";
personal-digest-preferences = "SHA512 SHA384 SHA256";
personal-compress-preferences = "ZLIB BZIP2 ZIP Uncompressed";
default-preference-list = "SHA512 SHA384 SHA256 AES256 AES192 AES ZLIB BZIP2 ZIP Uncompressed";
cert-digest-algo = "SHA512";
s2k-digest-algo = "SHA512";
s2k-cipher-algo = "AES256";
charset = "utf-8";
fixed-list-mode = true;
no-emit-version = true;
no-greeting = true;
keyid-format = "0xshort";
list-options = "show-uid-validity show-unusable-subkeys";
verify-options = "show-uid-validity";
with-fingerprint = true;
with-key-origin = true;
require-cross-certification = true;
no-symkey-cache = true;
default-recipient-self = true;
};
};
services.gpg-agent = {
enable = true;
pinentryFlavor = "curses";
};
home.packages = with pkgs; [
oath-toolkit
];
}

View file

@ -0,0 +1,84 @@
{ ... }:
{
programs.alacritty = {
enable = true;
settings = {
window = {
title = "alacritty";
dynamic_padding = true;
decorations = "none";
padding = {
x = 16;
y = 16;
};
opacity = 1;
};
font = {
normal = {
family = "Spleen 32x64";
style = "Medium";
};
size = 12;
offset = {
x = 1;
y = 1;
};
};
cursor = {
style = "Block";
unfocused_hollow = true;
};
draw_bold_text_with_bright_colors = true;
colors = {
primary = {
background = "#090410";
foreground = "#bababd";
};
normal = {
black = "#090410";
red = "#b02f30";
green = "#037538";
yellow = "#c59820";
blue = "#2e528c";
magenta = "#764783";
cyan = "#277c8a";
white = "#bababd";
};
bright = {
black = "#95A5A6";
red = "#b02f30";
green = "#00853e";
yellow = "#c59820";
blue = "#2e528c";
magenta = "#764783";
cyan = "#277c8a";
white = "#ECF0F1";
};
vi_mode_cursor = {
text = "CellBackground";
cursor = "#00CC22";
};
};
key_bindings = [
{
key = "Q";
mode = "Vi";
action = "ToggleViMode";
}
{
key = "K";
mode = "~Alt";
mods = "Control|Shift";
action = "ScrollPageUp";
}
{
key = "J";
mode = "~Alt";
mods = "Control|Shift";
action = "ScrollPageDown";
}
];
};
};
}

View file

@ -0,0 +1,7 @@
[
./alacritty
./nvim
./shell
./git
./2fa
]

View file

@ -0,0 +1,8 @@
{ ... }:
{
programs.git= {
enable = true;
userEmail = "cjriddz@protonmail.com";
userName = "iofq";
};
}

View file

@ -0,0 +1,44 @@
{ pkgs, ...}:
{
xdg.configFile.nvim = {
source = ../../../config/nvim;
recursive = true;
};
programs.neovim = {
enable = true;
defaultEditor = true;
vimAlias = true;
vimdiffAlias = true;
extraConfig = ":luafile ~/.config/nvim/lua/init.lua";
plugins = with pkgs.vimPlugins; [
vim-commentary
vim-surround
toggleterm-nvim
targets-vim
indent-blankline-nvim
vim-go
vim-nix
(nvim-treesitter.withPlugins
(
plugins: with plugins; [
tree-sitter-bash
tree-sitter-c
tree-sitter-dockerfile
tree-sitter-go
tree-sitter-javascript
tree-sitter-json
tree-sitter-lua
tree-sitter-nix
tree-sitter-php
tree-sitter-python
tree-sitter-yaml
]
)
)
nvim-treesitter-textobjects
leap-nvim
telescope-nvim
];
};
}

View file

@ -0,0 +1,70 @@
{ homeDirectory, pkgs, ...}:
{
imports = [
(import ./tmux.nix)
];
programs.bash = {
enable = true;
enableCompletion = true;
historyControl = [ "ignorespace" ];
historyIgnore = [
"ls"
"cd"
":q"
"exit"
];
shellAliases = {
la = "ls -lahrt --color=auto";
ll = "la";
":q" = "exit";
mpv = "mpv --no-keepaspect-window";
sus = "systemctl suspend";
gitu = "git add . && git commit && git push";
rcp = "rsync -avh --progress";
};
shellOptions = [
"cmdhist"
"globstar"
"dirspell"
"dotglob"
"extglob"
"cdspell"
"histappend"
];
bashrcExtra = ''
export PROMPT_COMMAND="prompt_command;history -a"
export PATH="/usr/local/go/bin:~/go/bin:~/.bin:~/.local/bin:$PATH"
export GPG_2FA="cjriddz@protonmail.com"
export MANPAGER="nvim +Man!"
export EDITOR="nvim"
[[ $- != *i* ]] && return
function exists {
type $1 >/dev/null 2>&1
}
function prompt_command {
GIT_BRANCH=$(git symbolic-ref --short HEAD 2>/dev/null | cut -c 1-10)
[[ $GIT_BRANCH != "" ]] && \
PS1="\[\033[38;5;1m\][\u@\h\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;7m\]\W\[$(tput sgr0)\]\[\033[38;5;1m\]]\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;3m\]($GIT_BRANCH)\[\033[38;5;7m\]\$\[$(tput sgr0)\] " || \
PS1="\[\033[38;5;1m\][\u@\h\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;7m\]\W\[$(tput sgr0)\]\[\033[38;5;1m\]]\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;3m\]\[\033[38;5;7m\]\$\[$(tput sgr0)\] "
}
bind "set completion-ignore-case on"
bind "set completion-map-case on"
bind "set show-all-if-ambiguous on"
bind "set menu-complete-display-prefix on"
bind '"\t":menu-complete'
bind '"\C-k": previous-history'
bind '"\C-j": next-history'
function cd {
cmd="ls"
builtin cd "$@" && $cmd
}
exists "kubectl" && source <(kubectl completion bash)
'';
};
programs.fzf = {
enable = true;
fileWidgetCommand = "command find -L . -mindepth 1 -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' -prune";
};
}

22
modules/programs/shell/tmux.nix Executable file
View file

@ -0,0 +1,22 @@
{ ... }:
{
programs.tmux = {
enable = true;
keyMode = "vi";
mouse = true;
newSession = true;
prefix = "C-a";
escapeTime = 0;
baseIndex = 1;
# vi mode navigation
customPaneNavigationAndResize = true;
extraConfig = ''
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel 'xclip -sel clip -i'
set -g status-right ""
setw -g status-style 'bg=colour0 fg=colour7'
setw -g window-status-current-format '[#P:#W*] '
'';
};
}