From 0c96cccb7392b688b192241fb0462e117364ce1f Mon Sep 17 00:00:00 2001 From: tzlil Date: Sat, 29 Jul 2023 03:15:24 +0300 Subject: added maloja --- hosts/vps/cfg.nix | 2 +- hosts/vps/maloja.nix | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ hosts/vps/website.nix | 3 +-- mixins/cli.nix | 2 +- 4 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 hosts/vps/maloja.nix 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 https://fm.tzlil.net 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 = { -- cgit 1.4.1