571 current 1970-01-01 01:00:00 24.11.20250221.11415c7 6.6.79 *

This commit is contained in:
2025-02-28 15:58:25 +01:00
parent 238db043b4
commit 0fc344416c
5 changed files with 107 additions and 2 deletions

View File

@ -6,7 +6,7 @@
}: let
cfg = config.myConfig.programs;
in {
imports = [./foot.nix ./thunderbird.nix ./nextcloud.nix ./udiskie.nix ./wezterm.nix];
imports = [./foot.nix ./thunderbird.nix ./nextcloud.nix ./udiskie.nix ./wezterm.nix ./rclone.nix];
options.myConfig.programs = {
enable = lib.mkEnableOption "programs for desktop use";
@ -17,7 +17,7 @@ in {
foot.enable = lib.mkDefault true;
wezterm.enable = lib.mkDefault true;
thunderbird.enable = lib.mkDefault true;
nextcloud.enable = lib.mkDefault true;
rclone.enable = lib.mkDefault true;
udiskie.enable = lib.mkDefault true;
};

View File

@ -0,0 +1,73 @@
{
lib,
config,
pkgs,
...
}: let
cfg = config.myConfig.programs.rclone;
in {
options.myConfig.programs.rclone = {
enable = lib.mkEnableOption "nextcloud sync using rclone";
};
config = lib.mkIf cfg.enable {
sops = {
age.keyFile = "/home/max/.config/sops/age/keys.txt";
secrets = {
"cloud/url" = {
sopsFile = ../../../secrets/rclone.yaml;
};
"cloud/user" = {
sopsFile = ../../../secrets/rclone.yaml;
};
"cloud/pass" = {
sopsFile = ../../../secrets/rclone.yaml;
};
"luhbots/url" = {
sopsFile = ../../../secrets/rclone.yaml;
};
"luhbots/user" = {
sopsFile = ../../../secrets/rclone.yaml;
};
"luhbots/pass" = {
sopsFile = ../../../secrets/rclone.yaml;
};
};
templates."rclone.conf".content = ''
[cloud]
type = webdav
url = ${config.sops.placeholder."cloud/url"}
vendor = nextcloud
user = ${config.sops.placeholder."cloud/user"}
pass = ${config.sops.placeholder."cloud/pass"}
nextcloud_chunk_size = 512M
[luhbots]
type = webdav
url = ${config.sops.placeholder."luhbots/url"}
vendor = nextcloud
user = ${config.sops.placeholder."luhbots/user"}
pass = ${config.sops.placeholder."luhbots/pass"}
'';
};
home.packages = [pkgs.rclone];
systemd.user.services = {
luhbots-mount = {
Unit = {
Description = "Mount the luhbots nextcloud";
After = ["network-online.target"];
};
Service = {
Type = "notify";
ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p \"%h/luhbots Nextcloud\"";
ExecStart = "${pkgs.rclone}/bin/rclone --config=${config.sops.templates."rclone.conf".path} --vfs-cache-mode full mount \"luhbots:\" \"%h/luhbots Nextcloud\"";
ExecStop = "${pkgs.fuse}/bin/fusermount -u \"%h/luhbots Nextcloud\"";
};
Install.WantedBy = ["default.target"];
};
};
};
}