refactor: rename some flake attr directories

This commit is contained in:
matt1432 2024-12-16 15:51:41 -05:00
parent 1ce40f2c1a
commit 6ca0d7248b
329 changed files with 178 additions and 139 deletions

View file

@ -0,0 +1,27 @@
{pkgs, ...}: {
config = {
programs.bash.shellAliases = {
# https://wiki.hyprland.org/Contributing-and-Debugging/#lsp-and-formatting
"mkCMakeFiles" = "${pkgs.cmake}/bin/cmake -S . -B build/ -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON";
};
home.packages = [
(pkgs.writeShellApplication {
name = "testChanges";
runtimeInputs = [pkgs.cmake];
text = ''
chmod +w -fR /home/matt/git/"$1/''${2:-"."}"/{.cache,build}
rm -r /home/matt/git/"$1/''${2:-"."}"/{.cache,build}
cd /home/matt/.nix || return
nix flake update "$1"
nh os switch
cd "/home/matt/git/$1/''${2:-"."}" || return
nix develop "/home/matt/git/$1" -c cmake -S . -B build/ -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
'';
})
];
};
# For accurate stack trace
_file = ./dev.nix;
}

View file

@ -0,0 +1,93 @@
{
lib,
osConfig,
...
}: {
config = let
cfg = osConfig.roles.desktop;
in {
programs = {
# https://codeberg.org/dnkl/foot/wiki#spawning-new-terminal-instances-in-the-current-working-directory
bash.bashrcExtra =
# bash
''
osc7_cwd() {
local strlen=''${#PWD}
local encoded=""
local pos c o
for (( pos=0; pos<strlen; pos++ )); do
c=''${PWD:$pos:1}
case "$c" in
[-/:_.!\'\(\)~[:alnum:]] ) o="$c" ;;
* ) printf -v o '%%%02X' "'$c" ;;
esac
encoded+="''${o}"
done
printf '\e]7;file://%s%s\e\\' "''${HOSTNAME}" "''${encoded}"
}
PROMPT_COMMAND=''${PROMPT_COMMAND:+$PROMPT_COMMAND; }osc7_cwd
'';
foot = {
enable = true;
settings = {
main = {
term = "xterm-256color";
font = "${cfg.fontName}:size=${
lib.strings.floatToString cfg.fontSize
}";
pad = "0x10";
};
key-bindings = {
spawn-terminal = "Control+Shift+Return";
};
bell = {
urgent = false;
notify = false;
visual = false;
command = null;
command-focused = false;
};
colors = {
# BG transparency
alpha = 0.8;
background = "282a36";
foreground = "f8f8f2";
regular0 = "21222c"; # black
regular1 = "ff5555"; # red
regular2 = "50fa7b"; # green
regular3 = "f1fa8c"; # yellow
regular4 = "bd93f9"; # blue
regular5 = "ff79c6"; # magenta
regular6 = "8be9fd"; # cyan
regular7 = "f8f8f2"; # white
bright0 = "6272a4"; # bright black
bright1 = "ff6e6e"; # bright red
bright2 = "69ff94"; # bright green
bright3 = "ffffa5"; # bright yellow
bright4 = "d6acff"; # bright blue
bright5 = "ff92df"; # bright magenta
bright6 = "a4ffff"; # bright cyan
bright7 = "ffffff"; # bright white
selection-foreground = "ffffff";
selection-background = "44475a";
urls = "8be9fd";
};
};
};
};
};
# For accurate stack trace
_file = ./foot.nix;
}

View file

@ -0,0 +1,35 @@
self: {pkgs, ...}: let
inherit (self.lib.hypr) mkBind;
in {
config = {
wayland.windowManager.hyprland = {
plugins = [self.inputs.hyprland-plugins.packages.${pkgs.system}.hyprexpo];
settings = {
plugin.hyprexpo = {
columns = 3;
gap_size = 5;
bg_col = "rgb(111111)";
workspace_method = "center current"; # [center/first] [workspace] e.g. first 1 or center m+1
enable_gesture = true; # laptop touchpad
gesture_fingers = 3;
gesture_distance = 300; # how far is the "max"
gesture_positive = true; # positive = swipe down. Negative = swipe up.
};
bind = [
(mkBind {
modifier = "ALT";
key = "tab";
dispatcher = "hyprexpo:expo";
command = "toggle"; # can be: toggle, off/disable or on/enable
})
];
};
};
};
# For accurate stack trace
_file = ./hyprexpo.nix;
}

View file

