1
0
Fork 0
puter/hosts/vessel/musicomp.nix

48 lines
1.1 KiB
Nix
Raw Normal View History

2025-05-11 22:49:04 +02:00
{
inputs,
self,
lib,
pkgs,
...
}:
{
imports = [
inputs.musicomp.nixosModules.default
];
services.musicomp.jobs.main = {
music = "/srv/music";
comp = "/srv/compmusic";
timerConfig = {
OnCalendar = "daily";
Persistent = true;
};
inhibitsSleep = true;
post =
let
2025-05-18 16:51:40 +02:00
abacusConfig = self.nixosConfigurations.abacus.config;
remoteDir = abacusConfig.services.navidrome.settings.MusicFolder;
remoteDomain = abacusConfig.networking.domain;
2025-05-11 22:49:04 +02:00
package = pkgs.writeShellApplication {
name = "sync";
runtimeInputs = [
pkgs.openssh
pkgs.rsync
];
text = ''
rsync \
--archive \
--recursive \
--delete \
--update \
--mkpath \
--verbose --verbose \
--rsh 'ssh -i /etc/ssh/ssh_host_ed25519_key -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' \
2025-05-18 16:51:40 +02:00
/srv/void/compmusic/ root@${lib.escapeShellArg remoteDomain}:${lib.escapeShellArg remoteDir}/
2025-05-11 22:49:04 +02:00
'';
};
in
lib.getExe package;
};
}