refactor: major structural changes

git updates

update tmux conf

add ansible tools

squash me

squash

fix: get git aliases from plugin

virt stuff

add devenv

some virt updates

kubernetes
This commit is contained in:
Glen Goodwin 2023-11-22 16:33:30 -05:00
parent 2e8c1eec90
commit 2220c4e917
87 changed files with 1963 additions and 2261 deletions

View file

@ -1,35 +0,0 @@
{
inputs,
pkgs,
...
}: {
gtk = {
cursorTheme = {
name = "Catppuccin-Mocha-Dark-Cursors";
package = pkgs.catppuccin-cursors.mochaDark;
};
enable = true;
iconTheme = {
package = pkgs.catppuccin-papirus-folders.override {
flavor = "mocha";
accent = "blue";
};
name = "Papirus-Dark";
};
theme = {
package = pkgs.catppuccin-gtk.override {
size = "compact";
variant = "mocha";
};
name = "Catppuccin-Mocha-Compact-Blue-Dark";
};
};
}

View file

@ -1,65 +0,0 @@
{
config,
lib,
pkgs,
system,
inputs,
...
}: let
exec = "exec Hyprland";
in {
imports = [../../programs/waybar.nix];
environment = {
loginShellInit = ''
if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then
${exec}
fi
''; # Will automatically open Hyprland when logged into tty1
variables = {
#WLR_NO_HARDWARE_CURSORS="1"; # Possible variables needed in vm
#WLR_RENDERER_ALLOW_SOFTWARE="1";
XDG_CURRENT_DESKTOP = "Hyprland";
XDG_SESSION_TYPE = "wayland";
XDG_SESSION_DESKTOP = "Hyprland";
XCURSOR_SIZE = "108";
};
sessionVariables = {
QT_QPA_PLATFORM = "wayland";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
GDK_BACKEND = "wayland";
WLR_NO_HARDWARE_CURSORS = "1";
MOZ_ENABLE_WAYLAND = "1";
};
systemPackages = with pkgs; [
grim
mpvpaper
slurp
swappy
swaylock
wl-clipboard
wlr-randr
];
};
security.pam.services.swaylock = {
text = ''
auth include login
'';
};
programs = {
hyprland = {
enable = true;
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
};
};
xdg.portal = {
# Required for flatpak with window managers and for file browsing
enable = true;
extraPortals = [pkgs.xdg-desktop-portal-gtk];
};
}

View file

@ -1,9 +0,0 @@
#!/usr/bin/env bash
if grep open /proc/acpi/button/lid/LID/state; then
hyprctl keyword monitor "eDP-1, 1920x1080, 0x0, 1"
else
if [[ $(hyprctl monitors | grep -c "Monitor") != 1 ]]; then
hyprctl keyword monitor "eDP-1, disable"
fi
fi

View file

