From 47590abc3a6d9c4417028127ed7098d0c4e50bba Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Wed, 22 Mar 2023 21:17:15 -0400 Subject: [PATCH] lazy evaluated let for rofi --- modules/nixos/graphical/rofi.nix | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/modules/nixos/graphical/rofi.nix b/modules/nixos/graphical/rofi.nix index a0e75d6..482a3be 100644 --- a/modules/nixos/graphical/rofi.nix +++ b/modules/nixos/graphical/rofi.nix @@ -1,6 +1,10 @@ { config, pkgs, lib, ... }: -{ +let + + rofi = config.home-manager.users.${config.user}.programs.rofi.finalPackage; + +in { config = lib.mkIf (pkgs.stdenv.isLinux && config.services.xserver.enable) { @@ -148,21 +152,14 @@ }; - launcherCommand = "${ - config.home-manager.users.${config.user}.programs.rofi.finalPackage - }/bin/rofi -show run -modi run"; + launcherCommand = "${rofi}/bin/rofi -show run -modi run"; systemdSearch = "${pkgs.rofi-systemd}/bin/rofi-systemd"; - altTabCommand = "${ - config.home-manager.users.${config.user}.programs.rofi.finalPackage - }/bin/rofi -show window -modi window"; + altTabCommand = "${rofi}/bin/rofi -show window -modi window"; audioSwitchCommand = "${ (pkgs.extraLib.mkScript { name = "switch-audio"; file = ./rofi/pulse-sink.sh; - env = [ - pkgs.ponymix - config.home-manager.users.${config.user}.programs.rofi.finalPackage - ]; + env = [ pkgs.ponymix rofi ]; }) }/bin/switch-audio"; };