From 16dae5bcd5035c28a75dd40d0a041efef3fbb9a0 Mon Sep 17 00:00:00 2001 From: Jo Date: Fri, 20 Sep 2024 23:08:38 +0200 Subject: [PATCH] feat(services): WIP setup base for Vaultwarden service --- modules/home/services/vaultwarden/default.nix | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/modules/home/services/vaultwarden/default.nix b/modules/home/services/vaultwarden/default.nix index 00cdf7a..15cca8a 100644 --- a/modules/home/services/vaultwarden/default.nix +++ b/modules/home/services/vaultwarden/default.nix @@ -1,5 +1,23 @@ { + namespace, + hostname, + config, ... -}: { - # Todo: implement example service structure which should be re-usable for any future services. +}: with lib; with lib.${namespace}; +let + cfg = config.${namespace}.services.vaultwarden; +in { + options.${namespace}.services.vaultwarden = { enable = mkEnableOption "Enable the Vaultwarden service."; }; + + config = mkIf cfg.enable { + virtualisation.oci-containers.containers.vaultwarden = { + image = "vaultwarden/server"; + autoStart = true; + hostname = hostname; + # Todo: continue writing vaultwarden config + }; + + # Todo: figure out "traefik" as a service and how to configure it per-service + # Todo: setup age-nix or sops-nix for secret management + }; } \ No newline at end of file