From f04fe3c980e8f946f9be09da91fcc48e9c518156 Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Sun, 19 Nov 2023 17:40:43 +0100 Subject: [PATCH] Add kopia service --- ServeNix/configuration.nix | 1 + ServeNix/services/kopia.nix | 52 +++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 ServeNix/services/kopia.nix diff --git a/ServeNix/configuration.nix b/ServeNix/configuration.nix index a7f25df..0ab2b39 100644 --- a/ServeNix/configuration.nix +++ b/ServeNix/configuration.nix @@ -18,6 +18,7 @@ ./services/gitea-runner.nix ./services/homepage.nix ./services/immich.nix + ./services/kopia.nix ./services/memos.nix ./services/nextcloud.nix ./services/nginx-proxy-manager.nix diff --git a/ServeNix/services/kopia.nix b/ServeNix/services/kopia.nix new file mode 100644 index 0000000..e2bdef7 --- /dev/null +++ b/ServeNix/services/kopia.nix @@ -0,0 +1,52 @@ +{ + config, + lib, + pkgs, + ... +}: { + virtualisation.oci-containers.containers.kopia = { + image = "kopia/kopia:latest"; + autoStart = true; + + dependsOn = []; + + ports = [ + # "51515:51515" + ]; + + volumes = [ + "kopia_config:/app/config" + "kopia_cache:/app/cache" + "kopia_logs:/app/logs" + "kopia_temp:/tmp/shared" + + "/media/synology-syncthing:/repository" + + "nextcloud_data:/data/nextcloud:ro" + "immich_data:/data/immich:ro" + "gitea_data:/data/gitea:ro" + "memos_data:/data/memos:ro" + ]; + + environment = { + USER = "christoph"; + KOPIA_PASSWORD = "kopia"; + }; + + entrypoint = "/bin/kopia"; + + cmd = [ + "server" + "start" + "--disable-csrf-token-checks" + "--insecure" + "--address=0.0.0.0:51515" + "--server-username=christoph" + "--server-password=kopia" + ]; + + extraOptions = [ + "--net=behind-nginx" + ]; + }; +}