refactore directory structure

This commit is contained in:
Chris Cochrun 2023-06-09 06:06:37 -05:00
parent 3830eef1f4
commit e87bfb7c39
485 changed files with 66 additions and 1696 deletions

506
home/home.nix Normal file
View file

@ -0,0 +1,506 @@
{ config, lib, pkgs, ... }:
{
imports = [
./modules/hyprland.nix
];
# Home Manager needs a bit of information about you and the
# paths it should manage.
home.username = "chris";
home.homeDirectory = "/home/chris";
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "21.11"; # Did you read the comment?
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
accounts.email = {
accounts = {
personal = {
address = "chris@cochrun.xyz";
userName = "chris@cochrun.xyz";
mbsync.enable = true;
mu.enable = true;
flavor = "plain";
primary = true;
passwordCommand = "${pkgs.rbw}/bin/rbw get 'Office 365'";
realName = "Chris Cochrun";
signature = {
text = ''
Praising God in all things,
Chris Cochrun
'';
delimiter = ''
***
'';
showSignature = "append";
};
imap = {
host = "mail.cochrun.xyz";
port = 993;
tls.enable = true;
};
smtp = {
host = "mail.cochrun.xyz";
port = 25;
tls.enable = true;
};
mbsync = {
create = "maildir";
remove = "both";
expunge = "both";
};
maildir.path = "cochrun";
};
work = {
address = "chris@tfcconnection.org";
userName = "chris@tfcconnection.org";
mbsync.enable = true;
mu.enable = true;
flavor = "outlook.office365.com";
passwordCommand = "${pkgs.rbw}/bin/rbw get --full 'Office 365' | ${pkgs.ripgrep}/bin/rg 'sylemail' | ${pkgs.gawk}/bin/awk '{print $2}'";
realName = "Chris Cochrun";
imap = {
host = "outlook.office365.com";
port = 993;
tls.enable = true;
};
smtp = {
host = "smtp.office365.com";
port = 587;
tls.enable = true;
};
mbsync = {
create = "maildir";
remove = "both";
expunge = "both";
extraConfig.account = {
AuthMechs = "LOGIN";
};
};
maildir.path = "office";
signature = {
text = ''
Praising God in all things,
Chris Cochrun
'';
delimiter = ''
***
'';
showSignature = "append";
};
};
};
};
programs.git = {
enable = true;
userName = "Chris Cochrun";
userEmail = "chris@cochrun.xyz";
};
home.packages = with pkgs; [
];
programs.mu.enable = true;
programs.mbsync = {
enable = true;
};
programs.msmtp.enable = true;
services.mbsync.enable = true;
programs.obs-studio = {
enable = true;
plugins = [ pkgs.obs-studio-plugins.obs-move-transition ];
};
home.file.".config/mpv" = {
source = ../.config/mpv;
recursive = true;
};
services.nextcloud-client = {
enable = true;
startInBackground = true;
};
services.syncthing.enable = true;
# services.kdeconnect.enable = true;
services.easyeffects.enable = true;
# For matrix clients that don't have e2ee
services.pantalaimon = {
enable = true;
settings = {
Default = {
LogLevel = "Debug";
SSL = true;
};
local-matrix = {
Homeserver = "https://matrix.tfcconnection.org";
ListenAddress = "localhost";
ListenPort = 8008;
SSL = false;
IgnoreVerification = true;
};
};
};
#services.espanso = {
# enable = true;
# settings = {
# toggle_key = "RIGHT_CTRL";
# matches = [
# { # dates
# trigger = ":date";
# replace = "{{mydate}}";
# vars = [{
# name = "mydate";
# type = "date";
# params = {format = "%m/%d/%Y";};
# }];
# }
# { # Shell commands
# trigger = ":shell";
# replace = "{{output}}";
# vars = [{
# name = "output";
# type = "shell";
# params = { cmd = "echo Hello from your shell";};
# }];
# }
# { # simple text
# trigger = ":gml";
# replace = "ccochrun21@gmail.com";
# }
# {
# trigger = ":otl";
# replace = "chris.cochrun@outlook.com";
# }
# {
# trigger = ":tfcml";
# replace = "chris@tfcconnection.org";
# }
# {
# trigger = ":name";
# replace = "Chris Cochrun";
# }
# {
# trigger = ":cn";
# replace = "A Giant Gummy Lizard";
# }
# ];
# };
#};
home.file.".config/rofi" = {
source = ../.config/rofi;
recursive = true;
};
programs.firefox = {
enable = true;
package = pkgs.firefox-wayland.override {
cfg = {
enableTridactylNative = true;
enablePlasmaBrowserIntegration = true;
};
};
profiles.chris = {
name = "default";
path = "nw77o6yc.default";
isDefault = true;
};
};
home.file.".mozilla/native-messaging-hosts".source = "/run/current-system/sw/lib/mozilla/native-messaging-hosts";
home.file.".mozilla/firefox/nw77o6yc.default/chrome" = {
source = ../.config/firefox/chrome;
recursive = true;
};
home.file.".config/tridactyl" = {
source = ../.config/tridactyl;
recursive = true;
};
programs.rbw.enable = true;
home.file.".config/rbw" = {
source = ../.config/rbw;
recursive = true;
};
home.file.".config/fish/config.fish" = {
source = ../.config/fish/config.fish;
};
home.file.".config/fish/functions" = {
source = ../.config/fish/functions;
};
programs.nushell = {
enable = true;
shellAliases = {
# ls = "exa -l";
la = "exa -la";
mpf = "mpv --profile=fast";
mps = "mpv --profile=slow";
ec = "emacsclient -t";
ecc = "emacsclient -c";
# mkdir = "mkdir -p";
nupd = "update-nix";
nupg = "upgrade-nix";
suspend = "systemctl suspend";
sysuse = "systemctl --user";
myip = "curl icanhazip.com";
nixs = "nix search nixpkgs";
ytd = "yt-dlp -o '~/Videos/%(title)s.%(ext)s'";
};
extraConfig = ''
let-env config = {
show_banner: false
}
'';
};
home.file.".config/dunst" = {
source = ../.config/dunst;
};
programs.direnv.enable = true;
programs.direnv.nix-direnv.enable = true;
# programs.qutebrowser.enable = true;
home.file.".config/qutebrowser/config.py" = {
source = ../.config/qutebrowser/config.py;
};
home.file.".config/qutebrowser/bookmarks" = {
source = ../.config/qutebrowser/bookmarks;
};
home.file.".config/qutebrowser/css" = {
source = ../.config/qutebrowser/css;
};
home.file.".config/qutebrowser/quickmarks" = {
source = ../.config/qutebrowser/quickmarks;
};
home.file.".config/qutebrowser/qsettings" = {
source = ../.config/qutebrowser/qsettings;
};
home.file.".config/imv" = {
source = ../.config/imv;
recursive = true;
};
home.file.".config/macchina" = {
source = ../.config/macchina;
recursive = true;
};
#home.file.".config/awesome" = {
# source = ../awesome;
# recursive = true;
#};
home.file.".config/awesome/bling" = {
source = ../.config/awesome/bling;
recursive = true;
};
home.file.".config/awesome/rubato" = {
source = ../.config/awesome/rubato;
recursive = true;
};
home.file.".config/alacritty" = {
source = ../.config/alacritty;
};
home.file.".config/picom.conf" = {
source = ../.config/picom.conf;
};
# home.file.".config/networkmanager-dmenu/config.ini" = {
# source = ../networkmanager-dmenu/config.ini;
# };
home.file."bin" = {
source = ../.config/scripts;
recursive = true;
};
home.shellAliases = {
ls = "exa -l";
la = "exa -la";
mpf = "mpv --profile=fast";
mps = "mpv --profile=slow";
ec = "emacsclient -t";
ecc = "emacsclient -c";
mkdir = "mkdir -pv";
nupd = "update-nix";
nupg = "upgrade-nix";
suspend = "systemctl suspend";
sysuse = "systemctl --user";
myip = "curl icanhazip.com";
nixs = "nix search nixpkgs";
ytd = "yt-dlp -o '~/Videos/%(title)s.%(ext)s'";
};
programs.starship = {
enable = true;
enableBashIntegration = true;
settings = {
format = ''
\[(dimmed gray) $username$hostname$directory\](dimmed gray)
$character
'';
right_format = ''
$git_branch$git_status$rust$nix_shell
'';
scan_timeout = 10;
rust = {
format = "[$symbol($version )]($style)";
};
cmake = {
format = "";
disabled = true;
};
nix_shell = {
format = "[$symbol$state( \($name\))]($style) ";
impure_msg = " ";
pure_msg = " ";
};
hostname = {
format = "@[$ssh_symbol$hostname]($style) > '";
};
git_branch = {
format = "[$symbol$branch(:$remote_branch)]($style) ";
};
git_status = {
format = "[\\[$all_status$ahead_behind\\]]($style) |(dimmed gray) ";
};
};
};
programs.bash = {
enable = true;
bashrcExtra = ''
# export ENV_EFI_CODE_SECURE=/run/libvirt/nix-ovmf/OVMF_CODE.fd ENV_EFI_VARS_SECURE=/run/libvirt/nix-ovmf/OVMF_VARS.fd
source $(blesh-share)/ble.sh
ble-face auto_complete="fg=238"
# export LESS_TERMCAP_mb=$'\e[1;32m'
# export LESS_TERMCAP_md=$'\e[1;32m'
# export LESS_TERMCAP_me=$'\e[0m'
# export LESS_TERMCAP_se=$'\e[0m'
# export LESS_TERMCAP_so=$'\e[01;33m'
# export LESS_TERMCAP_ue=$'\e[0m'
# export LESS_TERMCAP_us=$'\e[1;4;31m'
eval "$(starship init bash)"
'';
};
programs.zsh = {
enable = true;
enableAutosuggestions = true;
enableCompletion = true;
enableSyntaxHighlighting = true;
autocd = true;
dotDir = ".config/zsh";
shellAliases = {
ls = "exa -l";
la = "exa -la";
mpf = "mpv --profile=fast";
mps = "mpv --profile=slow";
ec = "emacsclient -t";
ecc = "emacsclient -c";
mkdir = "mkdir -pv";
nupd = "update-nix";
nupg = "upgrade-nix";
suspend = "systemctl suspend";
sysuse = "systemctl --user";
myip = "curl icanhazip.com";
};
initExtra = ''
macchina
'';
};
xdg.desktopEntries = {
mpv-slow = {
name = "MPV";
genericName = "Play from MPV but at normal speed";
exec = "alacritty -e mpv --profile=slow %U";
terminal = true;
categories = [ "Application" ];
mimeType = [ "audio/ogg" "audio/mpeg" "audio/opus" "audio/x-opus+ogg" "audio/x-wav" ];
};
imv-rifle = {
name = "IMV";
genericName = "Show images in current directory in IMV";
exec = "/home/chris/bin/rifle-imv %U";
terminal = false;
categories = [ "Application" ];
mimeType = [ "image/gif" "image/jpeg" "image/png" "image/heif" ];
};
};
systemd.user.services = {
ydotoold = {
Unit = {
Description = "An auto-input utility for wayland";
Documentation = [ "man:ydotool(1)" "man:ydotoold(8)" ];
};
Service = {
ExecStart = "/run/current-system/sw/bin/ydotoold --socket-path /tmp/ydotools";
};
Install = {
WantedBy = ["default.target"];
};
};
jellyfin-mpv-shim = {
Unit = {
Description = "Play Jellyfin media in mpv";
After = "graphical-session-pre.target";
};
Service = {
ExecStart = "/run/current-system/sw/bin/jellyfin-mpv-shim";
};
Install = {
WantedBy = ["graphical-session.target"];
};
};
nextlcoud-client = {
Unit = {
Description = "Nextcloud Client";
After = [ "graphical-session.target" ];
# PartOf = [ "plasma-workspace.target" ];
};
Service = {
Environment = ["PATH=/etc/profiles/per-user/chris/bin"
"WAYLAND_DISPLAY=wayland-1"];
};
};
};
}