@ -1,215 +0,0 @@
{
pkgs,
config,
...
}: let
hyprlandConf = ''
monitor=,preferred,auto,1
#monitor=,preferred,auto,auto
# trigger when the switch is turning off
# bindl = , switch:off:Lid Switch,exec,hyprctl keyword monitor "eDP-1, 1920x1080, 0x0, 1"
# trigger when the switch is turning on
# bindl = , switch:on:Lid Switch,exec,hyprctl keyword monitor "eDP-1, disable"
bindl=,switch:Lid Switch, exec, displayswitch
# use this instead of hidpi patches
xwayland {
force_zero_scaling = true
}
$mainMod=SUPER
general {
border_size=3
gaps_in=5
gaps_out=7
col.active_border=rgba(${config.colorScheme.colors.base05}ee) rgba(${config.colorScheme.colors.base08}ee) 45deg
col.inactive_border=0x66333333
layout=dwindle
}
decoration {
rounding=5
active_opacity=0.93
inactive_opacity=0.93
fullscreen_opacity=1
drop_shadow=false
}
animations {
enabled=true
bezier = myBezier,0.1,0.7,0.1,1.05
animation=fade,1,7,default
animation=windows,1,7,myBezier
animation=windowsOut,1,3,default,popin 60%
animation=windowsMove,1,7,myBezier
}
input {
kb_layout=us
kb_options=caps:ctrl_modifier
follow_mouse=2
repeat_delay=250
numlock_by_default=1
accel_profile=flat
sensitivity=0.8
touchpad {
natural_scroll=true
middle_button_emulation=true
tap-to-click=true
}
}
}
gestures {
workspace_swipe=true
workspace_swipe_fingers=3
workspace_swipe_distance=100
}
dwindle {
pseudotile=false
force_split=2
}
debug {
damage_tracking=2
}
bindm=$mainMod,mouse:272,movewindow
bindm=$mainMod,mouse:273,resizewindow
bind=$mainMod,Return,exec,${pkgs.alacritty}/bin/alacritty
bind=$mainMod,Q,killactive,
bind=$mainMod,Escape,exit,
bind=$mainMod,L,exec,${pkgs.swaylock}/bin/swaylock
bind=$mainMod,E,exec,${pkgs.pcmanfm}/bin/pcmanfm
bind=$mainMod,H,togglefloating,
#bind=$mainMod,Space,exec,${pkgs.rofi}/bin/rofi -show drun
bind=$mainMod,Space,exec,${pkgs.wofi}/bin/wofi --show drun
bind=$mainMod,P,pseudo,
bind=$mainMod,F,fullscreen,
bind=$mainMod,R,forcerendererreload
bind=$mainMod,R,exec,${pkgs.hyprland}/bin/hyprctl reload
bind=$mainMod,left,movefocus,l
bind=$mainMod,right,movefocus,r
bind=$mainMod,up,movefocus,u
bind=$mainMod,down,movefocus,d
bind=$mainMod SHIFT,left,movewindow,l
bind=$mainMod SHIFT,right,movewindow,r
bind=$mainMod SHIFT,up,movewindow,u
bind=$mainMod SHIFT,down,movewindow,d
bind=$mainMod,1,workspace,1
bind=$mainMod,2,workspace,2
bind=$mainMod,3,workspace,3
bind=$mainMod,4,workspace,4
bind=$mainMod,5,workspace,5
bind=$mainMod,6,workspace,6
bind=$mainMod,7,workspace,7
bind=$mainMod,8,workspace,8
bind=$mainMod,9,workspace,9
bind=$mainMod,0,workspace,10
bind=$mainMod,right,workspace,+1
bind=$mainMod,left,workspace,-1
bind=$mainMod SHIFT,1,movetoworkspace,1
bind=$mainMod SHIFT,2,movetoworkspace,2
bind=$mainMod SHIFT,3,movetoworkspace,3
bind=$mainMod SHIFT,4,movetoworkspace,4
bind=$mainMod SHIFT,5,movetoworkspace,5
bind=$mainMod SHIFT,6,movetoworkspace,6
bind=$mainMod SHIFT,7,movetoworkspace,7
bind=$mainMod SHIFT,8,movetoworkspace,8
bind=$mainMod SHIFT,9,movetoworkspace,9
bind=$mainMod SHIFT,0,movetoworkspace,10
bind=$mainMod SHIFT,right,movetoworkspace,+1
bind=$mainMod SHIFT,left,movetoworkspace,-1
bind=CTRL,right,resizeactive,20 0
bind=CTRL,left,resizeactive,-20 0
bind=CTRL,up,resizeactive,0 -20
bind=CTRL,down,resizeactive,0 20
bind=,print,exec,${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)" - | ${pkgs.swappy}/bin/swappy -f - -o ~/Pictures/$(date +%Hh_%Mm_%Ss_%d_%B_%Y).png && notify-send "Saved to ~/Pictures/$(date +%Hh_%Mm_%Ss_%d_%B_%Y).png"
bind=,XF86AudioLowerVolume,exec,${pkgs.pamixer}/bin/pamixer -d 10
bind=,XF86AudioRaiseVolume,exec,${pkgs.pamixer}/bin/pamixer -i 10
bind=,XF86AudioMute,exec,${pkgs.pamixer}/bin/pamixer -t
bind=,XF86AudioMicMute,exec,${pkgs.pamixer}/bin/pamixer --default-source -t
bind=,XF86MonBrightnessDown,exec,${pkgs.light}/bin/light -U 10
bind=,XF86MonBrightnessUP,exec,${pkgs.light}/bin/light -A 10
#windowrule=float,^(Rofi)$
windowrule=float,title:^(Volume Control)$
windowrule=float,title:^(Picture-in-Picture)$
windowrule=pin,title:^(Picture-in-Picture)$
windowrule=move 75% 75% ,title:^(Picture-in-Picture)$
windowrule=size 24% 24% ,title:^(Picture-in-Picture)$
exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
exec-once=${pkgs.waybar}/bin/waybar
exec-once=${pkgs.blueman}/bin/blueman-applet
exec-once=${pkgs.swaybg}/bin/swaybg -m fill -i $HOME/.config/wall
'';
in {
xdg.configFile."hypr/hyprland.conf".text = hyprlandConf;
programs.swaylock.settings = {
image = "$HOME/.config/lock";
color = "000000f0";
font-size = "24";
indicator-idle-visible = false;
indicator-radius = 100;
indicator-thickness = 20;
inside-color = "00000000";
inside-clear-color = "00000000";
inside-ver-color = "00000000";
inside-wrong-color = "00000000";
key-hl-color = "79b360";
line-color = "000000f0";
line-clear-color = "000000f0";
line-ver-color = "000000f0";
line-wrong-color = "000000f0";
ring-color = "ffffff50";
ring-clear-color = "bbbbbb50";
ring-ver-color = "bbbbbb50";
ring-wrong-color = "b3606050";
text-color = "ffffff";
text-ver-color = "ffffff";
text-wrong-color = "ffffff";
show-failed-attempts = true;
};
services.swayidle = {
enable = true;
events = [
{
event = "before-sleep";
command = "${pkgs.swaylock}/bin/swaylock -f";
}
{
event = "lock";
command = "lock";
}
];
timeouts = [
{
timeout = 300;
command = "${pkgs.swaylock}/bin/swaylock -f";
}
];
systemdTarget = "xdg-desktop-portal-hyprland.service";
};
home.packages = [
(pkgs.writeShellApplication {
name = "displayswitch";
runtimeInputs = [];
text = builtins.readFile ./displayswitch.sh;
})
];
}

View file

@ -1,5 +0,0 @@
[
./docker.nix
./libvirt.nix
./kubernetes.nix
]

View file

@ -1,25 +0,0 @@
{
config,
pkgs,
user,
...
}: {
virtualisation = {
docker.enable = true;
};
users.groups.docker.members = ["${user}"];
#environment = {
# interactiveShellInit = ''
# alias rtmp='docker start nginx-rtmp'
# ''; # Alias to easily start container
#};
environment.systemPackages = with pkgs; [
docker-compose
distrobox
dive # A tool for exploring a docker image, layer contents.
grype # A vulnerability scanner for container images and filesystems.
];
}

View file

@ -1,30 +0,0 @@
{
config,
pkgs,
user,
...
}: {
virtualisation = {
docker.enable = true;
};
users.groups.docker.members = ["${user}"];
#environment = {
# interactiveShellInit = ''
# alias rtmp='docker start nginx-rtmp'
# ''; # Alias to easily start container
#};
environment.systemPackages = with pkgs; [
argocd
k3d
k9s
kind
kubectl
kubectx
kubernetes-helm
minikube
stern
];
}

View file

