28 lines
1.1 KiB
Nix
28 lines
1.1 KiB
Nix
|
{pkgs, config, ... }: let
|
||
|
# cloud_cmd = "${pkgs.nextcloud-client}/bin/nextcloudcmd -h -n --path";
|
||
|
sync_user = "grimmauld";
|
||
|
sync_user_remote = "Grimmauld";
|
||
|
sync_server = "cloud.grimmauld.de";
|
||
|
# cloud_cmd = "${pkgs.nextcloud-client}/bin/nextcloudcmd -u ${sync_user_remote} -p -h -n --path";
|
||
|
in {
|
||
|
# spotify pass
|
||
|
age.secrets.nextcloud_pass = {
|
||
|
file = ../secrets/nextcloud_pass.age;
|
||
|
owner = sync_user;
|
||
|
mode = "700";
|
||
|
};
|
||
|
|
||
|
environment.systemPackages = let
|
||
|
cloud_cmd = ''${pkgs.nextcloud-client}/bin/nextcloudcmd -u ${sync_user_remote} -p "$(cat ${config.age.secrets.nextcloud_pass.path})" -h -n --path'';
|
||
|
in with pkgs; [
|
||
|
nextcloud-client
|
||
|
(writeShellScriptBin "cloudsync" ''
|
||
|
# export cloudpass="$(cat ${config.age.secrets.nextcloud_pass.path})"
|
||
|
${cloud_cmd} /3d /home/${sync_user}/3d https://${sync_server}
|
||
|
${cloud_cmd} /Pictures /home/${sync_user}/Pictures https://${sync_server}
|
||
|
${cloud_cmd} /Documents /home/${sync_user}/Documents https://${sync_server}
|
||
|
${cloud_cmd} /Videos /home/${sync_user}/Videos https://${sync_server}
|
||
|
'')
|
||
|
];
|
||
|
}
|