This commit is contained in:
iofq 2023-12-24 00:33:04 -06:00
parent fe3dde6667
commit d37834a164
30 changed files with 245 additions and 179 deletions

31
home-manager/default.nix Normal file
View file

@ -0,0 +1,31 @@
{ inputs, pkgs, attrs, ...}:
{
"e" = inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {
inherit inputs attrs;
host = {
hostName = "t14";
username = attrs.username;
};
};
modules = [
./t14/home.nix
./home.nix
];
};
"minimal" = inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {
inherit inputs attrs;
host = {
hostName = "e";
username = attrs.username;
};
};
modules = [
./home.nix
];
};
}

12
home-manager/home.nix Executable file
View file

@ -0,0 +1,12 @@
{ inputs, pkgs, ... }:
{
programs.home-manager.enable = true;
nix = {
registry.nixpkgs.flake = inputs.nixpkgs;
};
home = {
stateVersion = "22.11";
};
imports = [ ./shared/programs/min.nix ];
xdg.enable = true;
}

View file

@ -0,0 +1,35 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
twofa
];
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;
enableSshSupport = true;
pinentryFlavor = "tty";
};
}

View file

@ -0,0 +1,10 @@
{ home-manager, config, lib, pkgs, ... }:
{
imports = [
./dev
./nvim
./shell
./2fa
./warrior
];
}

View file

@ -0,0 +1,13 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
ripgrep
k9s
kubectl
python3
p7zip
gnumake
gcc
go
];
}

View file

@ -0,0 +1,6 @@
{ home-manager, config, lib, pkgs, ... }:
{
imports = [
./shell
];
}

View file

@ -0,0 +1,6 @@
{ pkgs, ...}:
{
home.packages = with pkgs; [
full
];
}

View file

@ -0,0 +1,74 @@
{ pkgs, host, ...}:
{
imports = [
./tmux.nix
./git.nix
];
programs.bash = {
enable = true;
enableCompletion = true;
historyControl = [ "ignorespace" ];
historyIgnore = [
":q"
"exit"
];
shellAliases = {
la = "ls -lahrt --color=auto";
ll = "la";
":q" = "exit";
mpv = "mpv --no-keepaspect-window";
sus = "systemctl suspend";
hms = "home-manager switch --flake $NIX_FLAKE#${host.username}";
rbs = "sudo nixos-rebuild switch --flake $NIX_FLAKE#${host.hostName}";
nvim-dev = "nix run ~/dev/nvim.nix";
g = "git";
k = "kubectl";
};
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="mail@10110110.xyz"
export MANPAGER="nvim +Man!"
export EDITOR="nvim"
export _JAVA_AWT_WM_NONREPARENTING=1
export NIX_FLAKE="/home/e/dev/nix"
[[ $- != *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 --color=auto"
builtin cd "$@" && $cmd
}
exists "kubectl" && source <(kubectl completion bash)
'';
};
programs.fzf = {
enable = true;
historyWidgetOptions = ["--height 60% --preview ''"];
fileWidgetCommand = "command find -L . -mindepth 1 -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' -prune";
};
}

View file

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

View file

@ -0,0 +1,26 @@
{ ... }:
{
programs.git= {
enable = true;
userEmail = "cjriddz@protonmail.com";
userName = "iofq";
delta = {
enable = true;
options = {
side-by-side = true;
line-numbers = true;
};
};
extraConfig = {
core.editor = "nvim";
};
aliases = {
a = "add . -p";
s = "status";
f = "fetch";
d = "diff";
cm = "commit -m";
rb = "rebase -i";
};
};
}

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*] '
'';
};
}

View file

@ -0,0 +1,15 @@
{ pkgs, config, ... }:
{
programs.taskwarrior = {
enable = true;
colorTheme = "solarized-dark-256";
};
home.packages = with pkgs; [
timewarrior
];
home.file."${config.xdg.dataHome}/task/hooks/on-modify.timewarrior" = {
source = "${pkgs.timewarrior}/share/doc/timew/ext/on-modify.timewarrior";
executable = true;
};
}

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,9 @@
{pkgs, ... }:
{
home.packages = with pkgs; [
pulseaudio
pulsemixer
alsa-utils
mpv
];
}