@ -1,11 +0,0 @@
{
config,
pkgs,
user,
...
}: {
boot.kernelModules = ["kvm-amd"];
environment.systemPackages = with pkgs; [virt-manager];
virtualisation.libvirtd.enable = true;
users.extraGroups.libvirtd.members = ["${user}"];
}

View file

@ -1,3 +0,0 @@
[
# ./nvim
]

View file

@ -1,11 +0,0 @@
{pkgs, ...}: {
hardware.bluetooth = {
enable = true;
#hsphfpd.enable = true; # HSP & HFP daemon
settings = {
General = {
Enable = "Source,Sink,Media,Socket";
};
};
};
}

View file

@ -1,3 +0,0 @@
[
./bluetooth.nix
]

View file

@ -0,0 +1,6 @@
# Add your reusable home-manager modules to this directory, on their own file (https://nixos.wiki/wiki/Module).
# These should be stuff you would like to share with others, not your personal configurations.
{
# List your module files here
# my-module = import ./my-module.nix;
}

View file

@ -0,0 +1,6 @@
# Add your reusable NixOS modules to this directory, on their own file (https://nixos.wiki/wiki/Module).
# These should be stuff you would like to share with others, not your personal configurations.
{
# List your module files here
# my-module = import ./my-module.nix;
}

View file

@ -1,60 +0,0 @@
{
pkgs,
config,
...
}: {
programs.alacritty.enable = true;
programs.alacritty.settings = {
env = {TERM = "xterm-256color";};
colors = with config.colorScheme.colors; {
bright = {
black = "0x${base03}";
blue = "0x${base0D}";
cyan = "0x${base0C}";
green = "0x${base0B}";
magenta = "0x${base0E}";
red = "0x${base08}";
white = "0x${base07}";
yellow = "0x${base0A}";
};
cursor = {
cursor = "0x${base06}";
text = "0x${base05}";
};
normal = {
black = "0x${base00}";
blue = "0x${base0D}";
cyan = "0x${base0C}";
green = "0x${base0B}";
magenta = "0x${base0E}";
red = "0x${base08}";
white = "0x${base05}";
yellow = "0x${base0A}";
};
primary = {
background = "0x${base00}";
foreground = "0x${base05}";
};
};
font = {
normal = {
family = "MonoLisa";
style = "Regular";
};
bold = {
family = "MonoLisa";
style = "Bold";
};
italic = {
family = "MonoLisa";
style = "Italic";
};
bold_italic = {
family = "MonoLisa";
style = "Bold Italic";
};
size = 18;
#bold_italic = {};
};
};
}

View file

@ -1,19 +0,0 @@
{
config,
lib,
pkgs,
user,
devenv,
inputs,
...
}: {
home.packages = with pkgs; [
cachix
inputs.devenv.packages.${system}.devenv
];
programs.direnv.enable = true;
programs.direnv.nix-direnv.enable = true;
programs.zsh.enable = true;
}

View file

@ -1,79 +0,0 @@
{
config,
lib,
pkgs,
...
}: {
home = {
packages = with pkgs; [
kitty
];
};
home.file = {
".config/kitty/kitty.conf" = {
text = ''
include ./theme.conf
font_family SauceCodePro Nerd Font
font_size 14.0
background_opacity 1.0
show_hyperlink_targets yes
allow_hyperlinks yes
#term xterm-kitty
term xterm-256color
confirm_os_window_close 0
'';
};
};
home.file = {
".config/kitty/theme.conf" = {
text = ''
# Kitty window border colors
active_border_color #${config.colorScheme.colors.base07}
inactive_border_color #${config.colorScheme.colors.base02}
bell_border_color #${config.colorScheme.colors.base0A}
# URL underline color when hovering with mouse
url_color #${config.colorScheme.colors.base06}
# Colors for marks (marked text in the terminal)
mark1_foreground #${config.colorScheme.colors.base00}
mark1_background #${config.colorScheme.colors.base07}
mark2_foreground #${config.colorScheme.colors.base00}
mark2_background #${config.colorScheme.colors.base0E}
mark3_foreground #${config.colorScheme.colors.base00}
mark3_background #${config.colorScheme.colors.base0D}
background #${config.colorScheme.colors.base00}
foreground #${config.colorScheme.colors.base05}
cursor #${config.colorScheme.colors.base06}
cursor_text_color #${config.colorScheme.colors.base00}
color0 #${config.colorScheme.colors.base03}
color1 #${config.colorScheme.colors.base08}
color2 #${config.colorScheme.colors.base0B}
color3 #${config.colorScheme.colors.base0A}
color4 #${config.colorScheme.colors.base0D}
color5 #${config.colorScheme.colors.base0F}
color6 #${config.colorScheme.colors.base0C}
color7 #${config.colorScheme.colors.base03}
color8 #${config.colorScheme.colors.base04}
color9 #${config.colorScheme.colors.base08}
color10 #${config.colorScheme.colors.base0B}
color11 #${config.colorScheme.colors.base0A}
color12 #${config.colorScheme.colors.base0D}
color13 #${config.colorScheme.colors.base0F}
color14 #${config.colorScheme.colors.base0C}
color15 #${config.colorScheme.colors.base04}
selection_foreground #${config.colorScheme.colors.base00}
selection_background #${config.colorScheme.colors.base06}
'';
};
};
}

View file

@ -1,15 +0,0 @@
{
pkgs,
config,
...
}: {
services.mako = with config.colorScheme.colors; {
enable = true;
backgroundColor = "#${base01}";
borderColor = "#${base0E}";
borderRadius = 5;
borderSize = 2;
textColor = "#${base04}";
layer = "overlay";
};
}

View file

@ -1,15 +0,0 @@
{
pkgs,
config,
...
}: {
programs.thunar = {
enable = true;
plugins = with pkgs.xfce; [
thunar-archive-plugin
thunar-volman
];
};
services.gvfs.enable = true; # Mount, trash, and other functionalities
services.tumbler.enable = true; # Thumbnail support for images
}

