Initial Commit

This commit is contained in:
Lorenzo Good 2025-05-16 18:11:06 -05:00
commit d18f18fc29
Signed by: lorenzo
GPG key ID: 7FCD64BD81180ED0
28 changed files with 1415 additions and 0 deletions

105
common/bash.nix Normal file
View file

@ -0,0 +1,105 @@
{lib, ...}: {
programs.bash = {
enable = true;
initExtra = ''
source /etc/profile
export PATH=$PATH:/usr/local/bin:/usr/bin:/bin
'';
};
home = {
sessionVariables = {
EDITOR = "nvim";
GOPATH = "$HOME/tmp/go";
};
shellAliases = {
vi = "nvim";
vim = "nvim";
tl = "tmux list-sessions";
ta = "tmux attach";
rfc_date = "date --rfc-3339='seconds'";
};
};
programs.starship = {
enable = true;
settings = {
format = lib.concatStrings [
"[\\[](green)"
"$username"
"[@](blue)"
"$hostname"
":"
"$directory"
"[$git_branch$git_status](yellow)"
"$nix_shell"
"[\\]\\$](green) "
];
username = {
style_root = "red";
style_user = "green";
format = "[$user]($style)";
show_always = true;
aliases = {
foehammer = "foe";
};
};
hostname = {
ssh_only = false;
ssh_symbol = "!";
trim_at = ".";
style = "green";
format = "[$hostname]($style)[$ssh_symbol](red)";
};
directory = {
truncation_length = 3;
truncate_to_repo = true;
style = "green";
read_only = "(ro)";
read_only_style = "red";
home_symbol = "~";
use_os_path_sep = true;
format = "[$path]($style)[$read_only]($read_only_style)";
};
git_branch = {
symbol = "";
always_show_remote = false;
truncation_symbol = "..";
ignore_branches = [];
truncation_length = 7;
format = "\\(g-$branch";
};
nix_shell = {
format = "[\\($symbol$pure_msg$impure_msg\\)]($style)";
symbol = "n";
style = "blue";
impure_msg = " - \\(impure\\)";
pure_msg = "p";
};
git_status = {
style = "white";
format = "$ahead_behind$conflicted$modified\\)";
ahead = ">";
behind = "<";
diverged = "%";
up_to_date = "";
conflicted = "[!c](red)";
modified = "*";
};
};
enableBashIntegration = true;
};
}

31
common/default.nix Normal file
View file

@ -0,0 +1,31 @@
{
pkgs,
lib,
...
}: let
inherit (lib) mkOption types;
in {
options.home.uid = mkOption {
type = with types; nullOr int;
default = null;
description = ''
The account UID. If the UID is null, a free UID is picked on
activation.
'';
};
config = {
programs.home-manager.enable = true;
home = {
packages = with pkgs; [
wget
curl
htop
doggo
jq
tree
];
};
};
}

9
common/direnv.nix Normal file
View file

@ -0,0 +1,9 @@
{...}: {
programs.direnv = {
enable = true;
enableBashIntegration = true;
nix-direnv.enable = true;
};
}

32
common/git.nix Normal file
View file

@ -0,0 +1,32 @@
{...}: {
programs.git = {
enable = true;
lfs.enable = true;
userName = "foehammer127";
userEmail = "foehammer@disroot.org";
signing = {
key = "A972C2063F4F2554";
signByDefault = true;
};
extraConfig = {
init = {defaultBranch = "main";};
pull = {rebase = true;};
rebase = {verify = false;};
};
# Git aliases to use
aliases = {
c = "commit";
cc = "commit";
co = "checkout";
cb = "checkout -b";
aa = "add -A";
a = "add";
ca = "commit --amend";
l = "log";
lo = "log --oneline";
};
};
}

84
common/gpg/default.nix Normal file
View file

@ -0,0 +1,84 @@
{
config,
lib,
pkgs,
...
}: {
services.gpg-agent = lib.mkIf pkgs.stdenv.isLinux {
enable = true;
enableScDaemon = true;
enableExtraSocket = true;
defaultCacheTtl = 34560000;
maxCacheTtl = 34560000;
pinentryPackage = pkgs.pinentry.tty;
enableSshSupport = true;
extraConfig = ''
extra-socket /run/user/${toString config.home.uid}/gnupg/S.gpg-agent.extra
'';
};
programs.gpg = {
enable = true;
scdaemonSettings = {
disable-ccid = true;
};
# Basically Ripped From Yubikey-Guide
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";
no-comments = "";
no-emit-version = "";
no-greeting = "";
keyid-format = "0xlong";
list-options = "show-uid-validity";
with-fingerprint = "";
require-cross-certification = "";
no-symkey-cache = "";
armor = "";
use-agent = "";
throw-keyids = "";
default-key = "A972C2063F4F2554";
trusted-key = "A972C2063F4F2554";
};
publicKeys = [
# Personal Yubikey.
{
source = ./pubkey.txt;
trust = "ultimate";
}
];
mutableTrust = false;
mutableKeys = false;
};
}