View file

@ -0,0 +1,10 @@
{ home-manager, config, lib, pkgs, ... }:
{
imports = [
./librewolf
./alacritty
(import ./sway)
./xdg
./audio
];
}

View file

@ -0,0 +1,4 @@
{ pkgs, ... }:
{
programs.librewolf.enable = true;
}

View file

@ -0,0 +1,249 @@
{ home-manager, config, lib, pkgs, ... }:
{
home.packages = with pkgs; [
wl-clipboard
autotiling-rs
gammastep
sway-contrib.grimshot
];
systemd.user.services.autotiling = {
Install = {
WantedBy = [ "sway-session.target" ];
PartOf = [ "graphical-session.target" ];
};
Service = {
ExecStart = "${pkgs.autotiling-rs}/bin/autotiling-rs";
Restart = "always";
RestartSec = 5;
};
};
services.gammastep = {
enable = true;
dawnTime = "6:00-8:00";
duskTime = "20:00-22:00";
latitude = 43.0;
longitude = -89.0;
temperature.day = 6000;
temperature.night = 3500;
};
wayland.windowManager.sway = {
enable = true;
wrapperFeatures.gtk = true;
config = {
terminal = "alacritty";
focus = {
followMouse = "no";
mouseWarping = "container";
};
fonts = {
names = [
"Spleen 32x64"
];
style = "Medium";
size = 12.0;
};
window = {
border = 1;
};
colors = {
focused = {
border = "#dddddd";
background = "#285577";
childBorder = "#dddddd";
indicator = "#2e9ef4";
text = "#ffffff";
};
};
gaps = {
smartBorders = "on";
};
modifier = "Mod4";
keybindings = let
modifier = config.wayland.windowManager.sway.config.modifier;
in lib.mkOptionDefault {
Prior = "nop";
Next = "nop";
"${modifier}+x" = "kill";
"${modifier}+space" = "exec ${pkgs.dmenu}/bin/dmenu_path | ${pkgs.dmenu}/bin/dmenu | ${pkgs.findutils}/bin/xargs swaymsg exec --";
"${modifier}+bracketleft" = "exec --no-startup-id grimshot --notify save area /tmp/scrot-$(date \"+%Y-%m-%d\"T\"%H:%M:%S\").png";
"${modifier}+bracketright" = "exec --no-startup-id grimshot --notify copy area";
"${modifier}+Shift+Ctrl+l" = "exec loginctl lock-session";
"XF86MonBrightnessDown" = "exec light -U 10";
"XF86MonBrightnessUp" = "exec light -A 10";
"XF86AudioRaiseVolume" = "exec 'pactl set-sink-volume @DEFAULT_SINK@ +1%'";
"XF86AudioLowerVolume" = "exec 'pactl set-sink-volume @DEFAULT_SINK@ -1%'";
"XF86AudioMute" = "exec 'pactl set-sink-mute @DEFAULT_SINK@ toggle'";
"XF86Display" = "exec 'swaymsg \"output eDP-1 toggle\"'";
};
assigns = {
"9" = [
{ class = "discord";}
{ class = "Signal";}
];
};
bars = [
{
mode = "dock";
position = "top";
statusCommand = "${pkgs.i3status}/bin/i3status";
fonts = {
names = [
"Spleen 32x64"
];
style = "Medium";
size = 12.0;
};
colors = {
statusline = "#666666";
focusedWorkspace = {
background = "#000000";
border = "#666666";
text = "#666666";
};
inactiveWorkspace = {
background = "#000000";
border = "#000000";
text = "#666666";
};
};
}
];
input = {
"type:keyboard" = {
xkb_options = "caps:super";
repeat_delay = "300";
repeat_rate = "60";
};
"type:touchpad" = {
natural_scroll = "enabled";
accel_profile = "flat";
tap = "enabled";
tap_button_map = "lrm";
dwt = "enabled";
middle_emulation = "enabled";
};
"type:touch" = {
events = "disabled";
};
};
output = {
"*" = {
bg = "#000000 solid_color";
};
};
};
};
programs.i3status = {
enable = true;
general = {
colors = false;
separator = " | ";
output_format = "none";
};
modules = {
"ipv6" = {
enable = false;
};
"disk /" = {
enable = false;
};
"tztime local" = {
settings = {
format = "%m-%d-%y %H:%M ";
};
};
"wireless _first_" = {
settings = {
format_down = "off";
format_up = "%signal";
};
};
"memory" = {
settings = {
format = "%used";
format_degraded = "%used";
threshold_degraded = "1G";
};
};
"battery all" = {
settings = {
format = "%percentage%status %remaining";
status_chr = "+";
status_bat = "";
status_full = "";
};
};
"volume master" = {
position = 3;
settings = {
format = "%volume";
format_muted = "muted";
device = "default";
};
};
"ethernet _first_" = {
enable = false;
};
};
};
programs.swaylock = {
enable = true;
package = pkgs.swaylock-effects;
settings = {
color = "#764783";
daemonize = true;
clock = true;
ignore-empty-password = true;
};
};
services.swayidle = {
enable = true;
events = [
{
event = "before-sleep";
command = "${config.programs.swaylock.package}/bin/swaylock";
}
{
event = "lock";
command = "${config.programs.swaylock.package}/bin/swaylock";
}
];
};
services.kanshi = {
enable = true;
profiles = {
nodock = {
outputs = [
{
criteria = "eDP-1";
}
];
};
dock = {
outputs = [
{
criteria = "HDMI-A-1";
status = "enable";
mode = "1920x1080@60Hz";
position = "0,0";
}
];
};
bothdock = {
outputs = [
{
criteria = "eDP-1";
status = "disable";
position = "0,1080";
}
{
criteria = "HDMI-A-1";
status = "enable";
mode = "1920x1080@60Hz";
position = "0,0";
}
];
};
};
};
}