View file

@ -1,446 +0,0 @@
{
config,
lib,
pkgs,
host,
user,
...
}: {
environment.systemPackages = with pkgs; [
waybar
];
home-manager.users.${user} = {
# Home-manager waybar config
programs.waybar = {
enable = true;
systemd = {
enable = true;
target = "sway-session.target"; # Needed for waybar to start automatically
};
style = ''
* {
border: none;
font-family: FiraCode Nerd Font Mono;
/*font-weight: bold;*/
font-size: 12px;
text-shadow: 0px 0px 5px #${config.colorScheme.colors.base00};
}
button:hover {
background-color: rgba(80,100,100,0.4);
}
window#waybar {
background-color: #${config.colorScheme.colors.base00};
transition-property: background-color;
transition-duration: .5s;
border-bottom: none;
}
window#waybar.hidden {
opacity: 0.2;
}
#workspace,
#mode,
#clock,
#pulseaudio,
#custom-sink,
#network,
#mpd,
#memory,
#network,
#window,
#cpu,
#disk,
#backlight,
#battery,
#custom-ds4,
#tray {
color: #${config.colorScheme.colors.base09};
background-clip: padding-box;
}
#custom-menu {
color: #A7C7E7;
padding: 0px 5px 0px 5px;
}
#workspaces button {
padding: 0px 5px;
min-width: 5px;
color: #${config.colorScheme.colors.base09};
}
#workspaces button:hover {
background-color: #${config.colorScheme.colors.base02};
}
/*#workspaces button.focused {*/
#workspaces button.active {
color: #${config.colorScheme.colors.base0C};
background-color: #${config.colorScheme.colors.base02};
}
#workspaces button.visible {
color: #${config.colorScheme.colors.base0E};
}
#workspaces button.hidden {
color: #999999;
}
#battery.warning {
color: #ff5d17;
background-color: rgba(0,0,0,0);
}
#battery.critical {
color: #ff200c;
background-color: rgba(0,0,0,0);
}
#battery.charging {
color: #9ece6a;
background-color: rgba(0,0,0,0);
}
'';
settings = with host; {
Main = {
layer = "top";
position = "top";
height = 16;
# output = [
# "${mainMonitor}"
# ];
tray = {spacing = 5;};
#modules-center = [ "clock" ];
modules-left = with config;
if programs.hyprland.enable == true
then ["custom/menu" "hyprland/workspaces"]
else if programs.sway.enable == true
then ["sway/workspaces" "sway/window" "sway/mode"]
else [];
modules-right =
if hostName == "desktop"
then ["custom/ds4" "custom/pad" "network" "cpu" "memory" "custom/pad" "pulseaudio" "custom/sink" "custom/pad" "clock" "tray"]
else ["cpu" "memory" "custom/pad" "battery" "custom/pad" "backlight" "custom/pad" "pulseaudio" "custom/pad" "clock" "tray"];
"custom/pad" = {
format = " ";
tooltip = false;
};
"custom/menu" = {
format = "<span font='16'></span>";
#on-click = ''${pkgs.rofi}/bin/rofi -show power-menu -modi "power-menu:rofi-power-menu --choices=logout/suspend/reboot/shutdown"'';
#on-click-right = "${pkgs.rofi}/bin/rofi -show drun";
on-click = ''~/.config/wofi/power.sh'';
on-click-right = "${pkgs.wofi}/bin/wofi --show drun";
tooltip = false;
};
"sway/workspaces" = {
format = "<span font='12'>{icon}</span>";
format-icons = {
"1" = "";
"2" = "";
"3" = "";
"4" = "";
"5" = "";
};
all-outputs = true;
persistent_workspaces = {
"1" = [];
"2" = [];
"3" = [];
"4" = [];
"5" = [];
};
};
"wlr/workspaces" = {
format = "<span font='11'>{name}</span>";
#format = "<span font='12'>{icon}</span>";
#format-icons = {
# "1"="";
# "2"="";
# "3"="";
# "4"="";
# "5"="";
# "6"="";
# "7"="";
# "8"="";
# "9"="";
# "10"="";
#};
#all-outputs = true;
active-only = false;
on-click = "activate";
};
"hyprland/workspaces" = {
format = "<span font='11'>{name}</span>";
};
clock = {
format = "{:%b %d %H:%M} ";
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
#format-alt = "{:%A, %B %d, %Y} ";
};
cpu = {
format = " {usage}% <span font='11'></span> ";
interval = 1;
};
disk = {
format = "{percentage_used}% <span font='11'></span>";
path = "/";
interval = 30;
};
memory = {
format = "{}% <span font='11'></span>";
interval = 1;
};
backlight = {
device = "intel_backlight";
format = "{percent}% <span font='11'>{icon}</span>";
format-icons = ["" ""];
on-scroll-down = "${pkgs.light}/bin/light -U 5";
on-scroll-up = "${pkgs.light}/bin/light -A 5";
};
battery = {
interval = 60;
states = {
warning = 30;
critical = 15;
};
format = "{capacity}% <span font='11'>{icon}</span>";
format-charging = "{capacity}% <span font='11'></span>";
format-icons = ["" "" "" "" ""];
max-length = 25;
};
network = {
format-wifi = "<span font='11'></span>";
format-ethernet = "<span font='11'>󰈀</span>";
#format-ethernet = "<span font='11'></span> {ifname}: {ipaddr}/{cidr}";
format-linked = "<span font='11'>󱘖</span> {ifname} (No IP)";
format-disconnected = "<span font='11'>󱘖</span> Not connected";
#format-alt = "{ifname}: {ipaddr}/{cidr}";
tooltip-format = "{essid} {ipaddr}/{cidr}";
#on-click-right = "${pkgs.alacritty}/bin/alacritty -e nmtui";
};
pulseaudio = {
format = "<span font='11'>{icon}</span> {volume}% {format_source} ";
format-bluetooth = "<span font='11'>{icon}</span> {volume}% {format_source} ";
format-bluetooth-muted = "<span font='11'>x</span> {volume}% {format_source} ";
format-muted = "<span font='11'>x</span> {volume}% {format_source} ";
#format-source = "{volume}% <span font='11'></span>";
format-source = "<span font='10'></span> ";
format-source-muted = "<span font='11'> </span> ";
format-icons = {
default = ["" "" ""];
headphone = "";
#hands-free = "";
#headset = "";
#phone = "";
#portable = "";
#car = "";
};
tooltip-format = "{desc}, {volume}%";
on-click = "${pkgs.pamixer}/bin/pamixer -t";
on-click-right = "${pkgs.pamixer}/bin/pamixer --default-source -t";
on-click-middle = "${pkgs.pavucontrol}/bin/pavucontrol";
};
"custom/sink" = {
format = "{}";
exec = "$HOME/.config/waybar/script/sink.sh";
interval = 2;
on-click = "$HOME/.config/waybar/script/switch.sh";
tooltip = false;
};
"custom/ds4" = {
format = "{}";
exec = "$HOME/.config/waybar/script/ds4.sh";
interval = 60;
};
tray = {
icon-size = 13;
};
};
Sec =
if hostName == "desktop" || hostName == "work"
then {
layer = "top";
position = "top";
height = 16;
output =
if hostName == "desktop"
then [
"${secondMonitor}"
]
else [
"${secondMonitor}"
"${thirdMonitor}"
];
modules-left = ["custom/menu" "wlr/workspaces"];
modules-right =
if hostName == "desktop"
then ["custom/ds4" "custom/pad" "pulseaudio" "custom/sink" "custom/pad" "clock"]
else ["cpu" "memory" "custom/pad" "battery" "custom/pad" "backlight" "custom/pad" "pulseaudio" "custom/pad" "clock"];
"custom/pad" = {
format = " ";
tooltip = false;
};
"custom/menu" = {
format = "<span font='16'></span>";
#on-click = "${pkgs.rofi}/bin/rofi -show p -modi p:${pkgs.rofi-power-menu}/bin/rofi-power-menu -theme $HOME/.config/rofi/config.rasi";
#on-click-right = "${pkgs.rofi}/bin/rofi -show drun";
on-click = ''~/.config/wofi/power.sh'';
on-click-right = "${pkgs.wofi}/bin/wofi --show drun";
tooltip = false;
};
"wlr/workspaces" = {
format = "<span font='11'>{name}</span>";
#format = "<span font='12'>{icon}</span>";
#format-icons = {
# "1"="";
# "2"="";
# "3"="";
# "4"="";
# "5"="";
# "6"="";
# "7"="";
# "8"="";
# "9"="";
# "10"="";
#};
active-only = false;
on-click = "activate";
#on-scroll-up = "hyprctl dispatch workspace e+1";
#on-scroll-down = "hyprctl dispatch workspace e-1";
};
clock = {
format = "{:%b %d %H:%M}";
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
#format-alt = "{:%A, %B %d, %Y} ";
};
cpu = {
format = " {usage}% <span font='11'></span> ";
interval = 1;
};
disk = {
format = "{percentage_used}% <span font='11'></span>";
path = "/";
interval = 30;
};
memory = {
format = "{}% <span font='11'></span>";
interval = 1;
};
backlight = {
device = "intel_backlight";
format = "{percent}% <span font='11'>{icon}</span>";
format-icons = ["" ""];
on-scroll-down = "${pkgs.light}/bin/light -U 5";
on-scroll-up = "${pkgs.light}/bin/light -A 5";
};
battery = {
interval = 60;
states = {
warning = 30;
critical = 15;
};
format = "{capacity}% <span font='11'>{icon}</span>";
format-charging = "{capacity}% <span font='11'></span>";
format-icons = ["" "" "" "" ""];
max-length = 25;
};
pulseaudio = {
format = "<span font='11'>{icon}</span> {volume}% {format_source} ";
format-bluetooth = "<span font='11'>{icon}</span> {volume}% {format_source} ";
format-bluetooth-muted = "<span font='11'>x</span> {volume}% {format_source} ";
format-muted = "<span font='11'>x</span> {volume}% {format_source} ";
#format-source = "{volume}% <span font='11'></span> ";
format-source = "<span font='10'></span> ";
format-source-muted = "<span font='11'></span> ";
format-icons = {
default = ["" "" ""];
headphone = "";
#hands-free = "";
#headset = "";
#phone = "";
#portable = "";
#car = "";
};
tooltip-format = "{desc}, {volume}%";
on-click = "${pkgs.pamixer}/bin/pamixer -t";
on-click-right = "${pkgs.pamixer}/bin/pamixer --default-source -t";
on-click-middle = "${pkgs.pavucontrol}/bin/pavucontrol";
};
"custom/sink" = {
#format = "<span font='10'>蓼</span>";
format = "{}";
exec = "$HOME/.config/waybar/script/sink.sh";
interval = 2;
on-click = "$HOME/.config/waybar/script/switch.sh";
tooltip = false;
};
"custom/ds4" = {
format = "{}";
exec = "$HOME/.config/waybar/script/ds4.sh";
interval = 60;
};
}
else {};
};
};
home.file = {
".config/waybar/script/sink.sh" = {
# Custom script: Toggle speaker/headset
text = ''
#!/bin/sh
HEAD=$(awk '/ Built-in Audio Analog Stereo/ { print $2 }' <(${pkgs.wireplumber}/bin/wpctl status | grep "*") | sed -n 2p)
SPEAK=$(awk '/ S10 Bluetooth Speaker/ { print $2 }' <(${pkgs.wireplumber}/bin/wpctl status | grep "*") | head -n 1)
if [[ $HEAD = "*" ]]; then
printf "<span font='13'></span>\n"
elif [[ $SPEAK = "*" ]]; then
printf "<span font='10'>󰓃</span>\n"
fi
exit 0
'';
executable = true;
};
".config/waybar/script/switch.sh" = {
# Custom script: Toggle speaker/headset
text = ''
#!/bin/sh
ID1=$(awk '/ Built-in Audio Analog Stereo/ {sub(/.$/,"",$2); print $2 }' <(${pkgs.wireplumber}/bin/wpctl status) | head -n 1)
ID2=$(awk '/ S10 Bluetooth Speaker/ {sub(/.$/,"",$2); print $2 }' <(${pkgs.wireplumber}/bin/wpctl status) | sed -n 2p)
HEAD=$(awk '/ Built-in Audio Analog Stereo/ { print $2 }' <(${pkgs.wireplumber}/bin/wpctl status | grep "*") | sed -n 2p)
SPEAK=$(awk '/ S10 Bluetooth Speaker/ { print $2 }' <(${pkgs.wireplumber}/bin/wpctl status | grep "*") | head -n 1)
if [[ $HEAD = "*" ]]; then
${pkgs.wireplumber}/bin/wpctl set-default $ID2
elif [[ $SPEAK = "*" ]]; then
${pkgs.wireplumber}/bin/wpctl set-default $ID1
fi
exit 0
'';
executable = true;
};
".config/waybar/script/ds4.sh" = {
# Custom script: Dualshock battery indicator
text = ''
#!/bin/sh
FILE=/sys/class/power_supply/sony_controller_battery_e8:47:3a:05:c0:2b/capacity
FILE2=/sys/class/power_supply/ps-controller-battery-e8:47:3a:05:c0:2b/capacity
if [[ -f $FILE ]] then
DS4BATT=$(cat $FILE)
printf "<span font='13'>󰊴</span> $DS4BATT%%\n"
elif [[ -f $FILE2 ]] then
DS4BATT=$(cat $FILE2)
printf "<span font='13'>󰊴</span> $DS4BATT%%\n"
else
printf "\n"
fi
exit 0
'';
executable = true;
};
};
};
}

