summary refs log tree commit diff
BranchCommit messageAuthorAge
dependabot/cargo/server/bumpalo-3.12.0Bump bumpalo from 3.4.0 to 3.12.0 in /serverdependabot[bot]3 years
dependabot/cargo/server/diesel-1.4.6Bump diesel from 1.4.5 to 1.4.6 in /serverdependabot[bot]4 years
dependabot/cargo/server/openssl-0.10.48Bump openssl from 0.10.32 to 0.10.48 in /serverdependabot[bot]3 years
dependabot/cargo/server/thread_local-1.1.4Bump thread_local from 1.1.0 to 1.1.4 in /serverdependabot[bot]4 years
dependabot/npm_and_yarn/client/svelte-3.49.0Bump svelte from 3.35.0 to 3.49.0 in /clientdependabot[bot]4 years
dependabot/npm_and_yarn/client/vite-2.9.13Bump vite from 2.1.2 to 2.9.13 in /clientdependabot[bot]4 years
mainMerge pull request #6 from Melonai/dependabot/npm_and_yarn/client/nanoid-3.2.0Mel4 years
 
TagDownloadAuthorAge
0.3.0shorest-0.3.0.tar.zst  shorest-0.3.0.zip  Melonai5 years
0.2.0shorest-0.2.0.tar.zst  shorest-0.2.0.zip  Melonai6 years
0.1.0shorest-0.1.0.tar.zst  shorest-0.1.0.zip  Melonai6 years
ound-color: transparent; padding-left: 5px; padding-right: 5px; } span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } .highlight .hll { background-color: #0000ff } .highlight .c { color: #0F0 } /* Comment */ .highlight .err { color: #DDD } /* Error */ .highlight .esc { color: #DDD } /* Escape */ .highlight .g { color: #DDD } /* Generic */ .highlight .k { color: #F00 } /* Keyword */ .highlight .l { color: #DDD } /* Literal */ .highlight .n { color: #DDD } /* Name */ .highlight .o { color: #DDD } /* Operator */ .highlight .x { color: #DDD } /* Other */ .highlight .p { color: #DDD } /* Punctuation */ .highlight .ch { color: #0F0 } /* Comment.Hashbang */ .highlight .cm { color: #0F0 } /* Comment.Multiline */ .highlight .cp { color: #E5E5E5 } /* Comment.Preproc */ .highlight .cpf { color: #0F0 } /* Comment.PreprocFile */ .highlight .c1 { color: #0F0 } /* Comment.Single */ .highlight .cs { color: #0F0 } /* Comment.Special */ .highlight .gd { color: #DDD } /* Generic.Deleted */ .highlight .ge { color: #DDD } /* Generic.Emph */ .highlight .ges { color: #DDD } /* Generic.EmphStrong */ .highlight .gr { color: #DDD } /* Generic.Error */ .highlight .gh { color: #DDD } /* Generic.Heading */ .highlight .gi { color: #DDD } /* Generic.Inserted */ .highlight .go { color: #DDD } /* Generic.Output */ .highlight .gp { color: #DDD } /* Generic.Prompt */ .highlight .gs { color: #DDD } /* Generic.Strong */ .highlight .gu { color: #DDD } /* Generic.Subheading */ .highlight .gt { color: #DDD } /* Generic.Traceback */ .highlight .kc { color: #F00 } /* Keyword.Constant */ .highlight .kd { color: #F00 } /* Keyword.Declaration */ .highlight .kn { color: #F00 } /* Keyword.Namespace */ .highlight .kp { color: #F00 } /* Keyword.Pseudo */ .highlight .kr { color: #F00 } /* Keyword.Reserved */ .highlight .kt { color: #EE82EE } /* Keyword.Type */ .highlight .ld { color: #DDD } /* Literal.Date */ .highlight .m { color: #F0F } /* Literal.Number */ .highlight .s { color: #87CEEB } /* Literal.String */ .highlight .na { color: #DDD } /* Name.Attribute */ .highlight .nb { color: #DDD } /* Name.Builtin */ .highlight .nc { color: #DDD } /* Name.Class */ .highlight .no { color: #7FFFD4 } /* Name.Constant */ .highlight .nd { color: #DDD } /* Name.Decorator */ .highlight .ni { color: #DDD } /* Name.Entity */ .highlight .ne { color: #DDD } /* Name.Exception */ .highlight .nf { color: #FF0 } /* Name.Function */ .highlight .nl { color: #DDD } /* Name.Label */ .highlight .nn { color: #DDD } /* Name.Namespace */ .highlight .nx { color: #DDD } /* Name.Other */ .highlight .py { color: #DDD } /* Name.Property */ .highlight .nt { color: #DDD } /* Name.Tag */ .highlight .nv { color: #EEDD82 } /* Name.Variable */ .highlight .ow { color: #F00 } /* Operator.Word */ .highlight .pm { color: #DDD } /* Punctuation.Marker */ .highlight .w { color: #DDD } /* Text.Whitespace */ .highlight .mb { color: #F0F } /* Literal.Number.Bin */ .highlight .mf { color: #F0F } /* Literal.Number.Float */ .highlight .mh { color: #F0F } /* Literal.Number.Hex */ .highlight .mi { color: #F0F } /* Literal.Number.Integer */ .highlight .mo { color: #F0F } /* Literal.Number.Oct */ .highlight .sa { color: #87CEEB } /* Literal.String.Affix */ .highlight .sb { color: #87CEEB } /* Literal.String.Backtick */ .highlight .sc { color: #87CEEB } /* Literal.String.Char */ .highlight .dl { color: #87CEEB } /* Literal.String.Delimiter */ .highlight .sd { color: #87CEEB } /* Literal.String.Doc */ .highlight .s2 { color: #87CEEB } /* Literal.String.Double */ .highlight .se { color: #87CEEB } /* Literal.String.Escape */ .highlight .sh { color: #87CEEB } /* Literal.String.Heredoc */ .highlight .si { color: #87CEEB } /* Literal.String.Interpol */ .highlight .sx { color: #87CEEB } /* Literal.String.Other */ .highlight .sr { color: #87CEEB } /* Literal.String.Regex */ .highlight .s1 { color: #87CEEB } /* Literal.String.Single */ .highlight .ss { color: #87CEEB } /* Literal.String.Symbol */ .highlight .bp { color: #DDD } /* Name.Builtin.Pseudo */ .highlight .fm { color: #FF0 } /* Name.Function.Magic */ .highlight .vc { color: #EEDD82 } /* Name.Variable.Class */ .highlight .vg { color: #EEDD82 } /* Name.Variable.Global */ .highlight .vi { color: #EEDD82 } /* Name.Variable.Instance */ .highlight .vm { color: #EEDD82 } /* Name.Variable.Magic */ .highlight .il { color: #F0F } /* Literal.Number.Integer.Long */
{ me, machines, ... }:

{
  imports = [
    ../../modules/common.nix

    ./hardware.nix
    ./devices.nix

    ../../modules/binary-cache.nix
    ../../modules/git.nix
    ../../modules/syncthing.nix

    ../../services/cgit.nix
    ../../services/minecraft.nix
    ../../services/miniflux.nix
    ../../services/shiori.nix
    ../../services/matrix.nix
    ../../services/goatcounter.nix
    ../../services/irc
  ];

  foundation = {
    www = {
      enable = true;

      public = true;
      tailnet = true;
    };

    monitoring = {
      server = {
        enable = true;
        hosts = map (m: {
          inherit (m) name;
          inherit (m.tailscale) ip;
        }) machines;
      };

      services = [
        "base"
        "tailnet"
        "cache"
        "git"
        "mel"
        "shorest"
        "matrix"
        "goat"
      ];
    };
  };

  services.nginx.virtualHosts = {
    base.locations = {
      # redirect to akkoma on lapin
      "/.well-known/webfinger" = {
        return = "301 https://soc.rnrd.eu$request_uri";
      };

      # delegate matrix to subdomain `matrix.rnrd.eu`
      "/.well-known/matrix/server" = {
        return = "200 '{ \"m.server\": \"matrix.rnrd.eu:443\" }'";
        extraConfig = ''
          default_type application/json;
        '';
      };
      "/.well-known/matrix/client" = {
        return = ''
          200 '{
            "m.homeserver": {
              "base_url": "https://matrix.rnrd.eu/"
            },
            "org.matrix.msc3575.proxy": {
              "url": "https://matrix.rnrd.eu/"
            }
          }'
        '';
        extraConfig = ''
          default_type application/json;
          add_header "Access-Control-Allow-Origin" *;
        '';
      };
    };

    "sho.rest" = {
      enableACME = true;
      forceSSL = true;
      locations."/" = {
        proxyPass = "http://127.0.0.1:5000";
      };
      extraConfig = ''
        access_log /var/log/nginx/shorest.access.log json_combined;
      '';
    };

    "mel.gg" = {
      enableACME = true;
      forceSSL = true;
      root = "/srv/mel";
      extraConfig = ''
        access_log /var/log/nginx/mel.access.log json_combined;
      '';
    };

    "catskill.dev" = {
      enableACME = true;
      forceSSL = true;
      root = "/srv/catskill";
      extraConfig = ''
        access_log /var/log/nginx/catskill.access.log json_combined;
      '';
    };

    "moth.run" = {
      enableACME = true;
      forceSSL = true;
      root = "/srv/moth";
      extraConfig = ''
        access_log /var/log/nginx/moth.access.log json_combined;
      '';
    };
  };

  system.stateVersion = "24.05";
}