39 lines
859 B
Nix
39 lines
859 B
Nix
{
|
|
config,
|
|
pkgs,
|
|
...
|
|
}: let
|
|
inherit (config.services.secrets) secrets;
|
|
|
|
rcloneStorage = pkgs.writeShellScriptBin "rclone-storage" ''
|
|
${pkgs.rclone}/bin/rclone --config ${secrets.rclone_config.path} "$@"
|
|
'';
|
|
in {
|
|
environment.systemPackages = with pkgs; [
|
|
rclone
|
|
fuse
|
|
fuse3
|
|
rcloneStorage
|
|
];
|
|
|
|
users.groups.storage = {
|
|
gid = 1000;
|
|
};
|
|
|
|
users.users.storage = {
|
|
uid = 1000;
|
|
isNormalUser = true;
|
|
extraGroups = ["storage"];
|
|
};
|
|
|
|
systemd.tmpfiles.rules = [
|
|
"d /root/.config - root root"
|
|
"d /root/.config/rclone - root root"
|
|
"L /root/.config/rclone/rclone.conf - - - - ${secrets.rclone_config.path}"
|
|
|
|
"d /home/storage/.config - storage storage"
|
|
"d /home/storage/.config/rclone - storage storage"
|
|
"L /home/storage/.config/rclone/rclone.conf - - - - ${secrets.rclone_config.path}"
|
|
];
|
|
}
|