View file

@ -1,103 +0,0 @@
{
config,
lib,
pkgs,
...
}: let
inherit (config.lib.formats.rasi) mkLiteral; # Theme.rasi alternative. Add Theme here
colors = import ../themes/colors.nix;
in {
home = {
packages = with pkgs; [
wofi
];
};
home.file = {
".config/wofi/config" = {
text = ''
width=280
lines=10
xoffset=5
yoffset=5
location=1
prompt=Search...
filter_rate=100
allow_markup=false
no_actions=true
halign=fill
orientation=vertical
content_halign=fill
insensitive=true
allow_images=true
image_size=20
hide_scroll=true
'';
};
".config/wofi/style.css" = {
text = ''
window {
margin: 0px;
background-color: #${config.colorScheme.colors.base00};
}
#input {
all: unset;
min-height: 20px;
padding: 4px 10px;
margin: 4px;
border: none;
color: #${config.colorScheme.colors.base08};
font-weight: bold;
background-color: #${config.colorScheme.colors.base00};
outline: #fff;
}
#inner-box {
font-weight: bold;
border-radius: 0px;
}
#outer-box {
margin: 0px;
padding: 3px;
border: none;
border-radius: 10px;
border: 3px solid #${config.colorScheme.colors.base05};
}
#text {
color: #${config.colorScheme.colors.base09};
}
#text:selected {
color: #${config.colorScheme.colors.base08};
background-color: transparent;
}
#entry:selected {
background-color: #${config.colorScheme.colors.base05};
}
'';
};
".config/wofi/power.sh" = {
executable = true;
text = ''
#!/bin/sh
entries=" Suspend\n Reboot\n Shutdown"
selected=$(echo -e $entries|wofi --dmenu --cache-file /dev/null | awk '{print tolower($2)}')
case $selected in
suspend)
exec systemctl suspend;;
reboot)
exec systemctl reboot;;
shutdown)
exec systemctl poweroff -i;;
esac
'';
};
};
}