@ -0,0 +1,75 @@
self: {
lib,
osConfig,
pkgs,
...
}: let
inherit (lib) map mkIf;
inherit (self.lib.hypr) mkBind;
cfg = osConfig.roles.desktop;
in {
config = mkIf cfg.isTouchscreen {
wayland.windowManager.hyprland = {
plugins = [self.inputs.hyprgrass.packages.${pkgs.system}.default];
settings = {
plugin.touch_gestures = {
# The default sensitivity is probably too low on tablet screens,
# I recommend turning it up to 4.0
sensitivity = 4.0;
# must be >= 3
workspace_swipe_fingers = 3;
emulate_touchpad_swipe = true;
# switching workspaces by swiping from an edge, this is separate from workspace_swipe_fingers
# and can be used at the same time
# possible values: l, r, u, or d
# to disable it set it to anything else
# workspace_swipe_edge = "d";
# in milliseconds
long_press_delay = 400;
# resize windows by long-pressing on window borders and gaps.
# If general:resize_on_border is enabled, general:extend_border_grab_area is used for floating
# windows
resize_on_border_long_press = true;
# in pixels, the distance from the edge that is considered an edge
edge_margin = 10;
# send proper cancel events to windows instead of hacky touch_up events,
# NOT recommended as it crashed a few times, once it's stabilized I'll make it the default
experimental.send_cancel = 0;
hyprgrass-bind = map mkBind [
{
key = "edge:u:d";
command = "ags request 'open win-applauncher'";
}
];
hyprgrass-bindm = map mkBind [
{
key = "longpress:2";
dispatcher = "movewindow";
}
];
};
gestures = {
workspace_swipe = true;
workspace_swipe_fingers = 3;
workspace_swipe_touch = false;
workspace_swipe_cancel_ratio = 0.15;
};
};
};
};
# For accurate stack trace
_file = ./hyprgrass.nix;
}

View file

@ -0,0 +1,81 @@
self: {
osConfig,
lib,
...
}: {
config = let
inherit (lib) map;
inherit (self.lib.hypr) mkBind;
inherit (osConfig.services.xserver) xkb;
inherit (osConfig.roles.desktop) mainMonitor;
miceNames = [
"logitech-g502-x"
"logitech-g502-hero-gaming-mouse"
];
mkConf = name: {
inherit name;
sensitivity = 0;
accel_profile = "flat";
};
in {
wayland.windowManager.hyprland = {
settings = {
device = map mkConf miceNames;
cursor = {
no_hardware_cursors = osConfig.nvidia.enable;
hide_on_touch = true;
};
exec-once =
if mainMonitor != null
then ["hyprctl dispatch focusmonitor ${mainMonitor}"]
else [];
input = {
# Keyboard
kb_layout = xkb.layout;
kb_variant = xkb.variant;
numlock_by_default = true;
repeat_rate = 25;
# Mouse
follow_mouse = true;
# Touchpad
touchpad = {
natural_scroll = true;
disable_while_typing = false;
drag_lock = true;
tap-and-drag = true;
};
};
bind = map mkBind [
{
key = "XF86AudioPlay";
command = "playerctl play-pause";
}
{
key = "XF86AudioStop";
command = "playerctl stop";
}
{
key = "XF86AudioNext";
command = "playerctl next";
}
{
key = "XF86AudioPrev";
command = "playerctl previous";
}
];
};
};
};
# For accurate stack trace
_file = ./inputs.nix;
}

View file

@ -0,0 +1,71 @@
self: {pkgs, ...}: {
config = let
inherit (self.scopedPackages.${pkgs.system}) mpvScripts;
in {
# For kdialog-open-files
home.packages = [
pkgs.kdialog
];
programs.mpv = {
enable = true;
# https://github.com/mpv-player/mpv/wiki/User-Scripts
scripts = builtins.attrValues {
inherit
(mpvScripts)
modernx
persist-properties
undo-redo
;
# touch-gestures & deps
inherit
(mpvScripts)
pointer-event
touch-gestures
;
# Ctrl + o
inherit (mpvScripts) kdialog-open-files;
};
scriptOpts = {
persist_properties = {
properties = "volume,sub-scale";
};
# Touch gestures default
pointer-event = {
margin_left = 0;
margin_right = 80;
margin_top = 50;
margin_bottom = 130;
ignore_left_single_long_while_window_dragging = true;
left_single = "cycle pause";
left_double = "script-message-to touch_gestures double";
left_long = "script-binding uosc/menu-blurred";
left_drag_start = "script-message-to touch_gestures drag_start";
left_drag_end = "script-message-to touch_gestures drag_end";
left_drag = "script-message-to touch_gestures drag";
};
touch-gestures = {
# valid options are:
# 'playlist' for changing the playlist item by swiping
# 'seek' for seeking by dragging
horizontal_drag = "seek";
# scale seeking based on the duration of the video
proportional_seek = true;
# scale factor for seeking
seek_scale = 1;
};
};
};
};
# For accurate stack trace
_file = ./mpv.nix;
}

View file

@ -0,0 +1,20 @@
self: {pkgs, ...}: let
inherit (self.inputs) nixpkgs-wayland;
in {
config = let
waypkgs = nixpkgs-wayland.packages.${pkgs.system};
in {
programs = {
obs-studio = {
enable = true;
plugins = [
waypkgs.obs-wlrobs
pkgs.obs-studio-plugins.droidcam-obs
];
};
};
};
# For accurate stack trace
_file = ./obs.nix;
}