summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--configuration.nix1
-rw-r--r--modules/silverbullet.nix27
2 files changed, 28 insertions, 0 deletions
diff --git a/configuration.nix b/configuration.nix
index 2a40a44..9a98194 100644
--- a/configuration.nix
+++ b/configuration.nix
@@ -14,6 +14,7 @@
       ./modules/polaris.nix
       ./modules/caldav.nix
       ./modules/vaultwarden.nix
+      #./modules/silverbullet.nix Commented out: silverbullet 0.9 doesn't work with deno 2+
       ./modules/monit.nix
     ];
 
diff --git a/modules/silverbullet.nix b/modules/silverbullet.nix
new file mode 100644
index 0000000..ffdc59a
--- /dev/null
+++ b/modules/silverbullet.nix
@@ -0,0 +1,27 @@
+{ pkgs, libs, config, ... }:
+{
+
+  services.silverbullet = {
+    enable = true;
+    listenPort = 3000;
+    listenAddress = "localhost";
+    envFile = "/secret/silverbullet.env";
+  };
+  
+  services.nginx.virtualHosts."notes.krinitsin.com" = {
+    forceSSL = true;
+    useACMEHost = "krinitsin.com";
+    locations."/".proxyPass = "http://localhost:3000";
+  };
+
+  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"
+    stop program = "${pkgs.systemd}/bin/systemctl stop silverbullet"
+  '';
+
+}