View file

@ -0,0 +1,42 @@
{pkgs, ... }:
{
home.packages = with pkgs; [
xdg-utils
];
xdg.configFile."mimeapps.list".force = true;
xdg.mimeApps = {
enable = true;
defaultApplications = {
"x-scheme-handler/http" = "librewolf.desktop";
"x-scheme-handler/https" = "librewolf.desktop";
"x-scheme-handler/chrome" = "librewolf.desktop";
"video/mp4" = "librewolf.desktop";
"video/mkv" = "librewolf.desktop";
"image/jpeg" = "librewolf.desktop";
"image/jpg" = "librewolf.desktop";
"image/png" = "librewolf.desktop";
"application/epub" = "librewolf.desktop";
"application/pdf" = "librewolf.desktop";
"application/x-extension-htm" = "librewolf.desktop";
"application/x-extension-html" = "librewolf.desktop";
"application/x-extension-shtml" = "librewolf.desktop";
"application/xhtml+xml" = "librewolf.desktop";
"application/x-extension-xhtml" = "librewolf.desktop";
"application/x-extension-xht" = "librewolf.desktop";
"x-scheme-handler/about" = "librewolf.desktop";
"x-scheme-handler/unknown" = "librewolf.desktop";
};
associations.added = {
"x-scheme-handler/http" = "librewolf.desktop";
"x-scheme-handler/https" = "librewolf.desktop";
"x-scheme-handler/chrome" = "librewolf.desktop";
"text/html" = "librewolf.desktop;";
"application/x-extension-htm" = "librewolf.desktop;";
"application/x-extension-html" = "librewolf.desktop;";
"application/x-extension-shtml" = "librewolf.desktop;";
"application/xhtml+xml" = "librewolf.desktop;";
"application/x-extension-xhtml" = "librewolf.desktop;";
"application/x-extension-xht" = "librewolf.desktop;";
};
};
}

35
home-manager/t14/home.nix Executable file
View file

@ -0,0 +1,35 @@
{ pkgs, attrs, ... }:
{
imports = [
../shared/programs/default.nix
../shared/wayland/default.nix
];
home = {
username = attrs.username;
homeDirectory = "/home/" + attrs.username;
packages = with pkgs; [
# gaming
prismlauncher
runelite
jdk17
# comms
signal-desktop
discord
# apps
framesh
chromium
# font
spleen
# sysutils
appimage-run
wireguard-tools
];
};
fonts.fontconfig.enable = true;
systemd.user.startServices = "sd-switch";
}