View file

@ -1,13 +0,0 @@
{
pkgs,
config,
...
}: {
programs.zathura = {
enable = true;
extraConfig = ''
# Open document in fit-width mode by default
set adjust-open "best-fit"
'';
};
}

View file

@ -1,5 +0,0 @@
[
# ./git.nix
./zsh.nix
# ./direnv.nix
]

View file

@ -1,67 +0,0 @@
{
config,
lib,
pkgs,
user,
...
}: {
programs.git = {
enable = true;
userName = "Glen Goodwin";
userEmail = "glen.goodwin1992@gmail.com";
extraConfig = {
diff = {
algorithm = "patience";
compactionHeuristic = "true";
tool = "nvimdiff";
};
"difftool \"nvimdiff\"" = {
cmd = "nvim -d \"$LOCAL\" \"$REMOTE\" -c \"wincmd w\" -c \"wincmd L\"";
};
merge = {
tool = "nvimdiff4";
prompt = "false";
};
"mergetool \"nvimdiff4\"" = {
cmd = "nvim -d $LOCAL $BASE $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'";
};
init = {
defaultBranch = "main";
};
core = {
pager = "delta";
editor = "nvim";
};
delta = {
features = "side-by-side line-numbers decorations";
navigate = "true";
whitespace-error-style = "22 reverse";
};
interactive = {
diffFilter = "delta --color-only";
};
};
ignores = [
"__pycache__"
".direnv"
# Node
"npm-debug.log"
"*.swp"
];
};
programs.zsh = {
shellAliases = {
trackme = "git branch --set-upstream-to=origin/$(git symbolic-ref --short HEAD)";
rebasemain = "git pull origin main --rebase";
};
};
home.packages = with pkgs; [
cocogitto
delta
lazygit
gh
pre-commit
];
}

