treewide: use 'lib.getExe' when possible
Don't use it in wireguard to keep it consistent, as only half the commands could use it.
This commit is contained in:
parent
8f818b8611
commit
9f7472222c
|
@ -8,7 +8,7 @@ let
|
|||
realName = lib.mkDefault "Bruno BELANYI";
|
||||
userName = lib.mkDefault (mkMailAddress address domain);
|
||||
passwordCommand =
|
||||
lib.mkDefault [ "${pkgs.ambroisie.bw-pass}/bin/bw-pass" "Mail" passName ];
|
||||
lib.mkDefault [ (lib.getExe pkgs.ambroisie.bw-pass) "Mail" passName ];
|
||||
|
||||
address = mkMailAddress address domain;
|
||||
aliases = builtins.map (lib.flip mkMailAddress domain) aliases;
|
||||
|
|
|
@ -9,7 +9,7 @@ in
|
|||
settings = {
|
||||
notify-cmd =
|
||||
let
|
||||
notify-send = "${pkgs.libnotify}/bin/notify-send";
|
||||
notify-send = lib.getExe pkgs.libnotify;
|
||||
in
|
||||
pkgs.writeScript "mail-notifier" ''
|
||||
SENDER="$1"
|
||||
|
|
|
@ -47,8 +47,8 @@ in
|
|||
|
||||
command = mkOption {
|
||||
type = types.str;
|
||||
default = "${pkgs.i3lock}/bin/i3lock -n -c 000000";
|
||||
example = "\${pkgs.i3lock}/bin/i3lock -n -i lock.png";
|
||||
default = "${lib.getExe pkgs.i3lock} -n -c 000000";
|
||||
example = "\${lib.getExe pkgs.i3lock} -n -i lock.png";
|
||||
description = "Locker command to run";
|
||||
};
|
||||
|
||||
|
|
|
@ -27,13 +27,13 @@ let
|
|||
genMovementBindings = f: addVimKeyBindings (lib.my.genAttrs' movementKeys f);
|
||||
|
||||
# Used in multiple scripts to show messages through keybindings
|
||||
notify-send = "${pkgs.libnotify}/bin/notify-send";
|
||||
notify-send = lib.getExe pkgs.libnotify;
|
||||
|
||||
# Screen backlight management
|
||||
changeBacklight = "${pkgs.ambroisie.change-backlight}/bin/change-backlight";
|
||||
changeBacklight = lib.getExe pkgs.ambroisie.change-backlight;
|
||||
|
||||
# Audio and volume management
|
||||
changeAudio = "${pkgs.ambroisie.change-audio}/bin/change-audio";
|
||||
changeAudio = lib.getExe pkgs.ambroisie.change-audio;
|
||||
|
||||
# Lock management
|
||||
toggleXautolock =
|
||||
|
|
|
@ -5,7 +5,7 @@ let
|
|||
notficationCmd =
|
||||
let
|
||||
duration = toString (cfg.notify.delay * 1000);
|
||||
notifyCmd = "${pkgs.libnotify}/bin/notify-send -u critical -t ${duration}";
|
||||
notifyCmd = "${lib.getExe pkgs.libnotify} -u critical -t ${duration}";
|
||||
in
|
||||
# Needs to be surrounded by quotes for systemd to launch it correctly
|
||||
''"${notifyCmd} -- 'Locking in ${toString cfg.notify.delay} seconds'"'';
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
let
|
||||
cfg = config.my.services.drone;
|
||||
hasRunner = (name: builtins.elem name cfg.runners);
|
||||
dockerPkg = pkgs.drone-runner-docker;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf (cfg.enable && hasRunner "docker") {
|
||||
|
@ -25,7 +24,7 @@ in
|
|||
EnvironmentFile = [
|
||||
cfg.sharedSecretFile
|
||||
];
|
||||
ExecStart = "${dockerPkg}/bin/drone-runner-docker";
|
||||
ExecStart = lib.getExe pkgs.drone-runner-docker;
|
||||
User = "drone-runner-docker";
|
||||
Group = "drone-runner-docker";
|
||||
};
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
let
|
||||
cfg = config.my.services.drone;
|
||||
hasRunner = (name: builtins.elem name cfg.runners);
|
||||
execPkg = pkgs.drone-runner-exec;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf (cfg.enable && hasRunner "exec") {
|
||||
|
@ -53,7 +52,7 @@ in
|
|||
EnvironmentFile = [
|
||||
cfg.sharedSecretFile
|
||||
];
|
||||
ExecStart = "${execPkg}/bin/drone-runner-exec";
|
||||
ExecStart = lib.getExe pkgs.drone-runner-exec;
|
||||
User = "drone-runner-exec";
|
||||
Group = "drone-runner-exec";
|
||||
};
|
||||
|
|
|
@ -30,7 +30,7 @@ in
|
|||
|
||||
serviceConfig = {
|
||||
ExecStart = lib.concatStringsSep " " [
|
||||
"${pkgs.flood}/bin/flood"
|
||||
(lib.getExe pkgs.flood)
|
||||
"--port ${builtins.toString cfg.port}"
|
||||
"--rundir /var/lib/${cfg.stateDir}"
|
||||
];
|
||||
|
|
|
@ -4,8 +4,6 @@ let
|
|||
cfg = config.my.services.lohr;
|
||||
settingsFormat = pkgs.formats.yaml { };
|
||||
|
||||
lohrPkg = pkgs.ambroisie.lohr;
|
||||
|
||||
lohrStateDirectory = "lohr";
|
||||
lohrHome = "/var/lib/lohr/";
|
||||
in
|
||||
|
@ -80,7 +78,7 @@ in
|
|||
let
|
||||
configFile = settingsFormat.generate "lohr-config.yaml" cfg.setting;
|
||||
in
|
||||
"${lohrPkg}/bin/lohr --config ${configFile}";
|
||||
"${lib.getExe pkgs.ambroisie.lohr} --config ${configFile}";
|
||||
StateDirectory = lohrStateDirectory;
|
||||
WorkingDirectory = lohrHome;
|
||||
User = "lohr";
|
||||
|
|
|
@ -60,7 +60,7 @@ in
|
|||
WorkingDirectory = "/var/lib/nginx-sso";
|
||||
# The files to be merged might not have the correct permissions
|
||||
ExecStartPre = ''+${pkgs.writeScript "merge-nginx-sso-config" ''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
#!${lib.getExe pkgs.bash}
|
||||
rm -f '${confPath}'
|
||||
${utils.genJqSecretsReplacementSnippet cfg.configuration confPath}
|
||||
|
||||
|
@ -70,7 +70,7 @@ in
|
|||
''
|
||||
}'';
|
||||
ExecStart = lib.mkForce ''
|
||||
${pkg}/bin/nginx-sso \
|
||||
${lib.getExe pkg} \
|
||||
--config ${confPath} \
|
||||
--frontend-dir ${pkg}/share/frontend
|
||||
'';
|
||||
|
|
|
@ -12,7 +12,7 @@ buildGoModule rec {
|
|||
vendorHash = null;
|
||||
|
||||
postPatch = ''
|
||||
sed -i -e 's,"mpv","${mpv}/bin/mpv",' ff2mpv.go
|
||||
sed -i -e 's,"mpv","${lib.getExe mpv}",' ff2mpv.go
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
|
|
|
@ -10,7 +10,7 @@ stdenvNoCC.mkDerivation {
|
|||
installPhase =
|
||||
let
|
||||
gawkCmd = lib.concatStringsSep " " [
|
||||
''${gawk}/bin/awk''
|
||||
(lib.getExe gawk)
|
||||
'''{sub(/\r$/,"")}''
|
||||
''{sub(/^127\.0\.0\.1/,"0.0.0.0")}''
|
||||
''BEGIN { OFS = "" }''
|
||||
|
|
Loading…
Reference in a new issue