From 3a146f39b7142b6aacdef9c4ac07fe7b14e63232 Mon Sep 17 00:00:00 2001 From: kenji Date: Mon, 29 Dec 2025 14:02:09 -0600 Subject: [PATCH] refactor: standardize config structure and consolidate modules - Standardized apps/ directory by renaming all entry points (e.g., home.nix) to default.nix and updating imports to use directory paths. - Consolidated system/ logic into modules/system/, eliminating the top-level system/ directory and redundant wrappers. - Merged subsidiary utility scripts (e.g., hakase-popup.nix, switch-wallpaper.nix) into their parent default.nix files for better cohesion. - Cleaned up unused files and updated all module references to reflect the new structure. --- apps/btop/{home.nix => default.nix} | 0 apps/cava/{home.nix => default.nix} | 0 apps/fastfetch/{home.nix => default.nix} | 0 apps/firefox/{home.nix => default.nix} | 0 apps/fish/{home.nix => default.nix} | 0 apps/gemini/{home.nix => default.nix} | 0 apps/ghostty/{home.nix => default.nix} | 0 apps/git/{home.nix => default.nix} | 0 apps/hypridle/{home.nix => default.nix} | 0 apps/hyprland/default.nix | 45 +-- apps/hyprland/home.nix | 15 - apps/hyprland/scripts/terminal.nix | 9 - apps/hyprlock/{home.nix => default.nix} | 0 apps/hyprpaper/default.nix | 84 +++++ apps/hyprpaper/home.nix | 35 --- apps/hyprpaper/switch-wallpaper.nix | 57 ---- apps/jellyfin-tui/{home.nix => default.nix} | 0 apps/jellyfin/{home.nix => default.nix} | 0 apps/matugen/{home.nix => default.nix} | 0 apps/neovim/{neovim.nix => default.nix} | 0 apps/stylix/{home.nix => default.nix} | 0 apps/tte/default.nix | 14 + apps/tte/hakase-screensaver.nix | 14 - apps/tte/home.nix | 8 - apps/walker/{home.nix => default.nix} | 0 apps/waybar/default.nix | 331 ++++++++++++++++++++ apps/waybar/hakase-popup.nix | 169 ---------- apps/waybar/home.nix | 187 ----------- apps/yazi/{home.nix => default.nix} | 0 apps/zoxide/{home.nix => default.nix} | 0 modules/home/apps-optional.nix | 4 +- modules/home/apps.nix | 8 +- modules/home/hyprland.nix | 18 +- modules/home/music.nix | 4 +- modules/home/terminal.nix | 12 +- modules/home/theme.nix | 4 +- modules/home/waybar.nix | 5 +- {system => modules/system}/amd.nix | 0 {system => modules/system}/backlight.nix | 0 {system => modules/system}/boot.nix | 0 modules/system/default.nix | 30 +- {system => modules/system}/fonts.nix | 0 modules/system/gaming.nix | 26 +- {system => modules/system}/hardware.nix | 0 {system => modules/system}/home-manager.nix | 0 modules/system/hyprland.nix | 30 +- {system => modules/system}/kernel.nix | 0 {system => modules/system}/nix.nix | 0 {system => modules/system}/programs.nix | 0 {system => modules/system}/security.nix | 0 {system => modules/system}/services.nix | 0 {system => modules/system}/time.nix | 0 {system => modules/system}/user.nix | 0 {system => modules/system}/variables.nix | 0 {system => modules/system}/version.nix | 0 system/gtk.nix | 6 - system/steam.nix | 21 -- 57 files changed, 529 insertions(+), 607 deletions(-) rename apps/btop/{home.nix => default.nix} (100%) rename apps/cava/{home.nix => default.nix} (100%) rename apps/fastfetch/{home.nix => default.nix} (100%) rename apps/firefox/{home.nix => default.nix} (100%) rename apps/fish/{home.nix => default.nix} (100%) rename apps/gemini/{home.nix => default.nix} (100%) rename apps/ghostty/{home.nix => default.nix} (100%) rename apps/git/{home.nix => default.nix} (100%) rename apps/hypridle/{home.nix => default.nix} (100%) delete mode 100644 apps/hyprland/home.nix delete mode 100644 apps/hyprland/scripts/terminal.nix rename apps/hyprlock/{home.nix => default.nix} (100%) create mode 100644 apps/hyprpaper/default.nix delete mode 100644 apps/hyprpaper/home.nix delete mode 100644 apps/hyprpaper/switch-wallpaper.nix rename apps/jellyfin-tui/{home.nix => default.nix} (100%) rename apps/jellyfin/{home.nix => default.nix} (100%) rename apps/matugen/{home.nix => default.nix} (100%) rename apps/neovim/{neovim.nix => default.nix} (100%) rename apps/stylix/{home.nix => default.nix} (100%) create mode 100644 apps/tte/default.nix delete mode 100644 apps/tte/hakase-screensaver.nix delete mode 100644 apps/tte/home.nix rename apps/walker/{home.nix => default.nix} (100%) create mode 100644 apps/waybar/default.nix delete mode 100644 apps/waybar/hakase-popup.nix delete mode 100644 apps/waybar/home.nix rename apps/yazi/{home.nix => default.nix} (100%) rename apps/zoxide/{home.nix => default.nix} (100%) rename {system => modules/system}/amd.nix (100%) rename {system => modules/system}/backlight.nix (100%) rename {system => modules/system}/boot.nix (100%) rename {system => modules/system}/fonts.nix (100%) rename {system => modules/system}/hardware.nix (100%) rename {system => modules/system}/home-manager.nix (100%) rename {system => modules/system}/kernel.nix (100%) rename {system => modules/system}/nix.nix (100%) rename {system => modules/system}/programs.nix (100%) rename {system => modules/system}/security.nix (100%) rename {system => modules/system}/services.nix (100%) rename {system => modules/system}/time.nix (100%) rename {system => modules/system}/user.nix (100%) rename {system => modules/system}/variables.nix (100%) rename {system => modules/system}/version.nix (100%) delete mode 100644 system/gtk.nix delete mode 100644 system/steam.nix diff --git a/apps/btop/home.nix b/apps/btop/default.nix similarity index 100% rename from apps/btop/home.nix rename to apps/btop/default.nix diff --git a/apps/cava/home.nix b/apps/cava/default.nix similarity index 100% rename from apps/cava/home.nix rename to apps/cava/default.nix diff --git a/apps/fastfetch/home.nix b/apps/fastfetch/default.nix similarity index 100% rename from apps/fastfetch/home.nix rename to apps/fastfetch/default.nix diff --git a/apps/firefox/home.nix b/apps/firefox/default.nix similarity index 100% rename from apps/firefox/home.nix rename to apps/firefox/default.nix diff --git a/apps/fish/home.nix b/apps/fish/default.nix similarity index 100% rename from apps/fish/home.nix rename to apps/fish/default.nix diff --git a/apps/gemini/home.nix b/apps/gemini/default.nix similarity index 100% rename from apps/gemini/home.nix rename to apps/gemini/default.nix diff --git a/apps/ghostty/home.nix b/apps/ghostty/default.nix similarity index 100% rename from apps/ghostty/home.nix rename to apps/ghostty/default.nix diff --git a/apps/git/home.nix b/apps/git/default.nix similarity index 100% rename from apps/git/home.nix rename to apps/git/default.nix diff --git a/apps/hypridle/home.nix b/apps/hypridle/default.nix similarity index 100% rename from apps/hypridle/home.nix rename to apps/hypridle/default.nix diff --git a/apps/hyprland/default.nix b/apps/hyprland/default.nix index c101d69..d5f92fa 100644 --- a/apps/hyprland/default.nix +++ b/apps/hyprland/default.nix @@ -1,38 +1,15 @@ { - myConfig, - inputs, - pkgs, - ... -}: { - programs.hyprland = { - enable = true; - package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; - portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland; - withUWSM = true; - }; + imports = [ + ./hypr/binds.nix + ./hypr/general.nix + ./hypr/exec.nix + ./hypr/rules.nix + ./hypr/animation.nix + ./hypr/misc.nix + ./hypr/input.nix - environment.systemPackages = [ - pkgs.hyprpicker - pkgs.hyprlock - pkgs.hypridle - pkgs.hyprpaper - pkgs.hyprsunset - pkgs.hyprpolkitagent + ./scripts/movement.nix ]; - - xdg.terminal-exec = { - enable = true; - settings = { - default = ["${myConfig.terminal.default}"]; - }; - }; - - # systemd.user.services.hyprpolkitagent = { - # description = "Hyprland Polkit Agent"; - # wantedBy = ["graphical-session.target"]; - # serviceConfig = { - # ExecStart = "${pkgs.hyprpolkitagent}/libexec/hyprpolkitagent"; - # Restart = "on-failure"; - # }; - # }; + wayland.windowManager.hyprland.enable = true; + wayland.windowManager.hyprland.systemd.enable = false; # for UWSM support... } diff --git a/apps/hyprland/home.nix b/apps/hyprland/home.nix deleted file mode 100644 index d5f92fa..0000000 --- a/apps/hyprland/home.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ - imports = [ - ./hypr/binds.nix - ./hypr/general.nix - ./hypr/exec.nix - ./hypr/rules.nix - ./hypr/animation.nix - ./hypr/misc.nix - ./hypr/input.nix - - ./scripts/movement.nix - ]; - wayland.windowManager.hyprland.enable = true; - wayland.windowManager.hyprland.systemd.enable = false; # for UWSM support... -} diff --git a/apps/hyprland/scripts/terminal.nix b/apps/hyprland/scripts/terminal.nix deleted file mode 100644 index e0d3899..0000000 --- a/apps/hyprland/scripts/terminal.nix +++ /dev/null @@ -1,9 +0,0 @@ -{pkgs, ...}: let - hakase-terminal-launch = - pkgs.writeShellScriptBin "hakase-terminal-launch" '' - ''; -in { - home.packages = [ - hakase-terminal-launch - ]; -} diff --git a/apps/hyprlock/home.nix b/apps/hyprlock/default.nix similarity index 100% rename from apps/hyprlock/home.nix rename to apps/hyprlock/default.nix diff --git a/apps/hyprpaper/default.nix b/apps/hyprpaper/default.nix new file mode 100644 index 0000000..4213b32 --- /dev/null +++ b/apps/hyprpaper/default.nix @@ -0,0 +1,84 @@ +{ + pkgs, + config, + lib, + myConfig, + ... +}: let + wallpaperDir = "${config.home.homeDirectory}/.config/nixos/assets/Wallpapers"; + defaultWallpaper = "${wallpaperDir}/${myConfig.hyprland.wallpaper}"; + cacheWallpaper = "${config.home.homeDirectory}/.cache/current_wallpaper"; + + switch-wallpaper = pkgs.writeShellScriptBin "hakase-wallpaper-switch" '' + if [[ "$1" != "run" ]]; then + if command -v ghostty &> /dev/null; then + ghostty --class="org.hakase.switch-wallpaper" --title="Wallpaper Selector" -e bash -c "hakase-wallpaper-switch run || read -p 'Hit Enter to close...'" + exit 0 + elif command -v kitty &> /dev/null; then + kitty --class org.hakase.switch-wallpaper --title "Wallpaper Selector" -e bash -c "hakase-wallpaper-switch run || read -p 'Hit Enter to close...'" + exit 0 + fi + fi + + tmp_file=$(mktemp) + target_dir="$HOME/Pictures/Wallpapers" + if [ ! -d "$target_dir" ]; then + target_dir="$HOME" + fi + + # Ensure we are in a terminal that supports yazi + ${pkgs.yazi}/bin/yazi "$target_dir" --chooser-file="$tmp_file" + + if [ ! -f "$tmp_file" ]; then + echo "No selection file created." + exit 1 + fi + + WALLPAPER=$(cat "$tmp_file") + rm -f "$tmp_file" + + if [ -z "$WALLPAPER" ]; then + echo "No wallpaper selected." + exit 0 + fi + + # Persistence logic + CACHE_FILE="$HOME/.cache/current_wallpaper" + cp "$WALLPAPER" "$CACHE_FILE" + + # Reload hyprpaper + ${pkgs.hyprland}/bin/hyprctl hyprpaper unload all + ${pkgs.hyprland}/bin/hyprctl hyprpaper preload "$CACHE_FILE" + ${pkgs.hyprland}/bin/hyprctl hyprpaper wallpaper ",$CACHE_FILE" + + exec matugen image "$CACHE_FILE" + ''; +in { + services.hyprpaper = { + enable = true; + settings = { + preload = [cacheWallpaper]; + wallpaper = [ + ",${cacheWallpaper}" + ]; + }; + }; + + home.packages = [ + switch-wallpaper + ]; + + home.activation.setupWallpaper = lib.hm.dag.entryAfter ["writeBoundary"] '' + if [ ! -f "${cacheWallpaper}" ]; then + mkdir -p "$(dirname "${cacheWallpaper}")" + if [ -f "${defaultWallpaper}" ]; then + cp "${defaultWallpaper}" "${cacheWallpaper}" + else + echo "Default wallpaper not found at ${defaultWallpaper}" + touch "${cacheWallpaper}" + fi + fi + ''; + + systemd.user.startServices = "sd-switch"; +} \ No newline at end of file diff --git a/apps/hyprpaper/home.nix b/apps/hyprpaper/home.nix deleted file mode 100644 index cf302e3..0000000 --- a/apps/hyprpaper/home.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ - pkgs, - config, - lib, - myConfig, - ... -}: let - wallpaperDir = "${config.home.homeDirectory}/.config/nixos/assets/Wallpapers"; - defaultWallpaper = "${wallpaperDir}/${myConfig.hyprland.wallpaper}"; - cacheWallpaper = "${config.home.homeDirectory}/.cache/current_wallpaper"; -in { - services.hyprpaper = { - enable = true; - settings = { - preload = [cacheWallpaper]; - wallpaper = [ - ",${cacheWallpaper}" - ]; - }; - }; - - home.activation.setupWallpaper = lib.hm.dag.entryAfter ["writeBoundary"] '' - if [ ! -f "${cacheWallpaper}" ]; then - mkdir -p "$(dirname "${cacheWallpaper}")" - if [ -f "${defaultWallpaper}" ]; then - cp "${defaultWallpaper}" "${cacheWallpaper}" - else - echo "Default wallpaper not found at ${defaultWallpaper}" - touch "${cacheWallpaper}" - fi - fi - ''; - - systemd.user.startServices = "sd-switch"; -} diff --git a/apps/hyprpaper/switch-wallpaper.nix b/apps/hyprpaper/switch-wallpaper.nix deleted file mode 100644 index 27a9b72..0000000 --- a/apps/hyprpaper/switch-wallpaper.nix +++ /dev/null @@ -1,57 +0,0 @@ -{pkgs, ...}: { - # FIXME: please revise to use uwsm and xdg-terminal-exec - # also, add features and fix the following: - # * multiple wallpapers - # * day/noon/night wallpaper - # * set first, default wallpaper to hyprland one-dark - # * be consistent in formatting! - - # flow: - # Menu for options: 1. Single Wallpaper, 2. Multiple Wallpapers, 3. Timed Wallpapers - home.packages = with pkgs; [ - (writeShellScriptBin "hakase-wallpaper-switch" '' - if [[ "$1" != "run" ]]; then - if command -v ghostty &> /dev/null; then - ghostty --class="org.hakase.switch-wallpaper" --title="Wallpaper Selector" -e bash -c "hakase-wallpaper-switch run || read -p 'Hit Enter to close...'" - exit 0 - elif command -v kitty &> /dev/null; then - kitty --class org.hakase.switch-wallpaper --title "Wallpaper Selector" -e bash -c "hakase-wallpaper-switch run || read -p 'Hit Enter to close...'" - exit 0 - fi - fi - - tmp_file=$(mktemp) - target_dir="$HOME/Pictures/Wallpapers" - if [ ! -d "$target_dir" ]; then - target_dir="$HOME" - fi - - # Ensure we are in a terminal that supports yazi - ${pkgs.yazi}/bin/yazi "$target_dir" --chooser-file="$tmp_file" - - if [ ! -f "$tmp_file" ]; then - echo "No selection file created." - exit 1 - fi - - WALLPAPER=$(cat "$tmp_file") - rm -f "$tmp_file" - - if [ -z "$WALLPAPER" ]; then - echo "No wallpaper selected." - exit 0 - fi - - # Persistence logic - CACHE_FILE="$HOME/.cache/current_wallpaper" - cp "$WALLPAPER" "$CACHE_FILE" - - # Reload hyprpaper - ${pkgs.hyprland}/bin/hyprctl hyprpaper unload all - ${pkgs.hyprland}/bin/hyprctl hyprpaper preload "$CACHE_FILE" - ${pkgs.hyprland}/bin/hyprctl hyprpaper wallpaper ",$CACHE_FILE" - - exec matugen image "$CACHE_FILE" - '') - ]; -} diff --git a/apps/jellyfin-tui/home.nix b/apps/jellyfin-tui/default.nix similarity index 100% rename from apps/jellyfin-tui/home.nix rename to apps/jellyfin-tui/default.nix diff --git a/apps/jellyfin/home.nix b/apps/jellyfin/default.nix similarity index 100% rename from apps/jellyfin/home.nix rename to apps/jellyfin/default.nix diff --git a/apps/matugen/home.nix b/apps/matugen/default.nix similarity index 100% rename from apps/matugen/home.nix rename to apps/matugen/default.nix diff --git a/apps/neovim/neovim.nix b/apps/neovim/default.nix similarity index 100% rename from apps/neovim/neovim.nix rename to apps/neovim/default.nix diff --git a/apps/stylix/home.nix b/apps/stylix/default.nix similarity index 100% rename from apps/stylix/home.nix rename to apps/stylix/default.nix diff --git a/apps/tte/default.nix b/apps/tte/default.nix new file mode 100644 index 0000000..5036cba --- /dev/null +++ b/apps/tte/default.nix @@ -0,0 +1,14 @@ +{pkgs, ...}: let + hakase-screensaver-launch = pkgs.writeShellScriptBin "hakase-cmd-screensaver" '' + # Placeholder for actual screensaver logic if needed + echo "Screensaver placeholder" + ''; +in { + home.packages = with pkgs; [ + terminaltexteffects + hakase-screensaver-launch + ]; + home.file.".config/hakase/branding/screensaver.txt" = { + source = ../../assets/branding.txt; + }; +} \ No newline at end of file diff --git a/apps/tte/hakase-screensaver.nix b/apps/tte/hakase-screensaver.nix deleted file mode 100644 index 018396d..0000000 --- a/apps/tte/hakase-screensaver.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - pkgs, - lib, - ... -}: let - # - hakase-screensaver-launch = pkgs.writeShellScriptBin "hakase-cmd-screensaver" '' - - ''; -in { - home.packages = with pkgs; [ - hakase-screensaver-launch - ]; -} diff --git a/apps/tte/home.nix b/apps/tte/home.nix deleted file mode 100644 index 3d73688..0000000 --- a/apps/tte/home.nix +++ /dev/null @@ -1,8 +0,0 @@ -{pkgs, ...}: { - home.packages = with pkgs; [ - terminaltexteffects - ]; - home.file.".config/hakase/branding/screensaver.txt" = { - source = ../../assets/branding.txt; - }; -} diff --git a/apps/walker/home.nix b/apps/walker/default.nix similarity index 100% rename from apps/walker/home.nix rename to apps/walker/default.nix diff --git a/apps/waybar/default.nix b/apps/waybar/default.nix new file mode 100644 index 0000000..99fddce --- /dev/null +++ b/apps/waybar/default.nix @@ -0,0 +1,331 @@ +{ + config, + pkgs, + myConfig, + ... +}: let + # --- POPUP SCRIPTS --- + hakase-launch-or-focus = pkgs.writeShellScriptBin "hakase-launch-or-focus" '' + if (($# == 0)); then + echo "Usage: hakase-launch-or-focus [window-pattern] [launch-command]" + exit 1 + fi + + WINDOW_PATTERN="$1" + # Escaped Nix interpolation for shell default value logic + LAUNCH_COMMAND="''${2:- \"uwsm-app -- $WINDOW_PATTERN\"}" + + # Locate window address via hyprctl and jq + WINDOW_ADDRESS=$(${pkgs.hyprland}/bin/hyprctl clients -j | ${pkgs.jq}/bin/jq -r --arg p "$WINDOW_PATTERN" + '.[] | select((.class | test("\\b" + $p + "\\b"; "i")) or (.title | test("\\b" + $p + "\\b"; "i"))) | .address' | head -n1) + + if [[ -n $WINDOW_ADDRESS ]]; then + # If found, focus the existing window + ${pkgs.hyprland}/bin/hyprctl dispatch focuswindow "address:$WINDOW_ADDRESS" + else + # If not found, execute the launch command + eval exec setsid $LAUNCH_COMMAND + fi + ''; + + hakase-launch-tui = pkgs.writeShellScriptBin "hakase-launch-tui" '' + APP_NAME=$(basename "$1") + # Using org.hakase prefix so the focus script can find it via class name + exec setsid uwsm-app -- xdg-terminal-exec --app-id=org.hakase."$APP_NAME" -e "$@" + ''; + + hakase-focus-wrapper = pkgs.writeShellScriptBin "hakase-focus-wrapper" '' + APP_NAME=$(basename "$1") + WINDOW_PATTERN="org.hakase.$APP_NAME" + LAUNCH_CMD="hakase-launch-tui $*" + + exec hakase-launch-or-focus "$WINDOW_PATTERN" "$LAUNCH_CMD" + ''; + + hakase-launch-wifi = pkgs.writeShellScriptBin "hakase-launch-wifi" '' + # Use the focus wrapper to launch or switch to Impala + exec hakase-focus-wrapper impala + ''; + + hakase-launch-bluetooth = pkgs.writeShellScriptBin "hakase-launch-bluetooth" '' + exec hakase-focus-wrapper bluetui + ''; + + hakase-launch-popup = pkgs.writeShellScriptBin "hakase-launch-popup" '' + if (($# < 3)); then + echo "Usage: hakase-launch-popup [width] [height] [command...]" + exit 1 + fi + + # --- ARGS & CONFIG --- + WIN_WIDTH="$1" + WIN_HEIGHT="$2" + shift 2 + + MARGIN=10 + BAR_HEIGHT=40 + # --------------------- + + CMD_NAME=$(basename "$1") + TARGET_CLASS="org.hakase.popup.$CMD_NAME" + + # 1. SINGLETON LOGIC: Check for ANY existing hakase popup + EXISTING_JSON=$(${pkgs.hyprland}/bin/hyprctl clients -j | ${pkgs.jq}/bin/jq -r '.[] | select(.class | startswith("org.hakase.popup."))') + + if [[ -n "$EXISTING_JSON" ]]; then + OLD_ADDR=$(echo "$EXISTING_JSON" | ${pkgs.jq}/bin/jq -r '.address') + OLD_CLASS=$(echo "$EXISTING_JSON" | ${pkgs.jq}/bin/jq -r '.class') + + # Close the existing popup + ${pkgs.hyprland}/bin/hyprctl dispatch closewindow "address:$OLD_ADDR" + + if [[ "$OLD_CLASS" == "$TARGET_CLASS" ]]; then + exit 0 + fi + sleep 0.15 + fi + + # 2. Calculate Geometry + MONITOR_INFO=$(${pkgs.hyprland}/bin/hyprctl monitors -j | ${pkgs.jq}/bin/jq '.[] | select(.focused == true)') + MON_X=$(echo "$MONITOR_INFO" | ${pkgs.jq}/bin/jq '.x') + MON_Y=$(echo "$MONITOR_INFO" | ${pkgs.jq}/bin/jq '.y') + MON_WIDTH=$(echo "$MONITOR_INFO" | ${pkgs.jq}/bin/jq '.width') + + TARGET_X=$((MON_X + MON_WIDTH - WIN_WIDTH - MARGIN)) + TARGET_Y=$((MON_Y + BAR_HEIGHT + MARGIN)) + + # 3. Launch with Rules + RULE="[float;pin;size $WIN_WIDTH $WIN_HEIGHT;move $TARGET_X $TARGET_Y]" + ${pkgs.hyprland}/bin/hyprctl dispatch exec "$RULE xdg-terminal-exec --app-id=$TARGET_CLASS -e $@" + + # 4. Background Listener (Close on Blur) + ( + TIMEOUT=0 + WINDOW_ADDR="" + while [[ -z "$WINDOW_ADDR" && $TIMEOUT -lt 20 ]]; do + sleep 0.1 + WINDOW_ADDR=$(${pkgs.hyprland}/bin/hyprctl clients -j | ${pkgs.jq}/bin/jq -r --arg c "$TARGET_CLASS" '.[] | select(.class == $c) | .address') + ((TIMEOUT++)) + done + + if [[ -n "$WINDOW_ADDR" ]]; then + ${pkgs.socat}/bin/socat -U - UNIX-CONNECT:"$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" | while read -r line; do + if [[ "$line" == "activewindow>>"* ]]; then + NEW_FOCUS="0x$(echo "$line" | cut -d '>' -f3 | cut -d ',' -f1)" + if [[ "$WINDOW_ADDR" != "$NEW_FOCUS" ]]; then + ${pkgs.hyprland}/bin/hyprctl dispatch closewindow "address:$WINDOW_ADDR" + break + fi + fi + done + fi + ) & + + exit 0 + ''; + + hakase-popup-wifi = pkgs.writeShellScriptBin "hakase-popup-wifi" '' + exec hakase-launch-popup 800 500 impala + ''; + + hakase-popup-bluetooth = pkgs.writeShellScriptBin "hakase-popup-bluetooth" '' + exec hakase-launch-popup 600 500 bluetui + ''; + + hakase-popup-volume = pkgs.writeShellScriptBin "hakase-popup-volume" '' + exec hakase-launch-popup 800 300 wiremix + ''; +in { + imports = [ + ./style.nix + ]; + + home.packages = [ + pkgs.jq + pkgs.socat + pkgs.util-linux + pkgs.bluetui + pkgs.impala + pkgs.wiremix + pkgs.pamixer + + hakase-launch-popup + hakase-popup-wifi + hakase-popup-bluetooth + hakase-popup-volume + + hakase-launch-or-focus + hakase-launch-tui + hakase-focus-wrapper + hakase-launch-wifi + hakase-launch-bluetooth + ]; + + programs.waybar = { + enable = true; + settings = { + mainBar = { + reload_style_on_change = true; + layer = "top"; + position = "top"; + spacing = 0; + height = 26; + + modules-left = ["custom/omarchy" "hyprland/workspaces" "hyprland/workspaces#special"]; + modules-center = ["clock" "custom/update" "custom/screenrecording-indicator"]; + modules-right = [ + "group/tray-expander" + "bluetooth" + "network" + "pulseaudio" + "cpu" + "battery" + ]; + + "hyprland/workspaces" = { + on-click = "activate"; + show-special = false; + all-outputs = true; + format = "{icon}"; + format-icons = { + "default" = ""; + "1" = "1"; + "2" = "2"; + "3" = "3"; + "4" = "4"; + "5" = "5"; + "6" = "6"; + "7" = "7"; + "8" = "8"; + "9" = "9"; + "10" = "0"; + "active" = "󱓻"; + }; + persistent-workspaces = { + "1" = []; + "2" = []; + "3" = []; + "4" = []; + "5" = []; + }; + }; + + "hyprland/workspaces#special" = { + on-click = "activate"; + show-special = true; + special-visible-only = true; + all-outputs = true; + ignore-workspaces = ["1" "2" "3" "4" "5" "6" "7" "8" "9" "10"]; + format = "{icon}"; + format-icons = { + "special:youtube" = "󰗃"; + "special:music" = "󰎆"; + "special:steam" = "󰓓"; + }; + }; + + "custom/omarchy" = { + format = ""; + on-click = "omarchy-menu"; + on-click-right = "xdg-terminal-exec"; + tooltip-format = "Omarchy Menu\n\nSuper + Alt + Space"; + }; + + "cpu" = { + interval = 5; + format = "󰍛"; + on-click = "hakase-focus-wrapper btop"; + on-click-right = "xdg-terminal-exec"; + }; + + "clock" = { + format = "{:%H:%M %a %b %d}"; + format-alt = "{:L%d %B W%V %Y}"; + tooltip = false; + on-click-right = "omarchy-launch-floating-terminal-with-presentation omarchy-tz-select"; + }; + + "network" = { + format-icons = ["󰤯" "󰤟" "󰤢" "󰤥" "󰤨"]; + format = "{icon}"; + format-wifi = "{icon}"; + format-ethernet = "󰀂"; + format-disconnected = "󰤮"; + tooltip-format-wifi = "{essid} ({frequency} GHz)\n⇣{bandwidthDownBytes} ⇡{bandwidthUpBytes}"; + tooltip-format-ethernet = "⇣{bandwidthDownBytes} ⇡{bandwidthUpBytes}"; + tooltip-format-disconnected = "Disconnected"; + interval = 3; + spacing = 1; + on-click = "hakase-popup-wifi"; + }; + + "battery" = { + format = "{capacity}% {icon}"; + format-discharging = "{icon}"; + format-charging = "{icon}"; + format-plugged = ""; + format-icons = { + charging = ["󰢜" "󰂆" "󰂇" "󰂈" "󰢝" "󰂉" "󰢞" "󰂊" "󰂋" "󰂅"]; + default = ["󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"]; + }; + format-full = "󰂅"; + tooltip-format-discharging = "{power:>1.0f}W↓ {capacity}%"; + tooltip-format-charging = "{power:>1.0f}W↑ {capacity}%"; + interval = 5; + on-click = "omarchy-menu power"; + states = { + warning = 20; + critical = 10; + }; + }; + + "bluetooth" = { + format = ""; + format-disabled = "󰂲"; + format-connected = "󰂱"; + format-no-controller = ""; + tooltip-format = "Devices connected: {num_connections}"; + on-click = "hakase-popup-bluetooth"; + }; + + "pulseaudio" = { + format = "{icon}"; + on-click = "hakase-popup-volume"; + on-click-right = "pamixer -t"; + tooltip-format = "Playing at {volume}%"; + scroll-step = 5; + format-muted = ""; + format-icons = { + default = ["" "" ""]; + }; + }; + + "group/tray-expander" = { + orientation = "inherit"; + drawer = { + transition-duration = 600; + children-class = "tray-group-item"; + }; + modules = ["custom/expand-icon" "tray"]; + }; + + "custom/expand-icon" = { + format = ""; + tooltip = false; + }; + + "custom/screenrecording-indicator" = { + on-click = "omarchy-cmd-screenrecord"; + exec = "$OMARCHY_PATH/default/waybar/indicators/screen-recording.sh"; + signal = 8; + return-type = "json"; + }; + + "tray" = { + icon-size = 12; + spacing = 17; + }; + }; + }; + }; +} \ No newline at end of file diff --git a/apps/waybar/hakase-popup.nix b/apps/waybar/hakase-popup.nix deleted file mode 100644 index 1bfefbd..0000000 --- a/apps/waybar/hakase-popup.nix +++ /dev/null @@ -1,169 +0,0 @@ -{pkgs, ...}: let - # 1. The Brain: Logic to find a window or launch a new one - hakase-launch-or-focus = pkgs.writeShellScriptBin "hakase-launch-or-focus" '' - if (($# == 0)); then - echo "Usage: hakase-launch-or-focus [window-pattern] [launch-command]" - exit 1 - fi - - WINDOW_PATTERN="$1" - # Escaped Nix interpolation for shell default value logic - LAUNCH_COMMAND="''${2:-"uwsm-app -- $WINDOW_PATTERN"}" - - # Locate window address via hyprctl and jq - WINDOW_ADDRESS=$(${pkgs.hyprland}/bin/hyprctl clients -j | ${pkgs.jq}/bin/jq -r --arg p "$WINDOW_PATTERN" \ - '.[] | select((.class | test("\\b" + $p + "\\b"; "i")) or (.title | test("\\b" + $p + "\\b"; "i"))) | .address' | head -n1) - - if [[ -n $WINDOW_ADDRESS ]]; then - # If found, focus the existing window - ${pkgs.hyprland}/bin/hyprctl dispatch focuswindow "address:$WINDOW_ADDRESS" - else - # If not found, execute the launch command - eval exec setsid $LAUNCH_COMMAND - fi - ''; - - hakase-launch-tui = pkgs.writeShellScriptBin "hakase-launch-tui" '' - APP_NAME=$(basename "$1") - # Using org.hakase prefix so the focus script can find it via class name - exec setsid uwsm-app -- xdg-terminal-exec --app-id=org.hakase."$APP_NAME" -e "$@" - ''; - - hakase-focus-wrapper = pkgs.writeShellScriptBin "hakase-focus-wrapper" '' - APP_NAME=$(basename "$1") - WINDOW_PATTERN="org.hakase.$APP_NAME" - LAUNCH_CMD="hakase-launch-tui $*" - - exec hakase-launch-or-focus "$WINDOW_PATTERN" "$LAUNCH_CMD" - ''; - - hakase-launch-wifi = pkgs.writeShellScriptBin "hakase-launch-wifi" '' - # Unblock the WiFi radio (requires appropriate user groups/permissions) - # ${pkgs.util-linux}/bin/rfkill unblock wifi - - # Use the focus wrapper to launch or switch to Impala - exec hakase-focus-wrapper impala - ''; - - hakase-launch-bluetooth = - pkgs.writeShellScriptBin "hakase-launch-bluetooth" - '' - # ${pkgs.util-linux}/bin/rfkill unblock wifi - exec hakase-focus-wrapper bluetui - - ''; - hakase-launch-popup = pkgs.writeShellScriptBin "hakase-launch-popup" '' - if (($# < 3)); then - echo "Usage: hakase-launch-popup [width] [height] [command...]" - exit 1 - fi - - # --- ARGS & CONFIG --- - WIN_WIDTH="$1" - WIN_HEIGHT="$2" - shift 2 - - MARGIN=10 - BAR_HEIGHT=40 - # --------------------- - - CMD_NAME=$(basename "$1") - TARGET_CLASS="org.hakase.popup.$CMD_NAME" - - # 1. SINGLETON LOGIC: Check for ANY existing hakase popup - # We look for any client with a class starting with "org.hakase.popup." - EXISTING_JSON=$(${pkgs.hyprland}/bin/hyprctl clients -j | ${pkgs.jq}/bin/jq -r '.[] | select(.class | startswith("org.hakase.popup."))') - - if [[ -n "$EXISTING_JSON" ]]; then - OLD_ADDR=$(echo "$EXISTING_JSON" | ${pkgs.jq}/bin/jq -r '.address') - OLD_CLASS=$(echo "$EXISTING_JSON" | ${pkgs.jq}/bin/jq -r '.class') - - # Close the existing popup - ${pkgs.hyprland}/bin/hyprctl dispatch closewindow "address:$OLD_ADDR" - - # If the existing popup was the SAME one we are trying to launch, we are done (Toggle Off behavior) - if [[ "$OLD_CLASS" == "$TARGET_CLASS" ]]; then - exit 0 - fi - - # If it was a different popup, wait a tiny bit for Hyprland to process the close - # This prevents the new window from "merging" with the closing animation of the old one - sleep 0.15 - fi - - # 2. Calculate Geometry (Standard logic) - MONITOR_INFO=$(${pkgs.hyprland}/bin/hyprctl monitors -j | ${pkgs.jq}/bin/jq '.[] | select(.focused == true)') - MON_X=$(echo "$MONITOR_INFO" | ${pkgs.jq}/bin/jq '.x') - MON_Y=$(echo "$MONITOR_INFO" | ${pkgs.jq}/bin/jq '.y') - MON_WIDTH=$(echo "$MONITOR_INFO" | ${pkgs.jq}/bin/jq '.width') - - TARGET_X=$((MON_X + MON_WIDTH - WIN_WIDTH - MARGIN)) - TARGET_Y=$((MON_Y + BAR_HEIGHT + MARGIN)) - - # 3. Launch with Rules - RULE="[float;pin;size $WIN_WIDTH $WIN_HEIGHT;move $TARGET_X $TARGET_Y]" - ${pkgs.hyprland}/bin/hyprctl dispatch exec "$RULE xdg-terminal-exec --app-id=$TARGET_CLASS -e $@" - - # 4. Background Listener (Close on Blur) - ( - TIMEOUT=0 - WINDOW_ADDR="" - while [[ -z "$WINDOW_ADDR" && $TIMEOUT -lt 20 ]]; do - sleep 0.1 - WINDOW_ADDR=$(${pkgs.hyprland}/bin/hyprctl clients -j | ${pkgs.jq}/bin/jq -r --arg c "$TARGET_CLASS" '.[] | select(.class == $c) | .address') - ((TIMEOUT++)) - done - - if [[ -n "$WINDOW_ADDR" ]]; then - ${pkgs.socat}/bin/socat -U - UNIX-CONNECT:"$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" | while read -r line; do - if [[ "$line" == "activewindow>>"* ]]; then - NEW_FOCUS="0x$(echo "$line" | cut -d '>' -f3 | cut -d ',' -f1)" - # If focus is lost to another window, close this popup - if [[ "$WINDOW_ADDR" != "$NEW_FOCUS" ]]; then - ${pkgs.hyprland}/bin/hyprctl dispatch closewindow "address:$WINDOW_ADDR" - break - fi - fi - done - fi - ) & - - exit 0 - ''; - - # 1. WiFi (Impala) - Requires a larger view - hakase-popup-wifi = pkgs.writeShellScriptBin "hakase-popup-wifi" '' - exec hakase-launch-popup 800 500 impala - ''; - - # 2. Bluetooth (Bluetui) - Fits your specific test size - hakase-popup-bluetooth = pkgs.writeShellScriptBin "hakase-popup-bluetooth" '' - exec hakase-launch-popup 600 500 bluetui - ''; - - # 3. Volume (Wiremix) - Can be smaller - hakase-popup-volume = pkgs.writeShellScriptBin "hakase-popup-volume" '' - exec hakase-launch-popup 800 300 wiremix - ''; -in { - home.packages = [ - pkgs.jq - pkgs.socat # Required for the socket listener - pkgs.util-linux - pkgs.bluetui - pkgs.impala - pkgs.wiremix - pkgs.pamixer - - hakase-launch-popup - hakase-popup-wifi - hakase-popup-bluetooth - hakase-popup-volume - - hakase-launch-or-focus - hakase-launch-tui - hakase-focus-wrapper - hakase-launch-wifi - hakase-launch-bluetooth - ]; -} diff --git a/apps/waybar/home.nix b/apps/waybar/home.nix deleted file mode 100644 index ccbb085..0000000 --- a/apps/waybar/home.nix +++ /dev/null @@ -1,187 +0,0 @@ -{ - config, - pkgs, - myConfig, - ... -}: { - imports = [ - ./style.nix - ]; - programs.waybar = { - enable = true; - settings = { - mainBar = { - reload_style_on_change = true; - layer = "top"; - position = "top"; - spacing = 0; - height = 26; - - modules-left = ["custom/omarchy" "hyprland/workspaces" "hyprland/workspaces#special"]; - modules-center = ["clock" "custom/update" "custom/screenrecording-indicator"]; - modules-right = [ - "group/tray-expander" - "bluetooth" - "network" - "pulseaudio" - "cpu" - "battery" - ]; - - "hyprland/workspaces" = { - on-click = "activate"; - show-special = false; - all-outputs = true; - format = "{icon}"; - format-icons = { - "default" = ""; - "1" = "1"; - "2" = "2"; - "3" = "3"; - "4" = "4"; - "5" = "5"; - "6" = "6"; - "7" = "7"; - "8" = "8"; - "9" = "9"; - "10" = "0"; - "active" = "󱓻"; - }; - persistent-workspaces = { - "1" = []; - "2" = []; - "3" = []; - "4" = []; - "5" = []; - }; - }; - - "hyprland/workspaces#special" = { - on-click = "activate"; - show-special = true; - special-visible-only = true; - all-outputs = true; - ignore-workspaces = ["1" "2" "3" "4" "5" "6" "7" "8" "9" "10"]; - format = "{icon}"; - format-icons = { - "special:youtube" = "󰗃"; - "special:music" = "󰎆"; - "special:steam" = "󰓓"; - }; - }; - - "custom/omarchy" = { - format = ""; - on-click = "omarchy-menu"; - on-click-right = "xdg-terminal-exec"; - tooltip-format = "Omarchy Menu\n\nSuper + Alt + Space"; - }; - - # "custom/update" = { - # format = ""; - # exec = "omarchy-update-available"; - # on-click = "omarchy-launch-floating-terminal-with-presentation omarchy-update"; - # tooltip-format = "Omarchy update available"; - # signal = 7; - # interval = 21600; - # }; - - "cpu" = { - interval = 5; - format = "󰍛"; - on-click = "hakase-focus-wrapper btop"; - on-click-right = "xdg-terminal-exec"; - }; - - "clock" = { - format = "{:%H:%M %a %b %d}"; - format-alt = "{:L%d %B W%V %Y}"; - tooltip = false; - on-click-right = "omarchy-launch-floating-terminal-with-presentation omarchy-tz-select"; - }; - - "network" = { - format-icons = ["󰤯" "󰤟" "󰤢" "󰤥" "󰤨"]; - format = "{icon}"; - format-wifi = "{icon}"; - format-ethernet = "󰀂"; - format-disconnected = "󰤮"; - tooltip-format-wifi = "{essid} ({frequency} GHz)\n⇣{bandwidthDownBytes} ⇡{bandwidthUpBytes}"; - tooltip-format-ethernet = "⇣{bandwidthDownBytes} ⇡{bandwidthUpBytes}"; - tooltip-format-disconnected = "Disconnected"; - interval = 3; - spacing = 1; - on-click = "hakase-popup-wifi"; - }; - - "battery" = { - format = "{capacity}% {icon}"; - format-discharging = "{icon}"; - format-charging = "{icon}"; - format-plugged = ""; - format-icons = { - charging = ["󰢜" "󰂆" "󰂇" "󰂈" "󰢝" "󰂉" "󰢞" "󰂊" "󰂋" "󰂅"]; - default = ["󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"]; - }; - format-full = "󰂅"; - tooltip-format-discharging = "{power:>1.0f}W↓ {capacity}%"; - tooltip-format-charging = "{power:>1.0f}W↑ {capacity}%"; - interval = 5; - on-click = "omarchy-menu power"; - states = { - warning = 20; - critical = 10; - }; - }; - - "bluetooth" = { - format = ""; - format-disabled = "󰂲"; - format-connected = "󰂱"; - format-no-controller = ""; - tooltip-format = "Devices connected: {num_connections}"; - on-click = "hakase-popup-bluetooth"; - }; - - "pulseaudio" = { - format = "{icon}"; - on-click = "hakase-popup-volume"; - on-click-right = "pamixer -t"; - tooltip-format = "Playing at {volume}%"; - scroll-step = 5; - format-muted = ""; - format-icons = { - default = ["" "" ""]; - }; - }; - - "group/tray-expander" = { - orientation = "inherit"; - drawer = { - transition-duration = 600; - children-class = "tray-group-item"; - }; - modules = ["custom/expand-icon" "tray"]; - }; - - "custom/expand-icon" = { - format = ""; - tooltip = false; - }; - - "custom/screenrecording-indicator" = { - on-click = "omarchy-cmd-screenrecord"; - # Note: $OMARCHY_PATH must be defined in your environment - exec = "$OMARCHY_PATH/default/waybar/indicators/screen-recording.sh"; - signal = 8; - return-type = "json"; - }; - - "tray" = { - icon-size = 12; - spacing = 17; - }; - }; - }; - }; -} diff --git a/apps/yazi/home.nix b/apps/yazi/default.nix similarity index 100% rename from apps/yazi/home.nix rename to apps/yazi/default.nix diff --git a/apps/zoxide/home.nix b/apps/zoxide/default.nix similarity index 100% rename from apps/zoxide/home.nix rename to apps/zoxide/default.nix diff --git a/modules/home/apps-optional.nix b/modules/home/apps-optional.nix index 7e798d0..a1fee00 100644 --- a/modules/home/apps-optional.nix +++ b/modules/home/apps-optional.nix @@ -1,6 +1,6 @@ { imports = [ - ../../apps/btop/home.nix - ../../apps/jellyfin/home.nix + ../../apps/btop + ../../apps/jellyfin ]; } diff --git a/modules/home/apps.nix b/modules/home/apps.nix index 4aeac03..5c09542 100644 --- a/modules/home/apps.nix +++ b/modules/home/apps.nix @@ -1,8 +1,8 @@ { imports = [ - ../../apps/yazi/home.nix - ../../apps/gemini/home.nix - ../../apps/firefox/home.nix - # ../../apps/starship/home.nix + ../../apps/yazi + ../../apps/gemini + ../../apps/firefox + # ../../apps/starship ]; } diff --git a/modules/home/hyprland.nix b/modules/home/hyprland.nix index 7eb17ce..34d7ea0 100644 --- a/modules/home/hyprland.nix +++ b/modules/home/hyprland.nix @@ -1,13 +1,11 @@ { imports = [ - ../../apps/tte/hakase-screensaver.nix - ../../apps/hyprland/home.nix - ../../apps/hypridle/home.nix - ../../apps/hyprlock/home.nix - ../../apps/walker/home.nix - # ../../apps/fsel/home.nix - ../../apps/hyprpaper/home.nix - ../../apps/hyprpaper/switch-wallpaper.nix - ../../apps/tte/home.nix + ../../apps/hyprland + ../../apps/hypridle + ../../apps/hyprlock + ../../apps/walker + # ../../apps/fsel + ../../apps/hyprpaper + ../../apps/tte ]; -} +} \ No newline at end of file diff --git a/modules/home/music.nix b/modules/home/music.nix index ebaf5f4..7630905 100644 --- a/modules/home/music.nix +++ b/modules/home/music.nix @@ -24,8 +24,8 @@ ''; in { imports = [ - ../../apps/jellyfin-tui/home.nix - ../../apps/cava/home.nix + ../../apps/jellyfin-tui + ../../apps/cava ]; home.packages = [ launch-music diff --git a/modules/home/terminal.nix b/modules/home/terminal.nix index 645f9ba..bb3e8c8 100644 --- a/modules/home/terminal.nix +++ b/modules/home/terminal.nix @@ -1,10 +1,10 @@ { imports = [ - ../../apps/neovim/neovim.nix - ../../apps/git/home.nix - ../../apps/zoxide/home.nix - ../../apps/fish/home.nix - ../../apps/ghostty/home.nix - ../../apps/fastfetch/home.nix + ../../apps/neovim + ../../apps/git + ../../apps/zoxide + ../../apps/fish + ../../apps/ghostty + ../../apps/fastfetch ]; } diff --git a/modules/home/theme.nix b/modules/home/theme.nix index 56c7a69..5748f7f 100644 --- a/modules/home/theme.nix +++ b/modules/home/theme.nix @@ -1,6 +1,6 @@ { imports = [ - ../../apps/stylix/home.nix - ../../apps/matugen/home.nix + ../../apps/stylix + ../../apps/matugen ]; } diff --git a/modules/home/waybar.nix b/modules/home/waybar.nix index 7774d15..707dd77 100644 --- a/modules/home/waybar.nix +++ b/modules/home/waybar.nix @@ -1,6 +1,5 @@ { imports = [ - ../../apps/waybar/home.nix - ../../apps/waybar/hakase-popup.nix + ../../apps/waybar ]; -} +} \ No newline at end of file diff --git a/system/amd.nix b/modules/system/amd.nix similarity index 100% rename from system/amd.nix rename to modules/system/amd.nix diff --git a/system/backlight.nix b/modules/system/backlight.nix similarity index 100% rename from system/backlight.nix rename to modules/system/backlight.nix diff --git a/system/boot.nix b/modules/system/boot.nix similarity index 100% rename from system/boot.nix rename to modules/system/boot.nix diff --git a/modules/system/default.nix b/modules/system/default.nix index 8092d3f..7beb9a1 100644 --- a/modules/system/default.nix +++ b/modules/system/default.nix @@ -1,20 +1,20 @@ {pkgs, ...}: { imports = [ - ../../system/time.nix - ../../system/nix.nix - ../../system/backlight.nix - ../../system/boot.nix - ../../system/amd.nix - ../../system/hardware.nix - ../../system/home-manager.nix - ../../system/services.nix - ../../system/user.nix - ../../system/version.nix - ../../system/fonts.nix - ../../system/programs.nix - ../../system/security.nix - ../../system/variables.nix - ../../system/kernel.nix + ./time.nix + ./nix.nix + ./backlight.nix + ./boot.nix + ./amd.nix + ./hardware.nix + ./home-manager.nix + ./services.nix + ./user.nix + ./version.nix + ./fonts.nix + ./programs.nix + ./security.nix + ./variables.nix + ./kernel.nix ]; environment.systemPackages = with pkgs; [ # FIXME: must be on their own app diff --git a/system/fonts.nix b/modules/system/fonts.nix similarity index 100% rename from system/fonts.nix rename to modules/system/fonts.nix diff --git a/modules/system/gaming.nix b/modules/system/gaming.nix index 6e40a09..ca0a2be 100644 --- a/modules/system/gaming.nix +++ b/modules/system/gaming.nix @@ -1,5 +1,21 @@ -{ - imports = [ - ../../system/steam.nix - ]; -} +{pkgs, ...}: { + hardware.graphics = { + enable = true; + enable32Bit = true; # For 32-bit games + }; + + programs.steam = { + enable = true; + remotePlay.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + extest.enable = true; + gamescopeSession.enable = true; + extraCompatPackages = with pkgs; [ + proton-ge-bin + ]; + }; + + programs.gamemode.enable = true; + # Fix slow Steam Download speeds + services.resolved.enable = true; +} \ No newline at end of file diff --git a/system/hardware.nix b/modules/system/hardware.nix similarity index 100% rename from system/hardware.nix rename to modules/system/hardware.nix diff --git a/system/home-manager.nix b/modules/system/home-manager.nix similarity index 100% rename from system/home-manager.nix rename to modules/system/home-manager.nix diff --git a/modules/system/hyprland.nix b/modules/system/hyprland.nix index 2a59ce4..64b89ec 100644 --- a/modules/system/hyprland.nix +++ b/modules/system/hyprland.nix @@ -1,5 +1,29 @@ { - imports = [ - ../../apps/hyprland/default.nix + myConfig, + inputs, + pkgs, + ... +}: { + programs.hyprland = { + enable = true; + package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; + portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland; + withUWSM = true; + }; + + environment.systemPackages = [ + pkgs.hyprpicker + pkgs.hyprlock + pkgs.hypridle + pkgs.hyprpaper + pkgs.hyprsunset + pkgs.hyprpolkitagent ]; -} + + xdg.terminal-exec = { + enable = true; + settings = { + default = ["${myConfig.terminal.default}"]; + }; + }; +} \ No newline at end of file diff --git a/system/kernel.nix b/modules/system/kernel.nix similarity index 100% rename from system/kernel.nix rename to modules/system/kernel.nix diff --git a/system/nix.nix b/modules/system/nix.nix similarity index 100% rename from system/nix.nix rename to modules/system/nix.nix diff --git a/system/programs.nix b/modules/system/programs.nix similarity index 100% rename from system/programs.nix rename to modules/system/programs.nix diff --git a/system/security.nix b/modules/system/security.nix similarity index 100% rename from system/security.nix rename to modules/system/security.nix diff --git a/system/services.nix b/modules/system/services.nix similarity index 100% rename from system/services.nix rename to modules/system/services.nix diff --git a/system/time.nix b/modules/system/time.nix similarity index 100% rename from system/time.nix rename to modules/system/time.nix diff --git a/system/user.nix b/modules/system/user.nix similarity index 100% rename from system/user.nix rename to modules/system/user.nix diff --git a/system/variables.nix b/modules/system/variables.nix similarity index 100% rename from system/variables.nix rename to modules/system/variables.nix diff --git a/system/version.nix b/modules/system/version.nix similarity index 100% rename from system/version.nix rename to modules/system/version.nix diff --git a/system/gtk.nix b/system/gtk.nix deleted file mode 100644 index 34bfdfb..0000000 --- a/system/gtk.nix +++ /dev/null @@ -1,6 +0,0 @@ -{pkgs, ...}: { - gtk.iconTheme = { - name = "Papirus-Dark"; - package = pkgs.papirus-icon-theme; - }; -} diff --git a/system/steam.nix b/system/steam.nix deleted file mode 100644 index a555cf1..0000000 --- a/system/steam.nix +++ /dev/null @@ -1,21 +0,0 @@ -{pkgs, ...}: { - hardware.graphics = { - enable = true; - enable32Bit = true; # For 32-bit games - }; - - programs.steam = { - enable = true; - remotePlay.openFirewall = true; - localNetworkGameTransfers.openFirewall = true; - extest.enable = true; - gamescopeSession.enable = true; - extraCompatPackages = with pkgs; [ - proton-ge-bin - ]; - }; - - programs.gamemode.enable = true; - # Fix slow Steam Download speeds - services.resolved.enable = true; -}