230
home/modules/hyprland.nix Normal file
View file

@ -0,0 +1,230 @@
{ config, lib, pkgs, ... }:
{
home.file.".config/hypr/hyprpaper.conf" = {
source = if builtins.readFile "/etc/hostname" == "syl\n" then /home/chris/.dotfiles/hypr/hyprpaper.conf else /home/chris/.dotfiles/hypr/hyprpaper.conf;
};
home.file.".config/hypr/hyprsome" = {
source = if builtins.readFile "/etc/hostname" == "syl\n" then /home/chris/.dotfiles/hypr/hyprsome else /home/chris/.dotfiles/hypr/hyprsome;
};
home.file.".config/hypr/hyprland.conf" = {
text = ''
monitor=eDP-1,2256x1504@60,0x0,1.5
workspace=eDP-1,1
monitor=HDMI-A-1,preferred,0x0,1
monitor=DP-1,preferred,2680x0,1.5
monitor=DP-2,preferred,1600x0,1
workspace=DP-2,2
workspace=DP-1,1
workspace=HDMI-A-1,3
monitor=DP-2,transform,1
input {
# kb_layout=
# kb_variant=
# kb_model=
# kb_options=
# kb_rules=
repeat_rate=140
repeat_delay=180
natural_scroll=0
sensitivity=0.75
accel_profile=adaptive
follow_mouse=2
touchpad {
natural_scroll=1
clickfinger_behavior=1
}
}
general {
max_fps=60 # deprecated, unused
# main_mod=SUPER
gaps_in=15
gaps_out=20
border_size=0
col.active_border=0x66ee1111
col.inactive_border=0x66333333
#damage_tracking=full # leave it on full unless you hate your GPU and want to make it suffer
layout=master
}
gestures {
workspace_swipe=true
workspace_swipe_fingers=3
}
decoration {
rounding=18
multisample_edges=true
active_opacity=0.97
inactive_opacity=0.75
fullscreen_opacity=1.0
blur=true
blur_new_optimizations=true
blur_size=10 # minimum 1
blur_passes=3 # minimum 1, more passes = more resource intensive.
blur_ignore_opacity=false
# Your blur "amount" is blur_size * blur_passes, but high blur_size (over around 5-ish) will produce artifacts.
# if you want heavy blur, you need to up the blur_passes.
# the more passes, the more you can up the blur_size without noticing artifacts.
drop_shadow=true
shadow_range=15
shadow_offset=5 5
shadow_scale=0.99
shadow_render_power=1
col.shadow = rgba(000000cc)
dim_inactive=true
dim_strength=0.2
}
bezier=snapslide,0.07,0.66,0.04,1.02
animations {
enabled=1
animation=windows,1,2,snapslide
# animation=borders,1,10,default
animation=fadeIn,1,2,snapslide
animation=workspaces,1,2,snapslide
animation=specialWorkspace,1,2,snapslide,slidevert
}
dwindle {
pseudotile=0 # enable pseudotiling on dwindle
}
master {
special_scale_factor=0.8
mfact=0.65
new_is_master=false
new_on_top=false
}
# misc:disable_autoreload = true
misc {
focus_on_activate = true
}
# example window rules
# for windows named/classed as abc and xyz
windowrule=opaque,firefox
windowrule=float,dolphin
windowrule=size 60% 60%,dolphin
${if builtins.readFile "/etc/hostname" == "syl\n" then "# this is a kaladin space" else "windowrule=workspace 1,mpv"}
windowrule=float,mpv
windowrule=size ${if builtins.readFile "/etc/hostname" == "syl\n" then "90% 76%" else "85% 85%"},mpv
windowrule=center,mpv
windowrule=opaque,mpv
# windowrule=pin,mpv
windowrule=float,pulsemixer
windowrule=workspace ${if builtins.readFile "/etc/hostname" == "syl\n" then "2" else "1"},firefox
windowrule=workspace ${if builtins.readFile "/etc/hostname" == "syl\n" then "1" else "2"},emacs
windowrule=float,btop
windowrule=size 70% 70%,btop
windowrule=center,btop
windowrule=float,presenter
windowrule=size 80% 80%,presenter
windowrule=center,presenter
windowrule=workspace ${if builtins.readFile "/etc/hostname" == "syl\n" then "1" else "3"},title:presentation-window
# example binds
bind = SUPER,RETURN,exec,alacritty
bind = SUPER,C,killactive,
bind = SUPERSHIFT,Q,exit,
bind = SUPERSHIFT,D,exec,dolphin
bind = SUPERSHIFT,F,togglefloating,
bindr = SUPER,Super_L,exec,/home/chris/bin/launcher.sh
bindr = ALT,Alt_L,exec,/home/chris/bin/window.sh
bind = SUPER,w,exec,/home/chris/bin/window.sh
bind = SUPER,E,exec,/home/chris/bin/emacslof
bind = SUPER,d,exec,emacsclient -c -e '(dired-jump)'
bind = SUPER,v,exec,emacsclient -e '(chris/dired-open-videos)'
bind = SUPER,B,exec,/home/chris/bin/fflof
bind = SUPER,A,exec,alacritty --class pulsemixer -e pulsemixer
bind = SUPERCTRL,i,exec,alacritty --class btop -e btm
bind = ,Print,exec,screenshot
bind = SUPER,P,exec,/home/chris/bin/rbw.sh
bind = SUPER,M,fullscreen,1
bind = SUPER,F,fullscreen,0
bind = SUPER,h,movefocus,l
bind = SUPER,l,movefocus,r
bind = SUPER,k,layoutmsg,cycleprev
bind = SUPER,j,layoutmsg,cyclenext
bind = SUPERSHIFT,h,movewindow,l
bind = SUPERSHIFT,l,movewindow,r
bind = SUPERSHIFT,k,layoutmsg,swapprev
bind = SUPERSHIFT,j,layoutmsg,swapnext
bind = SUPERCTRL,l,splitratio,+0.05
bind = SUPERCTRL,h,splitratio,-0.05
bind = SUPERCTRL,c,centerwindow
bind = SUPER,1,workspace,1
bind = SUPER,2,workspace,2
bind = SUPER,3,workspace,3
bind = SUPER,4,workspace,4
bind = SUPER,5,workspace,5
bind = SUPER,6,workspace,6
bind = SUPER,7,workspace,7
bind = SUPER,8,workspace,8
bind = SUPER,9,workspace,9
bind = SUPER,0,workspace,10
bind = SUPERALT,l,workspace,m+1
bind = SUPERALT,h,workspace,m-1
bind = SUPERSHIFT,1,movetoworkspace,1
bind = SUPERSHIFT,2,movetoworkspace,2
bind = SUPERSHIFT,3,movetoworkspace,3
bind = SUPERSHIFT,4,movetoworkspace,4
bind = SUPERSHIFT,5,movetoworkspace,5
bind = SUPERSHIFT,6,movetoworkspace,6
bind = SUPERSHIFT,7,movetoworkspace,7
bind = SUPERSHIFT,8,movetoworkspace,8
bind = SUPERSHIFT,9,movetoworkspace,9
bind = SUPERSHIFT,0,movetoworkspace,10
bind = SUPER,o,movewindow,mon:l
bind = SUPER,y,togglespecialworkspace
bind = SUPER,i,movewindow,left
bind = SUPERSHIFT,p,pin
bind = SUPER,n,movetoworkspace,special
binde = , XF86AudioMute, exec, pamixer -t
binde = , XF86AudioRaiseVolume, exec, /home/chris/bin/volup
binde = , XF86AudioLowerVolume, exec, /home/chris/bin/voldown
binde = ,F1, exec, pamixer -t
binde = ,F3, exec, /home/chris/bin/volup
binde = ,F2, exec, /home/chris/bin/voldown
binde = , XF86MonBrightnessUp, exec, brightnessctl s +10%
binde = , XF86MonBrightnessDown, exec, brightnessctl s 10%-
bind=SUPERCTRL,b,exec,eww.sh
bind=SUPERALT,n,exec,eww update rightside=true
bindm=SUPER,mouse:272,movewindow
bindm=SUPER,mouse:273,resizewindow
# Blur waybar
# blurls=gtk-layer-shell
# blurls=notifications
exec-once = /home/chris/bin/startup.sh
exec-once = swww init
exec-once = swww img /home/chris/Pictures/wallpapers/nixorange.webp -t grow --transition-bezier .14,0,.14,.99
exec-once = dunst
exec-once = hyprctl dispatch --batch "splitratio 1; splitration -0.35"
exec-once = dbus-update-activation-environment --systemd --all
exec-once = jellyfin-mpv-shim
exec-once = hyprctl setcursor phinger-cursors-light 24
exec-once = swayidle -w timeout 300 'swaylock -S --effect-blur 20x3 --fade-in 1 --effect-vignette 0.5:1 --grace 60' timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' before-sleep 'swaylock -S --effect-blur 20x3 --effect-vignette 0.5:1'
'';
};
}