some rclone changes

This commit is contained in:
mc-fucker 2022-03-29 11:01:27 +02:00
parent d1df256611
commit 850c6b7ea6
4 changed files with 34 additions and 19 deletions

View file

@ -1,15 +0,0 @@
{ ... }:
{
imports = [
./hardware-configuration.nix
./modules/generic.nix
./modules/rclone.nix
./modules/borg.nix
./modules/postgresql.nix
./modules/nextcloud.nix
./modules/navidrome.nix
./modules/ombi.nix
];
}
# vim: set et ts=2 sw=2 ai:

View file

@ -0,0 +1,14 @@
{ lib, ... }:
#with lib;
{
options.services.rclone = {
cacheSize = lib.mkOption {
type = lib.types.str;
default = "20G";
description = "The maximum size of the vfs cache";
};
};
}
# vim: set et ts=2 sw=2 ai:

View file

@ -1,12 +1,25 @@
{ pkgs, ... }: { config, pkgs, lib, ... }:
let let
mountdir = "/mnt/genc"; mountdir = "/mnt/genc";
mountdir2 = "/mnt/gdrive"; mountdir2 = "/mnt/gdrive";
cachedir = "/mnt/cache"; cachedir = "/mnt/cache";
user = "mc-fucker"; user = "mc-fucker";
group = "users"; group = "users";
cfg = config.services.rclone;
in in
{ {
# options.services.rclone = {
# cacheSize = lib.mkOption {
# type = lib.types.str;
# default = "20G";
# description = "The maximum size of the vfs cache";
# };
# };
imports = [ ./rclone-options.nix ];
programs.fuse.userAllowOther = true; programs.fuse.userAllowOther = true;
systemd.services.genc_mount = { systemd.services.genc_mount = {
description = "mount encrypted gdrive"; description = "mount encrypted gdrive";
@ -36,7 +49,7 @@ in
--drive-pacer-min-sleep 10ms \ --drive-pacer-min-sleep 10ms \
--drive-pacer-burst 1000 \ --drive-pacer-burst 1000 \
--vfs-cache-mode full \ --vfs-cache-mode full \
--vfs-cache-max-size 20G \ --vfs-cache-max-size ${cfg.cacheSize} \
--vfs-cache-max-age 5000h \ --vfs-cache-max-age 5000h \
--vfs-cache-poll-interval 5m --vfs-cache-poll-interval 5m
''; '';
@ -77,7 +90,7 @@ in
--drive-pacer-min-sleep 10ms \ --drive-pacer-min-sleep 10ms \
--drive-pacer-burst 1000 \ --drive-pacer-burst 1000 \
--vfs-cache-mode full \ --vfs-cache-mode full \
--vfs-cache-max-size 20G \ --vfs-cache-max-size ${cfg.cacheSize} \
--vfs-cache-max-age 5000h \ --vfs-cache-max-age 5000h \
--vfs-cache-poll-interval 5m --vfs-cache-poll-interval 5m
''; '';

View file

@ -1,4 +1,5 @@
{ ... }: { { ... }:
{
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
./modules/generic.nix ./modules/generic.nix
@ -7,8 +8,10 @@
./modules/postgresql.nix ./modules/postgresql.nix
./modules/nextcloud.nix ./modules/nextcloud.nix
./modules/navidrome.nix ./modules/navidrome.nix
./modules/ombi.nix
]; ];
services.rclone.cacheSize = "100G";
} }
# vim: set et ts=2 sw=2 ai: # vim: set et ts=2 sw=2 ai: