From b79ffba8e8442a0deb21cea26f8d89f6fc0e0faa Mon Sep 17 00:00:00 2001 From: GHOSCHT <31184695+GHOSCHT@users.noreply.github.com> Date: Mon, 13 Jan 2025 17:40:41 +0100 Subject: [PATCH] Use lib function to get exe path instead of manually assigning /bin --- home/features/cli/fish.nix | 5 +---- home/ludwig.nix | 11 +++++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/home/features/cli/fish.nix b/home/features/cli/fish.nix index 69aab4c..a1cff54 100644 --- a/home/features/cli/fish.nix +++ b/home/features/cli/fish.nix @@ -6,15 +6,12 @@ }: let inherit (lib) mkIf; hasPackage = pname: lib.any (p: p ? pname && p.pname == pname) config.home.packages; - hasRipgrep = hasPackage "ripgrep"; hasLftp = hasPackage "lftp"; hasExa = hasPackage "eza"; hasLazygit = config.programs.lazygit.enable; hasLazydocker = hasPackage "lazydocker"; hasNixYourShell = hasPackage "nix-your-shell"; - hasShellColor = config.programs.shellcolor.enable; hasWezterm = config.programs.wezterm.enable; - shellcolor = "${pkgs.shellcolord}/bin/shellcolor"; in { programs.fish = { enable = true; @@ -104,6 +101,6 @@ in { # Applies tide configure on rebuild home.activation.configureTide = lib.hm.dag.entryAfter ["writeBoundary"] '' - ${pkgs.fish}/bin/fish -c "fish_init_custom" + ${lib.getExe pkgs.fish} -c "fish_init_custom" ''; } diff --git a/home/ludwig.nix b/home/ludwig.nix index 36e8444..248485a 100644 --- a/home/ludwig.nix +++ b/home/ludwig.nix @@ -1,4 +1,7 @@ -{ pkgs, ... }: { +{ lib +, pkgs +, ... +}: { imports = [ ./global ./features/desktop/awesome @@ -22,14 +25,14 @@ wayland.windowManager.hyprland = { settings = { exec-once = [ - "${pkgs.batsignal}/bin/batsignal -c 20 -w 30 -f 80 -n BAT0 -a Battery" + "${lib.getExe pkgs.batsignal} -c 20 -w 30 -f 80 -n BAT0 -a Battery" ]; bind = [ ", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+" ", XF86AudioLowerVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%-" ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" - ", XF86MonBrightnessUp, exec, ${pkgs.brightnessctl}/bin/brightnessctl set +10%" - ", XF86MonBrightnessDown, exec, ${pkgs.brightnessctl}/bin/brightnessctl set 10%-" + ", XF86MonBrightnessUp, exec, ${lib.getExe pkgs.brightnessctl} set +10%" + ", XF86MonBrightnessDown, exec, ${lib.getExe pkgs.brightnessctl} set 10%-" ]; }; };