From c6ea71ff4973f37c5476021047f99311b9ce1de4 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Wed, 11 Dec 2024 09:29:49 +0000 Subject: [PATCH] Remove mount-downloads service, make onedrive mount wait for hyprland --- system/Tone.nix | 52 +++++++++++++++---------------------------------- 1 file changed, 16 insertions(+), 36 deletions(-) diff --git a/system/Tone.nix b/system/Tone.nix index fc8a79d4..76cc72b9 100644 --- a/system/Tone.nix +++ b/system/Tone.nix @@ -15,45 +15,25 @@ wayland.windowManager.hyprland.settings.monitor = [ "desc:Dell Inc. DELL P3223QE CCG8YN3,preferred,auto,1.5" ]; - systemd.user.services = + systemd.user.service.mount-onedrive = let - inherit (config.xdg) configHome; + target = "${config.home.homeDirectory}/OneDrive"; in { - mount-documents = - let - target = "${config.home.homeDirectory}/OneDrive"; - in - { - Unit = { - Description = "Mount OneDrive to local directory"; - After = [ "network-online.target" ]; - }; - Service = { - Type = "notify"; - ExecStartPre = "/usr/bin/env mkdir -p ${target}"; - ExecStart = "${pkgs.rclone}/bin/rclone --config=${configHome}/rclone/rclone.conf --vfs-cache-mode writes --ignore-checksum mount \"OneDrive:\" ${target}"; - ExecStop = "/bin/fusermount -u ${target}"; - }; - Install.WantedBy = [ "default.target" ]; - }; - mount-downloads = - let - target = config.xdg.userDirs.download; - in - { - Unit = { - Description = "Mount Downloads directory to OneDrive"; - After = [ "network-online.target" ]; - }; - Service = { - Type = "notify"; - ExecStartPre = "/usr/bin/env mkdir -p ${target}"; - ExecStart = "${pkgs.rclone}/bin/rclone --config=${configHome}/rclone/rclone.conf --vfs-cache-mode writes --ignore-checksum mount \"OneDrive:Downloads\" ${target}"; - ExecStop = "/bin/fusermount -u ${target}"; - }; - Install.WantedBy = [ "default.target" ]; - }; + Unit = { + Description = "Mount OneDrive to local directory"; + After = [ + "network-online.target" + "hyprland-session.target" + ]; + }; + Service = { + Type = "notify"; + ExecStartPre = "/usr/bin/env mkdir -p ${target}"; + ExecStart = "${pkgs.rclone}/bin/rclone --config=${config.xdg.configHome}/rclone/rclone.conf --vfs-cache-mode writes --ignore-checksum mount \"OneDrive:\" ${target}"; + ExecStop = "/bin/fusermount -u ${target}"; + }; + Install.WantedBy = [ "default.target" ]; }; }; boot = {