mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
rclone tests: add Darwin serve sidecar test
This commit is contained in:
committed by
Austin Horstman
parent
13e1296711
commit
6f5d412501
@@ -8,4 +8,5 @@
|
||||
}
|
||||
// lib.optionalAttrs pkgs.stdenv.hostPlatform.isDarwin {
|
||||
rclone-mount-service-generation-darwin = ./mount-service-generation-darwin.nix;
|
||||
rclone-serve-service-generation-darwin = ./serve-service-generation-darwin.nix;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
_: {
|
||||
programs.rclone = {
|
||||
enable = true;
|
||||
remotes = {
|
||||
sftp-remote = {
|
||||
config = {
|
||||
type = "sftp";
|
||||
host = "backup-server.example.com";
|
||||
user = "alice";
|
||||
key_file = "/Users/alice/.ssh/id_ed25519";
|
||||
};
|
||||
serve = {
|
||||
"documents/work" = {
|
||||
enable = true;
|
||||
protocol = "http";
|
||||
logLevel = "ERROR";
|
||||
options = {
|
||||
addr = "127.0.0.1:8080";
|
||||
dir-cache-time = "5000h";
|
||||
};
|
||||
};
|
||||
"/games" = {
|
||||
enable = true;
|
||||
protocol = "ftp";
|
||||
};
|
||||
"disabled-serve" = {
|
||||
enable = false;
|
||||
protocol = "ftp";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
# http serve
|
||||
plist="LaunchAgents/org.nix-community.home.rclone-serve:documents.work@sftp-remote.plist"
|
||||
assertFileExists "$plist"
|
||||
assertFileContains "$plist" "rclone-sidecar-wrapper"
|
||||
assertFileContains "$plist" "/bin/rclone"
|
||||
assertFileContains "$plist" "serve"
|
||||
assertFileContains "$plist" "http"
|
||||
assertFileContains "$plist" "'--addr=127.0.0.1:8080'"
|
||||
assertFileContains "$plist" "'--cache-dir=/home/hm-user/.cache/rclone'"
|
||||
assertFileContains "$plist" "'--dir-cache-time=5000h'"
|
||||
assertFileContains "$plist" "sftp-remote:documents/work"
|
||||
assertFileContains "$plist" "RCLONE_LOG_LEVEL"
|
||||
assertFileContains "$plist" "ERROR"
|
||||
|
||||
# ftp serve
|
||||
plist2="LaunchAgents/org.nix-community.home.rclone-serve:.games@sftp-remote.plist"
|
||||
assertFileExists "$plist2"
|
||||
assertFileContains "$plist2" "ftp"
|
||||
assertFileContains "$plist2" "sftp-remote:/games"
|
||||
|
||||
# Disabled serve produces no plist
|
||||
assertPathNotExists "LaunchAgents/org.nix-community.home.rclone-serve:disabled-serve@sftp-remote.plist"
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user