summary refs log tree commit diff stats
path: root/modules/silverbullet.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/silverbullet.nix')
-rw-r--r--modules/silverbullet.nix17
1 files changed, 10 insertions, 7 deletions
diff --git a/modules/silverbullet.nix b/modules/silverbullet.nix
index ffdc59a..8dbdab7 100644
--- a/modules/silverbullet.nix
+++ b/modules/silverbullet.nix
@@ -1,11 +1,16 @@
 { pkgs, libs, config, ... }:
 {
 
-  services.silverbullet = {
-    enable = true;
-    listenPort = 3000;
-    listenAddress = "localhost";
-    envFile = "/secret/silverbullet.env";
+  virtualisation.docker.enable = true;
+
+  virtualisation.oci-containers = {
+    backend = "docker";
+    containers."silverbullet" = {
+      image = "ghcr.io/silverbulletmd/silverbullet:v2";
+      ports = [ "127.0.0.1:3000:3000" ];
+      volumes = [ "/var/lib/silverbullet:/space" ];
+      environmentFiles = [ "/secret/silverbullet.env" ];
+    };
   };
   
   services.nginx.virtualHosts."notes.krinitsin.com" = {
@@ -16,8 +21,6 @@
 
   security.acme.certs."krinitsin.com".extraDomainNames = [ "notes.krinitsin.com" ];
 
-  networking.firewall.allowedTCPPorts = [ 3000 ];
-
   services.monit.config = ''
     check process silverbullet with matching "silverbullet"
     start program = "${pkgs.systemd}/bin/systemctl start silverbullet"