diff --git a/modules/home/environment/hyprland.nix b/modules/home/environment/hyprland.nix index 0e5cd96..721f469 100755 --- a/modules/home/environment/hyprland.nix +++ b/modules/home/environment/hyprland.nix @@ -1,4 +1,4 @@ -{inputs, pkgs, lib, config, username, host, ... }: let +{inputs, pkgs, lib, config, self, host, ... }: let desktop = host == "oganesson"; screenshot_bind = if desktop @@ -10,7 +10,9 @@ "super, insert, exec, grimblast copy area" ]; scheme = config.lib.stylix.colors; + in { + options = { movOpts.hyprlandConfig.enable = lib.mkEnableOption "enables my hyprland config"; }; @@ -56,7 +58,7 @@ in { "systemctl --user import-environment &" "hash dbus-update-activation-environment 2>/dev/null &" "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP &" - "aplay /home/${username}/sound/sys/login.wav &" + "aplay ${self}/assets/sound/login.wav &" ]; workspace = diff --git a/modules/home/environment/userpkgs.nix b/modules/home/environment/userpkgs.nix index 1f33f2e..75251c5 100755 --- a/modules/home/environment/userpkgs.nix +++ b/modules/home/environment/userpkgs.nix @@ -1,4 +1,4 @@ -{lib, config, pkgs, ... }: +{lib, config, pkgs, self, ... }: let extraFigletFonts = pkgs.fetchFromGitHub { diff --git a/modules/home/environment/waybar.nix b/modules/home/environment/waybar.nix index 195d098..2fa805e 100755 --- a/modules/home/environment/waybar.nix +++ b/modules/home/environment/waybar.nix @@ -104,14 +104,14 @@ in { higher_cutoff_freq = 10000; method = "pulse"; source = "auto"; - hide_on_silence = true; + hide_on_silence = false; stereo = true; reverse = true; bar_delimiter = 0; monstercat = false; waves = false; noise_reduction = 0.77; - input_delay = 2; + input_delay = 1; format-icons = ["▁" "▂" "▃" "▄" "▅" "▆" "▇" "█"]; }; @@ -361,6 +361,7 @@ in { } window#waybar.empty #window { background: none; + border: none; } #workspaces { diff --git a/modules/home/programs/nixvim/plugins/lsp.nix b/modules/home/programs/nixvim/plugins/lsp.nix index b2cd2b7..0587e64 100755 --- a/modules/home/programs/nixvim/plugins/lsp.nix +++ b/modules/home/programs/nixvim/plugins/lsp.nix @@ -1,4 +1,3 @@ -{ pkgs }: { programs.nixvim = { plugins = { diff --git a/modules/home/scripts/commands/vipkg.nix b/modules/home/scripts/commands/vipkg.nix new file mode 100644 index 0000000..8673ddb --- /dev/null +++ b/modules/home/scripts/commands/vipkg.nix @@ -0,0 +1,54 @@ +{ pkgs ? import { } }: +let + nixpkgs_toplevel = pkgs.fetchFromGitHub { + owner = "NixOS"; + repo = "nixpkgs"; + rev = "63dacb46bf939521bdc93981b4cbb7ecb58427a0"; + hash = "sha256-vboIEwIQojofItm2xGCdZCzW96U85l9nDW3ifMuAIdM="; + }; +in +pkgs.writeShellApplication { + name = "vipkg"; + runtimeInputs = with pkgs; [ + coreutils + fd + ripgrep + fzf + ]; + text = '' + [ ! $# -eq 1 ] && echo "Usage: vipkg " && exit 1 + + results=$(find "${nixpkgs_toplevel}/pkgs" -wholename "*$1*" -exec find {} \; | sort | uniq | rg '\.nix$') + numresults=$(echo "$results" | wc -l) + + [ "$numresults" -eq 0 ] && echo "$1 not found in ${nixpkgs_toplevel}/pkgs" && exit 1 + + if [ "$numresults" -gt 1 ]; then + # Trim the path to show only package directory and .nix file (e.g., package/default.nix) + results=$(echo "$results" | awk -F"${nixpkgs_toplevel}/pkgs/" '{print $2}') + + file=$(echo "$results" | fzf) + + full_path="${nixpkgs_toplevel}/pkgs/$file" + + # Check if the file contains any non-UTF-8 characters + if grep --color='auto' -P -q "[^\x00-\x7F]" "$full_path"; then + NIXD_FLAGS="--semantic-tokens=false" nvim "$full_path" + else + nvim "$full_path" + fi + + else + # Trim the path for the single result case + result_path=$(echo "$results" | awk -F"${nixpkgs_toplevel}/pkgs/" '{print $2}') + full_path="${nixpkgs_toplevel}/pkgs/$result_path" + + # Check if the file contains any non-UTF-8 characters + if grep --color='auto' -P -q "[^\x00-\x7F]" "$full_path"; then + NIXD_FLAGS="--semantic-tokens=false" nvim "$full_path" + else + nvim "$full_path" + fi + fi + ''; +} diff --git a/modules/home/scripts/default.nix b/modules/home/scripts/default.nix index 08ed0df..13330c8 100755 --- a/modules/home/scripts/default.nix +++ b/modules/home/scripts/default.nix @@ -6,6 +6,7 @@ pkgs, ... }: let + vipkg = import ./commands/vipkg.nix { inherit pkgs; }; keyring = import ./wm-controls/keyring.nix { inherit pkgs; }; invoke = import ./commands/invoke.nix { inherit pkgs; }; splash = import ./commands/splash.nix { inherit pkgs; }; @@ -42,7 +43,9 @@ in { movOpts.movScripts.nixShortcuts.enable = lib.mkEnableOption "Enables all Nix shortcut scripts"; - # Individual options using scriptOverride or mkEnableOption directly + # Command Scripts + movOpts.movScripts.commandScripts.vipkg.enable = + scriptOverride "Search through the nixpkgs/pkgs directory for a package derivation. Useful for overrides." "commandScripts" "vipkg"; movOpts.movScripts.commandScripts.icanhazip.enable = scriptOverride "Enables the icanhazip command" "commandScripts" "icanhazip"; movOpts.movScripts.commandScripts.invoke.enable = @@ -56,6 +59,7 @@ in { movOpts.movScripts.commandScripts.viconf.enable = scriptOverride "Enables the viconf command" "commandScripts" "viconf"; + # Hyprland Controls movOpts.movScripts.hyprlandControls.chpaper.enable = scriptOverride "Enables the chpaper command" "hyprlandControls" "chpaper"; movOpts.movScripts.hyprlandControls.scheck.enable = @@ -72,6 +76,7 @@ in { scriptOverride "Generates screenshots, and updates the README.md with the current rev hash" "hyprlandControls" "switchmon"; + # Nix Shortcuts movOpts.movScripts.nixShortcuts.garbage-collect.enable = scriptOverride "Enables the garbage-collect script" "nixShortcuts" "garbage-collect"; movOpts.movScripts.nixShortcuts.nsp.enable = @@ -81,13 +86,17 @@ in { }; config = lib.mkIf config.movOpts.movScripts.enable { - home.packages = lib.optionals config.movOpts.movScripts.commandScripts.invoke.enable [ invoke ] + home.packages = + lib.optionals config.movOpts.movScripts.commandScripts.invoke.enable [ invoke ] + # Command Scripts Overrides + ++ lib.optionals config.movOpts.movScripts.commandScripts.vipkg.enable [ vipkg ] ++ lib.optionals config.movOpts.movScripts.commandScripts.runbg.enable [ runbg ] ++ lib.optionals config.movOpts.movScripts.commandScripts.icanhazip.enable [ icanhazip ] ++ lib.optionals config.movOpts.movScripts.commandScripts.splash.enable [ splash ] ++ lib.optionals config.movOpts.movScripts.commandScripts.toolbelt.enable [ toolbelt ] ++ lib.optionals config.movOpts.movScripts.commandScripts.viconf.enable [ viconf ] + # Hyprland Controls Overrides ++ lib.optionals config.movOpts.movScripts.hyprlandControls.chpaper.enable [ chpaper ] ++ lib.optionals config.movOpts.movScripts.hyprlandControls.scheck.enable [ scheck ] ++ lib.optionals config.movOpts.movScripts.hyprlandControls.chscheme.enable [ chscheme ] @@ -96,6 +105,7 @@ in { ++ lib.optionals config.movOpts.movScripts.hyprlandControls.switchmon.enable [ switchmon ] ++ lib.optionals config.movOpts.movScripts.hyprlandControls.mkscreenshots.enable [ mkscreenshots ] + # Nix Shortcuts Overrides ++ lib.optionals config.movOpts.movScripts.nixShortcuts.garbage-collect.enable [ garbage-collect ] ++ lib.optionals config.movOpts.movScripts.nixShortcuts.nsp.enable [ nsp ] ++ lib.optionals config.movOpts.movScripts.nixShortcuts.rebuild.enable [ rebuild ];