Add missing programs to $PATH
in scripts
This commit is contained in:
parent
466c687ba5
commit
ac265706dd
1 changed files with 49 additions and 18 deletions
|
@ -1,4 +1,4 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, osConfig, pkgs, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.programs.rclone;
|
cfg = config.programs.rclone;
|
||||||
targetName = "rclone";
|
targetName = "rclone";
|
||||||
|
@ -411,17 +411,30 @@ in {
|
||||||
|
|
||||||
ExecStartPre =
|
ExecStartPre =
|
||||||
let
|
let
|
||||||
script = pkgs.writeShellScriptBin "rclone-pre" ''
|
script = pkgs.writeShellApplication {
|
||||||
${pkgs.coreutils}/bin/sleep 10
|
name = "rclone-pre";
|
||||||
'';
|
runtimeInputs = [
|
||||||
|
pkgs.coreutils
|
||||||
|
];
|
||||||
|
|
||||||
|
text = ''
|
||||||
|
sleep 10
|
||||||
|
'';
|
||||||
|
};
|
||||||
in
|
in
|
||||||
(lib.getExe script);
|
(lib.getExe script);
|
||||||
|
|
||||||
ExecStart =
|
ExecStart =
|
||||||
let
|
let
|
||||||
script = pkgs.writeShellScriptBin "rclone" ''
|
script = pkgs.writeShellApplication {
|
||||||
systemctl --user start rclone.target
|
name = "rclone";
|
||||||
'';
|
runtimeInputs = [
|
||||||
|
pkgs.systemd
|
||||||
|
];
|
||||||
|
text = ''
|
||||||
|
systemctl --user start rclone.target
|
||||||
|
'';
|
||||||
|
};
|
||||||
in
|
in
|
||||||
(lib.getExe script);
|
(lib.getExe script);
|
||||||
};
|
};
|
||||||
|
@ -456,21 +469,39 @@ in {
|
||||||
configFile = pkgs.writeText
|
configFile = pkgs.writeText
|
||||||
"${serviceName}.conf"
|
"${serviceName}.conf"
|
||||||
(lib.generators.toINI { } { ${name} = sync.config; });
|
(lib.generators.toINI { } { ${name} = sync.config; });
|
||||||
script = pkgs.writeShellScriptBin serviceName ''
|
script = pkgs.writeShellApplication {
|
||||||
${sync.secretsScript}
|
name = serviceName;
|
||||||
mkdir -p ${sync.path}
|
|
||||||
mkdir -p /tmp/rclone
|
runtimeInputs = [
|
||||||
${lib.getExe pkgs.rclone} mount ${
|
pkgs.coreutils
|
||||||
builtins.concatStringsSep " " (cfg.globalArgs ++ sync.args)
|
pkgs.rclone
|
||||||
} --config ${configFile} ${name}: ${sync.path}
|
(dirOf osConfig.security.wrapperDir)
|
||||||
'';
|
];
|
||||||
|
|
||||||
|
text = ''
|
||||||
|
${sync.secretsScript}
|
||||||
|
mkdir -p ${sync.path}
|
||||||
|
mkdir -p /tmp/rclone
|
||||||
|
rclone mount ${
|
||||||
|
builtins.concatStringsSep " " (cfg.globalArgs ++ sync.args)
|
||||||
|
} --config ${configFile} ${name}: ${sync.path}
|
||||||
|
'';
|
||||||
|
};
|
||||||
in
|
in
|
||||||
(lib.getExe script);
|
(lib.getExe script);
|
||||||
ExecStop =
|
ExecStop =
|
||||||
let
|
let
|
||||||
script = pkgs.writeShellScriptBin "${serviceName}-stop" ''
|
script = pkgs.writeShellApplication {
|
||||||
furermount -zu ${sync.path}
|
name = "${serviceName}-stop";
|
||||||
'';
|
|
||||||
|
runtimeInputs = [
|
||||||
|
(dirOf osConfig.security.wrapperDir)
|
||||||
|
];
|
||||||
|
|
||||||
|
text = ''
|
||||||
|
furermount -zu ${sync.path}
|
||||||
|
'';
|
||||||
|
};
|
||||||
in
|
in
|
||||||
(lib.getExe script);
|
(lib.getExe script);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue