add mermaid test

This commit is contained in:
Cyryl Płotnicki 2023-04-17 17:03:34 +01:00
parent e60b48be55
commit 28d06b300f
3 changed files with 32 additions and 25 deletions

View file

@ -9,3 +9,17 @@ This is using flakes for reproducibility and home manager for setting up user-sp
Workstations are set up by running ` sudo nixos-rebuild switch --flake '.#'` and servers are by `nixos-rebuild switch --flake '.#servername' --target-host root@hostname`. Workstations are set up by running ` sudo nixos-rebuild switch --flake '.#'` and servers are by `nixos-rebuild switch --flake '.#servername' --target-host root@hostname`.
I don't use home manager the program, everything is referenced from the top flake. I don't use home manager the program, everything is referenced from the top flake.
## infra setup
```mermaid
sequenceDiagram
Alice ->> Bob: Hello Bob, how are you?
Bob-->>John: How about you John?
Bob--x Alice: I am good thanks!
Bob-x John: I am good thanks!
Note right of John: Bob thinks a long<br/>long time, so long<br/>that the text does<br/>not fit on a row.
Bob-->Alice: Checking with John...
Alice->John: Yes... John, how are you?
```

View file

@ -6,7 +6,6 @@
./atuin.nix ./atuin.nix
]; ];
networking.hostName = "mb1"; networking.hostName = "mb1";
environment.systemPackages = with pkgs; [ ];
boot.loader.grub = { boot.loader.grub = {
devices = [ "/dev/vda" ]; devices = [ "/dev/vda" ];

View file

@ -1,11 +1,5 @@
{ { config, pkgs, inputs, lib, system, ... }:
config, let
pkgs,
inputs,
lib,
system,
...
}: let
httpPort = 8083; httpPort = 8083;
sshPort = 22; sshPort = 22;
domain = "git.cyplo.dev"; domain = "git.cyplo.dev";
@ -27,18 +21,18 @@
}; };
groups."${systemGroupName}" = { groups."${systemGroupName}" = {
inherit gid; inherit gid;
members = ["${systemUserName}" "nginx"]; members = [ "${systemUserName}" "nginx" ];
}; };
}; };
in { in {
imports = [../nginx.nix]; imports = [ ../nginx.nix ];
inherit users; inherit users;
boot.kernel.sysctl = {"net.ipv4.ip_unprivileged_port_start" = 0;}; boot.kernel.sysctl = { "net.ipv4.ip_unprivileged_port_start" = 0; };
systemd.services.systemd-sysctl.enable = lib.mkForce true; systemd.services.systemd-sysctl.enable = lib.mkForce true;
networking.firewall.allowedTCPPorts = [sshPort]; networking.firewall.allowedTCPPorts = [ sshPort ];
services.nginx = { services.nginx = {
virtualHosts = { virtualHosts = {
"${domain}" = { "${domain}" = {
@ -80,19 +74,12 @@ in {
isReadOnly = true; isReadOnly = true;
}; };
}; };
config = { config = { config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}: {
system.stateVersion = "22.11"; system.stateVersion = "22.11";
users = users = users // {
users mutableUsers = false;
// { allowNoPasswordLogin = true;
mutableUsers = false; };
allowNoPasswordLogin = true;
};
services.gitea = { services.gitea = {
inherit domain httpPort; inherit domain httpPort;
enable = true; enable = true;
@ -103,6 +90,13 @@ in {
package = inputs.nixpkgs-master.legacyPackages.${system}.forgejo; package = inputs.nixpkgs-master.legacyPackages.${system}.forgejo;
settings = { settings = {
service.DISABLE_REGISTRATION = true; service.DISABLE_REGISTRATION = true;
"markup.mermaid" = {
ENABLED = true;
FILE_EXTENSIONS = ".md";
RENDER_COMMAND =
"${pkgs.asciidoc-full}/bin/asciidoc --out-file=- -";
IS_INPUT_FILE = false;
};
server = { server = {
START_SSH_SERVER = true; START_SSH_SERVER = true;
SSH_PORT = sshPort; SSH_PORT = sshPort;