nixcfg/hosts/common/vps/dufs.nix
2024-10-24 15:26:47 +03:00

44 lines
915 B
Nix

{ config, lib, pkgs, user, ... }:
with lib;
let
dufsService = {
project.name = "dufs";
services = {
dufs = {
service.image = "sigoden/dufs:latest";
service.ports = [
"5000:5000"
];
service.volumes = [
"${config.users.users.${user}.home}/dockers/dufs/data:/data"
];
service.command = [
"/data"
"-a"
''???:???#fs@/:rw'' # till i figure out how to pass the damn env
"-A"
"-a"
"@/p"
];
service.env_file = [ "${config.sops.templates."my-env.env".path}" ];
};
};
};
in
{
options.vps.dufs.enable = mkEnableOption " Enable DUFS service ";
config = mkIf config.vps.dufs.enable {
virtualisation.arion = {
backend = "docker";
projects.dufs = {
serviceName = "dufs";
settings = dufsService;
};
};
};
}