View file

@ -1,33 +0,0 @@
{
config,
lib,
pkgs,
user,
...
}: {
home.file."ranger_devicons" = {
source = pkgs.fetchgit {
url = "https://github.com/alexanderjeurissen/ranger_devicons.git";
rev = "main";
sha256 = "1ra2afxm2167a6ashgbrlilsh5lx696jzdhmfl34jh1w9p4j34g8";
};
target = ".config/ranger/plugins/ranger_devicons";
};
home.file = {
".config/ranger/rc.conf" = {
text = ''
default_linemode devicons
set vcs_backend_git enabled
set preview_files true
set preview_directories true
set collapse_preview true
'';
};
};
home.packages = with pkgs; [
ranger
];
}

View file

@ -1,165 +0,0 @@
{
pkgs,
config,
user,
...
}: {
programs.tmux = {
enable = true;
clock24 = true;
plugins = with pkgs.tmuxPlugins; [
sensible
yank
resurrect
continuum
vim-tmux-navigator
tmux-thumbs
];
extraConfig = ''
bind -n M-r source-file ~/.config/tmux/tmux.conf
set -ag terminal-overrides ",xterm-256color:RGB"
set -g detach-on-destroy off # don't exit from tmux when closing a session
# New Theme
set -g status-interval 3 # update the status bar every 3 seconds
set -g status-left "#[fg=blue,bold,bg=#${config.colorScheme.colors.base00}] #S "
set -g status-right "#[fg=#${config.colorScheme.colors.base07},bold,bg=#${config.colorScheme.colors.base00}]%a %Y-%m-%d 󱑒 %l:%M %p"
set -ga status-right "#($HOME/.config/tmux/scripts/cal.sh)"
set -g status-justify left
set -g status-left-length 200 # increase length (from 10)
set -g status-right-length 200 # increase length (from 10)
set -g status-position top # macOS / darwin style
set -g status-style 'bg=#${config.colorScheme.colors.base00}' # transparent
set -g window-status-current-format '#[fg=magenta,bg=#${config.colorScheme.colors.base00}]*#I #W#{?window_zoomed_flag,(),} '
set -g window-status-format '#[fg=gray,bg=#${config.colorScheme.colors.base00}] #I #W'
set -g window-status-last-style 'fg=white,bg=black'
set -g message-command-style bg=default,fg=yellow
set -g message-style bg=default,fg=yellow
set -g mode-style bg=default,fg=yellow
set -g pane-active-border-style 'fg=magenta,bg=default'
set -g pane-border-style 'fg=brightblack,bg=default'
set -g @tmux-last-prompt-pattern ' '
set -g mouse on
set-option -g status-position top
bind-key g display-popup -h 95% -w 95% -E 'lazygit'
bind-key t display-popup -h 95% -w 95% -E "${pkgs.htop}/bin/htop"
bind C-g display-popup -E "tat ~/gallery"
bind -n M-g display-popup -E "tmux new-session -A -s scratch"
bind -n M-b switch-client -l
bind -n M-p previous-window
bind -n M-n next-window
bind -n M-P switch-client -p
bind -n M-N switch-client -n
unbind f
bind f resize-pane -Z
# create session
bind C-c new-session
# split current window horizontally
bind - split-window -v
# split current window vertically
bind _ split-window -h
# Select Layouts
#―――――――――――――――――
bind -n M-a select-layout main-vertical
bind -n M-A select-layout main-horizontal
bind -n M-E select-layout even-vertical
bind -n M-V select-layout even-horizontal
# pane navigation
bind -r h select-pane -L # move left
bind -r j select-pane -D # move down
bind -r k select-pane -U # move up
bind -r l select-pane -R # move right
bind > swap-pane -D # swap current pane with the next one
bind < swap-pane -U # swap current pane with the previous one
# pane resizing
bind -r H resize-pane -L 2
bind -r J resize-pane -D 2
bind -r K resize-pane -U 2
bind -r L resize-pane -R 2
bind -r c-f resize-pane -Z
# window navigation
unbind n
unbind p
setw -g mode-keys vi
bind Enter copy-mode # enter copy mode
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi C-v send -X rectangle-toggle
bind -T copy-mode-vi y send -X copy-selection-and-cancel
bind -T copy-mode-vi Escape send -X cancel
bind -T copy-mode-vi H send -X start-of-line
bind -T copy-mode-vi L send -X end-of-line
# -- buffers -------------------------------------------------------------------
bind b list-buffers # list paste buffers
bind p paste-buffer -p # paste from the top paste buffer
bind P choose-buffer # choose which buffer to paste from
# -- display -------------------------------------------------------------------
set -g renumber-windows on # renumber windows when a window is closed
bind k display-popup -E "\
tmux list-sessions -F '#{?session_attached,,#{session_name}}' |\
fzf --reverse -m --header=kill-session |\
xargs -I {} tmux kill-session -t {}"
bind C-j display-popup -E "\
tmux list-sessions -F '#{?session_attached,,#{session_name}}' |\
sed '/^$/d' |\
fzf --reverse --header jump-to-session --preview 'tmux capture-pane -pt {}' |\
xargs tmux switch-client -t"
'';
};
programs.tmate = {
enable = true;
};
home.packages = [
# Open tmux for current project.
(pkgs.writeShellApplication {
name = "tat";
runtimeInputs = [pkgs.tmux pkgs.fzf];
text = builtins.readFile ./ta.sh;
})
pkgs.fzf
];
programs.zsh = {
shellAliases = {
tx = "tmux new -s default";
ta = "tmux attach -t";
tad = "tmux attach -d -t";
ts = "tmux new-session -s";
tl = "tmux list-sessions";
tksv = "tmux kill-server";
tkss = "tmux kill-session -t";
};
};
}

