diff --git a/configuration.nix b/configuration.nix deleted file mode 100644 index fdc6859..0000000 --- a/configuration.nix +++ /dev/null @@ -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: diff --git a/modules/rclone-options.nix b/modules/rclone-options.nix new file mode 100644 index 0000000..e5344b2 --- /dev/null +++ b/modules/rclone-options.nix @@ -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: diff --git a/modules/rclone.nix b/modules/rclone.nix index de7f8b3..0bc643e 100644 --- a/modules/rclone.nix +++ b/modules/rclone.nix @@ -1,12 +1,25 @@ -{ pkgs, ... }: +{ config, pkgs, lib, ... }: + let mountdir = "/mnt/genc"; mountdir2 = "/mnt/gdrive"; cachedir = "/mnt/cache"; user = "mc-fucker"; group = "users"; + cfg = config.services.rclone; 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; systemd.services.genc_mount = { description = "mount encrypted gdrive"; @@ -36,7 +49,7 @@ in --drive-pacer-min-sleep 10ms \ --drive-pacer-burst 1000 \ --vfs-cache-mode full \ - --vfs-cache-max-size 20G \ + --vfs-cache-max-size ${cfg.cacheSize} \ --vfs-cache-max-age 5000h \ --vfs-cache-poll-interval 5m ''; @@ -77,7 +90,7 @@ in --drive-pacer-min-sleep 10ms \ --drive-pacer-burst 1000 \ --vfs-cache-mode full \ - --vfs-cache-max-size 20G \ + --vfs-cache-max-size ${cfg.cacheSize} \ --vfs-cache-max-age 5000h \ --vfs-cache-poll-interval 5m ''; diff --git a/systems/mc6/configuration.nix b/systems/mc6/configuration.nix index 45dcda5..ba10778 100644 --- a/systems/mc6/configuration.nix +++ b/systems/mc6/configuration.nix @@ -1,4 +1,5 @@ -{ ... }: { +{ ... }: +{ imports = [ ./hardware-configuration.nix ./modules/generic.nix @@ -7,8 +8,10 @@ ./modules/postgresql.nix ./modules/nextcloud.nix ./modules/navidrome.nix + ./modules/ombi.nix ]; + services.rclone.cacheSize = "100G"; } # vim: set et ts=2 sw=2 ai: