From 5901535d77afc82f0d9db54c22f4213509d29b31 Mon Sep 17 00:00:00 2001 From: worble Date: Tue, 17 Dec 2024 23:10:44 +0000 Subject: [PATCH] working on rclone service --- configuration.nix | 2 -- tuxedo/configuration.nix | 33 ++++++++++++++++++++++------ tuxedo/home-manager/home.nix | 42 ++++++++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 8 deletions(-) diff --git a/configuration.nix b/configuration.nix index fc5d8fd..c750833 100644 --- a/configuration.nix +++ b/configuration.nix @@ -165,8 +165,6 @@ kdePackages.kcalc rar nixpkgs-fmt - inotify-tools - libnotify ]; # Some programs need SUID wrappers, can be configured further or are diff --git a/tuxedo/configuration.nix b/tuxedo/configuration.nix index e98151e..349fd8f 100644 --- a/tuxedo/configuration.nix +++ b/tuxedo/configuration.nix @@ -45,14 +45,35 @@ }; }; - # systemd.user.services.my-cool-user-service = { + # [Unit] + # Description=Systemd unit to watch a folder for new files + + # [Path] + # PathChanged=/path/to/folder/you/want/to/monitor/ + + # [Install] + # WantedBy=multi-user.target + + # systemd.user.paths.rclone-media = { # enable = true; + # description = "rclone unit path for /mnt/HDD1/Videos/"; # after = [ "network.target" "mnt-HDD1.mount" ]; - # wantedBy = [ "multi-user.target" ]; - # description = "rclone copy media"; - # serviceConfig = { - # Type = "simple"; - # ExecStart = ''/my/cool/user/service''; + # wantedBy = [ "default.target" ]; + # pathConfig = { + # PathChanged = "/mnt/HDD1/Videos/"; # }; # }; + + # systemd.user.services.rclone-media = { + # description = "rclone unit service for /mnt/HDD1/Videos/"; + # serviceConfig = { + # Type = "oneshot"; + # }; + # path = [ pkgs.libnotify pkgs.rclone ]; + # script = '' + # notify-send -a "rclone-media" "rclone for /mnt/HDD1/Videos/ triggered" + # rclone copy --max-age 24h --no-traverse "/mnt/HDD1/Videos/" media:"media-7gM2gcrxRjXqfj" -P --dry-run + # notify-send -a "rclone-media" "rclone for /mnt/HDD1/Videos/ complete" + # ''; + # }; } diff --git a/tuxedo/home-manager/home.nix b/tuxedo/home-manager/home.nix index fae3bcb..7a3586a 100644 --- a/tuxedo/home-manager/home.nix +++ b/tuxedo/home-manager/home.nix @@ -286,4 +286,46 @@ in }; }; }; + + # systemd.user = { + # enable = true; + # paths = { + # rclone-media = { + # Unit = { + # Description = "rclone unit path for /mnt/HDD1/Videos/"; + # After = [ "network.target" "mnt-HDD1.mount" ]; + # }; + + # Path = { + # PathChanged = "/mnt/HDD1/Videos/"; + # }; + + # Install = { + # WantedBy = [ "default.target" ]; + # }; + # }; + # }; + # services = { + # rclone-media = { + # Unit = { + # Description = "rclone unit service for /mnt/HDD1/Videos/"; + # }; + + # Service = { + # Type = "oneshot"; + # ExecStart = "${pkgs.writeShellApplication { + # name = "rclone-media"; + # runtimeInputs = [ pkgs.libnotify pkgs.rclone ]; + # text = '' + # notify-send -a "rclone-media" "rclone for /mnt/HDD1/Videos/ triggered" + # rclone copy --max-age 24h --no-traverse "/mnt/HDD1/Videos/" media:"media-7gM2gcrxRjXqfj" -P --dry-run + # notify-send -a "rclone-media" "rclone for /mnt/HDD1/Videos/ complete" + # ''; + # }}/bin/rclone-media"; + # }; + # }; + # }; + # }; } + +