View file

@ -1,77 +0,0 @@
#!/bin/bash
not_in_tmux() {
[ -z "$TMUX" ]
}
DIR="$1"
# If no arguments are passed in, try to immediately attach or start without further input
echo "$DIR"
if [ -z "$DIR" ]; then
if not_in_tmux; then
tmux attach && exit 1 || DIR="--start"
else
exit 1
fi
fi
# If --start was passed in, immediately start a new session based on the current directory
if [ "$DIR" = "--start" ]; then
echo "Starting"
path_name="$(basename "$PWD" | tr . -)"
session_name="${path_name//./_}"
else
# Ask the user which directory to start in
_session_name=$(cd "$DIR" && find -L . -maxdepth 1 -type d -printf "%f\n" | sed "s|/||g" | fzf --reverse --header="Select project from $(basename "$DIR")")
session_name="${_session_name//./_}"
path_name="$DIR/$_session_name"
fi
echo "Session name is \"$session_name\""
echo "Path name is \"$path_name\""
if [ -z "$session_name" ]; then
# Operation cancelled by user
exit 1
fi
session_exists() {
# Check if the $session_name exists
tmux has-session -t "=$session_name"
}
create_detached_session() {
if [ "$DIR" = "--start" ]; then
(TMUX=''
tmux new-session -Ad -s "$session_name" -c "$path_name"
)
else
(TMUX=''
tmux new-session -Ad -s "$session_name" -c "$path_name"
tmux split-window -vb -t "$session_name" -c "$path_name" -p 70
tmux send-keys -t "$session_name" "nvim '+Telescope find_files'" Enter
)
fi
}
create_if_needed_and_attach() {
if not_in_tmux; then
tmux new-session -As "$session_name" -c "$path_name"
else
if ! session_exists; then
create_detached_session
fi
tmux switch-client -t "$session_name"
fi
}
attach_to_first_session() {
first_session_name=$(tmux list-sessions -F "#{session_name}" | head -n 1)
if [ -n "$first_session_name" ]; then
tmux attach -t "$first_session_name"
tmux choose-tree -Za
fi
}
create_if_needed_and_attach || attach_to_first_session

View file

@ -1,43 +0,0 @@
{
pkgs,
config,
...
}: {
age.secrets.env = {
file = ../../secrets/env.age;
owner = "glen";
};
programs = {
zsh = {
enable = true;
autosuggestions.enable = true; # Auto suggest options and highlights syntax, searches in history for options
syntaxHighlighting.enable = true;
enableCompletion = true;
histSize = 100000;
ohMyZsh = {
# Extra plugins for zsh
enable = true;
plugins = ["git"];
};
shellInit = '' # Zsh theme
eval "$(starship init zsh)"
# Spaceship
#source ${pkgs.spaceship-prompt}/share/zsh/site-functions/prompt_spaceship_setup
#autoload -U promptinit; promptinit
# Hook direnv
#emulate zsh -c "$(direnv hook zsh)"
# Swag
#${pkgs.nitch}/bin/nitch
#eval "$(direnv hook zsh)"
eval "$(atuin init zsh)"
clear
pfetch
source ${config.age.secrets.env.path}
'';
};
};
}

View file

@ -1,82 +0,0 @@
{
config,
lib,
pkgs,
user,
...
}: {
programs.zsh = {
enable = true;
shellAliases = {
vim = "nvim";
update = "sudo nixos-rebuild switch";
clean = "nix-collect-garbage -d";
reload = "source ~/.zshrc";
"." = "cd ../";
".." = "cd ../../";
"..." = "cd ../../../";
"...." = "cd ../../../../";
ls = "eza --icons=always";
l = "eza -al --icons=always";
la = "eza -a --color=always --group-directories-first --icons=always"; # all files and dirs
ll = "eza -l --color=always --group-directories-first --icons=always"; # long format
lt = "eza -aT --color=always --group-directories-first --icons=always"; # tree listing
cat = "bat";
ps = "procs";
grep = "rg";
# Default flags
rm = "rm -i";
chmod = "chmod -R";
cp = "cp -R -i -v";
mv = "mv -i -v";
mkdir = "mkdir -p -v";
df = "df -h";
du = "du -h -s";
dd = "dd status=progress bs=4M conv=fdatasync ";
wgetpaste = "wgetpaste -Xx";
sudo = "sudo "; # Makes sudo work with es
ssh = "TERM=xterm ssh"; # Fixes some issues with ssh on some terminals
wget = "wget -c";
ping = "ping -c 5";
# Misc alieses I use often
ports = "netstat -tulanp";
rmd = "rm -rf";
mine = "sudo chown -R $(whoami):users";
benchmark = "hyperfine --warmup 3 ";
c = "clear";
listen = "lsof -P -i -n";
nc = "nordvpn connect sweden";
nd = "nordvpn disconnect";
tra = "transmission-remote -a";
clock = "sudo ntpd -gq";
octal = "stat -c '%a %n'";
};
zplug = {
enable = true;
plugins = [
{name = "zsh-users/zsh-autosuggestions";}
{name = "zsh-users/zsh-completions";}
{name = "zsh-users/zsh-syntax-highlighting";}
{name = "MichaelAquilina/zsh-you-should-use";}
];
};
history = {
size = 10000;
path = "${config.xdg.dataHome}/zsh/history";
};
initExtra = ''
#clear
#neofetch
eval "$(atuin init zsh)"
eval $(thefuck --alias)
'';
};
}

View file

@ -1,9 +0,0 @@
{
pkgs,
inputs,
...
}: {
imports = [inputs.nix-colors.homeManagerModules.default];
# choose a theme from here https://github.com/tinted-theming/base16-schemes/tree/main
colorScheme = inputs.nix-colors.colorSchemes.tokyo-night-terminal-storm;
}