23
common/gpg/pubkey.txt Normal file
View file

@ -0,0 +1,23 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: SKS 1.1.6
Comment: Hostname: pgp.mit.edu
mDMEZhmo/hYJKwYBBAHaRw8BAQdA5KtBDUHqW0HmTNZPx8AixJLu0f5Sn9hO9YKp6VP4cPe0
JExvcmVuem8gR29vZCA8Zm9laGFtbWVyQGRpc3Jvb3Qub3JnPoiOBBMWCgA2FiEE2nCZLbIg
Jb/DvyDQqXLCBj9PJVQFAmYZqP4CGwEECwkIBwQVCgkIBRYCAwEAAh4FAheAAAoJEKlywgY/
TyVUJQsBAPt5wWxJjY7aR7i4JW9GeGhXpi9ybRPulRAS+KZDdNuLAP0Sh03lJzV4D+jWG2z8
vtq2iLkJyufs1Pz0VTTQfxAPD7gzBGYZqYcWCSsGAQQB2kcPAQEHQP76alk6Ei6ep4Mxhr9b
dwJkWvd5xr89W2PWWPBTnaEAiO8EGBYKACAWIQTacJktsiAlv8O/INCpcsIGP08lVAUCZhmp
hwIbAgCBCRCpcsIGP08lVHYgBBkWCgAdFiEE3fCObmGYe/Mi43lOf81kvYEYDtAFAmYZqYcA
CgkQf81kvYEYDtCBiQEA9y8tM4pdirGdoHXb6GlHcMG1JfIJf22UbW1KfyFskmUA/2lPJsfC
DNlkciqn7UIfNo4nKgZmr+Y2UcXq7hFjnKsLIAoBAIlUjngd17+kNA4iKs6hUuHc9SO8P4gc
iCAF67OH5uydAQD/Epq+qu59AWgKn+1pFZkvaPrGDONasDHptr2oOZLUBrgzBGYZqZ0WCSsG
AQQB2kcPAQEHQKtCcKS1jN/WSb4Ggvpz11pkUdE4kMgrN0xwptXLgSBXiHgEGBYKACAWIQTa
cJktsiAlv8O/INCpcsIGP08lVAUCZhmpnQIbIAAKCRCpcsIGP08lVLf1AP0VOdfnzaNQFd9m
IjcO0PTzYS8HV2Ku9I5iJQhGozhj1wEAuLT28hEDfkKrmELLu0aTzCZLUMOTnvAulFaTA+zF
VQu4OARmGamREgorBgEEAZdVAQUBAQdA/Zugq1SwUUdLqkkPnDFukfz/fAr7HAoIyooDukW2
HDkDAQgHiHgEGBYKACAWIQTacJktsiAlv8O/INCpcsIGP08lVAUCZhmpkQIbDAAKCRCpcsIG
P08lVPrjAQDbhPJ7BGXwBIWh4cksS+gapFc5JGilL5O4cz5iPJkQKAEAk3yNx9hU6iNlGD21
2Er+ZgBoyJo6eqD6XeBF9vS3dgo=
=nZ4q
-----END PGP PUBLIC KEY BLOCK-----

13
common/k9s/default.nix Normal file
View file

@ -0,0 +1,13 @@
{...}: {
programs.k9s = {
enable = true;
settings = {
skin = "gruvbox-foehammer";
};
skins = {
gruvbox-foehammer = builtins.fromJSON (builtins.readFile ./gruvbox.json);
};
};
}

1
common/k9s/gruvbox.json Normal file
View file

