summary refs log tree commit diff
diff options
context:
space:
mode:
authortzlil <tzlils@protonmail.com>2023-07-29 03:15:24 +0300
committertzlil <tzlils@protonmail.com>2023-07-29 03:15:24 +0300
commit0c96cccb7392b688b192241fb0462e117364ce1f (patch)
tree845c552cdaa2200cdaf93e207dc995928d77107d
parent489e84e149b4b1b470bd0c88aa8b18a3650db3f5 (diff)
added maloja
-rw-r--r--hosts/vps/cfg.nix2
-rw-r--r--hosts/vps/maloja.nix51
-rw-r--r--hosts/vps/website.nix3
-rw-r--r--mixins/cli.nix2
4 files changed, 54 insertions, 4 deletions
diff --git a/hosts/vps/cfg.nix b/hosts/vps/cfg.nix
index 7fc5f86..3597c5c 100644
--- a/hosts/vps/cfg.nix
+++ b/hosts/vps/cfg.nix
@@ -14,6 +14,7 @@
     ./git.nix
     ./hydrus.nix
     ./matrix.nix
+    ./maloja.nix
   ];
 
   config = {
@@ -71,7 +72,6 @@
 
     networking.networkmanager.enable = lib.mkForce false;
 
-
     nixpkgs.config.allowUnfree = true;
     environment.persistence."/nix/persist".directories = [
       {
diff --git a/hosts/vps/maloja.nix b/hosts/vps/maloja.nix
new file mode 100644
index 0000000..3d4530d
--- /dev/null
+++ b/hosts/vps/maloja.nix
@@ -0,0 +1,51 @@
+{
+  pkgs,
+  config,
+  lib,
+  ...
+}: {
+  config = {
+    users.groups.maloja = {};
+    users.users.maloja = {
+      isSystemUser = true;
+      description = "maloja";
+      group = "maloja";
+      home = "/var/lib/maloja";
+    };
+
+    security.lockKernelModules = lib.mkForce false;
+    virtualisation.oci-containers.containers.maloja = {
+      ports = ["42010:42010"];
+      image = "krateng/maloja";
+      volumes = [
+        "/var/lib/maloja:/data"
+      ];
+      environment = {
+        MALOJA_DATA_DIRECTORY = "/data";
+        MALOJA_SKIP_SETUP = "True";
+        MALOJA_NAME = "tzlil";
+        MAlOJA_PROXY_IMAGES = "True";
+      };
+    };
+
+    # systemd.services.podman-maloja.serviceConfig.User = "maloja";
+    # systemd.services.podman-maloja.serviceConfig.Group = "maloja";
+
+    networking.firewall.allowedTCPPorts = [42010];
+
+    environment.persistence."/nix/persist".directories = [
+      {
+        directory = "/var/lib/maloja";
+        user = "maloja";
+        group = "maloja";
+      }
+    ];
+
+    services.caddy = {
+      virtualHosts."fm.tzlil.net".extraConfig = ''
+        bind 0.0.0.0
+        reverse_proxy :42010
+      '';
+    };
+  };
+}
diff --git a/hosts/vps/website.nix b/hosts/vps/website.nix
index 2716aa5..5d1d48a 100644
--- a/hosts/vps/website.nix
+++ b/hosts/vps/website.nix
@@ -76,8 +76,7 @@
             i currently work as a security researcher
             but in a few months i will be drafted to the army
 
-            i like music
-            https://last.fm/user/tzlils
+            i like music <a href="https://fm.tzlil.net">https://fm.tzlil.net</a>
 
             my interests:
             plan9
diff --git a/mixins/cli.nix b/mixins/cli.nix
index d4815e4..6fd5ce6 100644
--- a/mixins/cli.nix
+++ b/mixins/cli.nix
@@ -85,7 +85,7 @@
               end
               nix shell $p
             '';
-	    fish_command_not_found = "nix shell nixpkgs#(command-not-found $argv[1] &| sed -nr 's/.*-p (.*)$/\\1/p' | ${lib.getExe pkgs.fzf} || return 0) -c $argv[1]";
+            fish_command_not_found = "nix shell nixpkgs#(command-not-found $argv[1] &| sed -nr 's/.*-p (.*)$/\\1/p' | ${lib.getExe pkgs.fzf} || return 0) -c $argv[1]";
           };
         };
         neovim = {