treewide: use lib.getExe

This commit is contained in:
Guanran Wang 2023-12-16 22:48:27 +08:00
parent 5746458b7a
commit b3ed736c15
Signed by: nyancat
SSH key fingerprint: SHA256:8oWGKciPALWut/6WA27oFKofX+6Wtc0gQnsefXLQx/8
5 changed files with 21 additions and 16 deletions

View file

@ -8,8 +8,8 @@
programs.gamemode = {
enable = true;
settings.custom = {
start = "${pkgs.libnotify}/bin/notify-send 'GameMode Activated' 'GameMode Activated! Enjoy enhanced performance. 🚀'";
end = "${pkgs.libnotify}/bin/notify-send 'GameMode Deactivated' 'GameMode Deactivated. Back to normal mode. '";
start = "${lib.getExe pkgs.libnotify} 'GameMode Activated' 'GameMode Activated! Enjoy enhanced performance. 🚀'";
end = "${lib.getExe pkgs.libnotify} 'GameMode Deactivated' 'GameMode Deactivated. Back to normal mode. '";
};
};

View file

@ -1,9 +1,13 @@
{pkgs, ...}: {
{
pkgs,
lib,
...
}: {
programs.rofi = {
enable = true;
package = pkgs.rofi-wayland;
font = "monospace";
terminal = "${pkgs.alacritty}/bin/alacritty";
terminal = lib.getExe pkgs.alacritty;
};
home.packages = with pkgs; [rofi-power-menu];

View file

@ -47,14 +47,14 @@
systemd.xdgAutostart = true;
config = {
### Default Applications
terminal = "${pkgs.alacritty}/bin/alacritty";
menu = "${pkgs.rofi}/bin/rofi";
terminal = lib.getExe pkgs.alacritty;
menu = lib.getExe config.programs.rofi.package;
### Visuals
#window.titlebar = false;
bars = [
{
command = "${pkgs.waybar}/bin/waybar";
command = lib.getExe pkgs.waybar;
}
#{
# statusCommand = "${lib.getExe pkgs.i3status-rust} $HOME/.config/i3status-rust/config-default.toml";
@ -143,7 +143,7 @@
# Rofi
"${modifier}+d" = "exec ${menu} -show drun -show-icons -icon-theme ${config.gtk.iconTheme.name}";
"${modifier}+Shift+d" = "exec ${pkgs.cliphist}/bin/cliphist list | ${menu} -dmenu | ${pkgs.cliphist}/bin/cliphist decode | ${pkgs.wl-clipboard}/bin/wl-copy";
"${modifier}+Shift+d" = "exec ${lib.getExe pkgs.cliphist} list | ${menu} -dmenu | ${lib.getExe pkgs.cliphist} decode | ${pkgs.wl-clipboard}/bin/wl-copy";
"${modifier}+Shift+l" = ''exec ${menu} -modi "power-menu:rofi-power-menu --confirm=reboot/shutdown" -show power-menu'';
# Screenshot
@ -157,12 +157,12 @@
"XF86AudioRaiseVolume" = "exec ${setVolume} up";
"XF86AudioLowerVolume" = "exec ${setVolume} down";
"XF86AudioMute" = "exec ${setVolume} mute";
"XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
"XF86AudioPause" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
"XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous";
"XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next";
"XF86AudioStop" = "exec ${pkgs.playerctl}/bin/playerctl stop";
"XF86AudioMedia" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
"XF86AudioPlay" = "exec ${lib.getExe pkgs.playerctl} play-pause";
"XF86AudioPause" = "exec ${lib.getExe pkgs.playerctl} play-pause";
"XF86AudioPrev" = "exec ${lib.getExe pkgs.playerctl} previous";
"XF86AudioNext" = "exec ${lib.getExe pkgs.playerctl} next";
"XF86AudioStop" = "exec ${lib.getExe pkgs.playerctl} stop";
"XF86AudioMedia" = "exec ${lib.getExe pkgs.playerctl} play-pause";
};
};
};

View file

@ -17,7 +17,7 @@
timeouts = [
{
timeout = 60 * 9;
command = ''${pkgs.libnotify}/bin/notify-send -u critical --expire-time 60000 "60 seconds until lock!"'';
command = ''${lib.getExe pkgs.libnotify} -u critical --expire-time 60000 "60 seconds until lock!"'';
}
{
timeout = 60 * 10;

View file

@ -2,6 +2,7 @@
pkgs,
config,
inputs,
lib,
...
}: {
### sops-nix
@ -34,7 +35,7 @@
WorkingDirectory = "/etc/clash-meta";
User = [config.users.users."clash-meta".name];
Group = [config.users.groups."clash-meta".name];
ExecStart = "${pkgs.clash-meta}/bin/clash-meta -d /etc/clash-meta";
ExecStart = "${lib.getExe pkgs.clash-meta} -d /etc/clash-meta";
Restart = "on-failure";
CapabilityBoundingSet = [
"CAP_NET_ADMIN"