@ -0,0 +1 @@
{"foreground":"#ebdbb2","background":"#282828","current_line":"#ebdbb2","selection":"#3c3735","comment":"#bdad93","cyan":"#689D6A","green":"#98971a","orange":"#FABD2F","magenta":"#b16286","blue":"#83A598","red":"#cc241D","k9s":{"body":{"fgColor":"#ebdbb2","bgColor":"#282828","logoColor":"#83A598"},"prompt":{"fgColor":"#ebdbb2","bgColor":"#282828","suggestColor":"#FABD2F"},"info":{"fgColor":"#b16286","sectionColor":"#ebdbb2"},"help":{"fgColor":"#ebdbb2","bgColor":"#282828","keyColor":"#b16286","numKeyColor":"#83A598","sectionColor":"#98971a"},"dialog":{"fgColor":"#ebdbb2","bgColor":"#282828","buttonFgColor":"#ebdbb2","buttonBgColor":"#b16286","buttonFocusFgColor":"white","buttonFocusBgColor":"#689D6A","labelFgColor":"#FABD2F","fieldFgColor":"#ebdbb2"},"frame":{"border":{"fgColor":"#3c3735","focusColor":"#ebdbb2"},"menu":{"fgColor":"#ebdbb2","keyColor":"#b16286","numKeyColor":"#b16286"},"crumbs":{"fgColor":"#ebdbb2","bgColor":"#bdad93","activeColor":"#83A598"},"status":{"newColor":"#689D6A","modifyColor":"#83A598","addColor":"#98971a","errorColor":"#cc241D","highlightColor":"#FABD2F","killColor":"#bdad93","completedColor":"#bdad93"},"title":{"fgColor":"#ebdbb2","bgColor":"#282828","highlightColor":"#FABD2F","counterColor":"#83A598","filterColor":"#b16286"}},"views":{"charts":{"bgColor":"background","defaultDialColors":["#83A598","#cc241D"],"defaultChartColors":["#83A598","#cc241D"]},"table":{"fgColor":"#ebdbb2","bgColor":"#282828","cursorFgColor":"#ebdbb2","cursorBgColor":"#ebdbb2","header":{"fgColor":"#ebdbb2","bgColor":"#282828","sorterColor":"#3c3735"}},"xray":{"fgColor":"#ebdbb2","bgColor":"#282828","cursorColor":"#ebdbb2","graphicColor":"#83A598","showIcons":false},"yaml":{"keyColor":"#b16286","colonColor":"#83A598","valueColor":"#ebdbb2"},"logs":{"fgColor":"#ebdbb2","bgColor":"#282828","indicator":{"fgColor":"#ebdbb2","bgColor":"#282828","toggleOnColor":"#b16286","toggleOffColor":"#83A598"}}}}}

26
common/tmux/default.nix Normal file
View file

@ -0,0 +1,26 @@
{
config,
lib,
pkgs,
...
}: {
programs.tmux = {
enable = true;
baseIndex = 1;
clock24 = true;
keyMode = "vi";
newSession = true;
resizeAmount = 10;
shortcut = "b";
terminal = "screen-256color";
plugins = with pkgs.tmuxPlugins; [
];
extraConfig = builtins.readFile ./tmux.conf;
customPaneNavigationAndResize = true;
};
}

49
common/tmux/tmux.conf Normal file
View file

@ -0,0 +1,49 @@
set -g status-position top
set -g renumber-windows on
set -g set-clipboard on
## Bindings:
bind -N "Split Horizontally" s split-window -v
bind -N "Split Vertically" v split-window -h
bind -N "Reload Source File" R source-file ~/.config/tmux/tmux.conf
bind -N "Change Session Root Dir" E attach-session -c "#{pane_current_path}"
## COLORSCHEME: gruvbox dark (medium)
set-option -g status "on"
# default statusbar color
set-option -g status-style bg="#282828",fg="#928374" # bg=bg1, fg=fg1
# default window title colors
set-window-option -g window-status-style bg="#282828",fg="#EBDBB2" # bg=yellow, fg=bg1
# default window with an activity alert
set-window-option -g window-status-activity-style bg="#282828",fg="#CC241D" # bg=bg1, fg=fg3
# active window title colors
set-window-option -g window-status-current-style bg="#EBDBB2",fg="#282828" # fg=bg1
# pane border
set-option -g pane-active-border-style fg="#928374" #fg2
set-option -g pane-border-style fg="#928374" #bg1
# message infos
set-option -g message-style bg="#282828",fg="#FABD2F" # bg=bg2, fg=fg1
# writing commands inactive
set-option -g message-command-style bg="#282828",fg="#D3869B" # bg=fg3, fg=bg1
# pane number display
set-option -g display-panes-active-colour colour250 #fg2
set-option -g display-panes-colour colour237 #bg1
# clock
set-window-option -g clock-mode-colour colour109 #blue
# bell
set-window-option -g window-status-bell-style bg=colour167,fg=colour235 # bg=red, fg=bg
set-option -sg escape-time 0
set-option -a terminal-features 'xterm-256-color:RGB'