Move modules folders
This commit is contained in:
parent
914909009c
commit
c1101e7b45
183 changed files with 327 additions and 327 deletions
|
|
@ -1,44 +0,0 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
let cfg = config.rclone-mount; in {
|
||||
options = {
|
||||
rclone-mount = {
|
||||
enable = lib.mkEnableOption "rclone mount user services";
|
||||
mounts = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
default = { };
|
||||
example = { "minio" = "/home/${config.home.username}/minio/"; };
|
||||
description = "List of mount configurations";
|
||||
};
|
||||
configPath = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "~/.config/rclone/rclone.conf";
|
||||
description = "Path to the rclone configuration";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
systemd.user.services = lib.attrsets.mapAttrs'
|
||||
(name: path: {
|
||||
name = "rclone-${name}";
|
||||
value = {
|
||||
Unit = {
|
||||
Description = "rclone mount for ${name}";
|
||||
After = [ "default.target" ];
|
||||
PartOf = [ "default.target" ];
|
||||
};
|
||||
Install.WantedBy = [ "default.target" ];
|
||||
Service = {
|
||||
Type = "simple";
|
||||
Environment = [ "PATH=${ lib.makeBinPath [ pkgs.rclone pkgs.coreutils pkgs.fuse ]}:/run/wrappers/bin/:$PATH" ];
|
||||
ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p ${path}";
|
||||
ExecStart = "${pkgs.rclone}/bin/rclone --config '${cfg.configPath}' mount ${name}:/ ${path} -vv --vfs-cache-mode=writes --s3-upload-concurrency 32 --s3-chunk-size 128000";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "30s";
|
||||
};
|
||||
};
|
||||
})
|
||||
(if cfg.enable then cfg.mounts else { });
|
||||
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue