Add services to automount OneDrive (via rclone)
This commit is contained in:
parent
deaa8827a6
commit
662d978241
|
@ -1,15 +1,61 @@
|
||||||
{ pkgs, username, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
username,
|
||||||
|
...
|
||||||
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./desktop.nix
|
./desktop.nix
|
||||||
./work.nix
|
./work.nix
|
||||||
];
|
];
|
||||||
home-manager.users.${username} = {
|
home-manager.users.${username} =
|
||||||
home.stateVersion = "23.05";
|
{ config, ... }:
|
||||||
wayland.windowManager.hyprland.settings.monitor = [
|
{
|
||||||
"desc:Dell Inc. DELL P3223QE CCG8YN3,preferred,auto,1.5"
|
home.stateVersion = "23.05";
|
||||||
];
|
wayland.windowManager.hyprland.settings.monitor = [
|
||||||
};
|
"desc:Dell Inc. DELL P3223QE CCG8YN3,preferred,auto,1.5"
|
||||||
|
];
|
||||||
|
systemd.user.services =
|
||||||
|
let
|
||||||
|
inherit (config.xdg) configHome;
|
||||||
|
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" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
boot = {
|
boot = {
|
||||||
loader.efi.efiSysMountPoint = "/boot/efi";
|
loader.efi.efiSysMountPoint = "/boot/efi";
|
||||||
initrd = {
|
initrd = {
|
||||||
|
|
Loading…
Reference in a new issue