{ config, pkgs, inputs, lib, ... }: { # Install necessary tools and libraries environment = { sessionVariables = { RCLONE_CONFIG = config.age.secrets."rclone.conf".path; }; }; ### Add "rclone" to your packages first # RClone Google Drive service systemd.services.mnt-gdrive-mount = { # Ensure the service starts after the network is up wantedBy = [ "multi-user.target" ]; after = [ "network-online.target" ]; requires = [ "network-online.target" ]; # Service configuration serviceConfig = { Type = "simple"; ExecStartPre = "/run/current-system/sw/bin/mkdir -p /mnt/gdrive"; # Creates folder if didn't exist ExecStart = "${pkgs.rclone}/bin/rclone mount gdrive:Documents /mnt/gdrive --vfs-cache-mode=full --uid=1000 --gid=100"; # Mounts ExecStop = "/run/current-system/sw/bin/fusermount -u /mnt/gdrive"; # Dismounts Restart = "on-failure"; RestartSec = "10s"; User = "marvin"; Group = "users"; Environment = [ "RCLONE_CONFIG=${config.age.secrets."rclone.conf".path}" # RClone configuration file "PATH=/run/wrappers/bin/:$PATH" ]; # Required environments }; }; }