summary refs log tree commit diff
path: root/pkgs/wine.nix
diff options
context:
space:
mode:
authorMel <mel@rnrd.eu>2025-08-18 21:59:41 +0200
committerMel <mel@rnrd.eu>2025-08-28 17:43:32 +0200
commit2589535363eea964fc18c51313afdeabff525b65 (patch)
treef8eef386b4b4f383744673580290b4a26a5dacc2 /pkgs/wine.nix
parentb2bdb895e0b4f9af269b8f15bbb322768203d7d5 (diff)
downloadminerals-2589535363eea964fc18c51313afdeabff525b65.tar.zst
minerals-2589535363eea964fc18c51313afdeabff525b65.zip
Asahi `withRust` kernel option deprecated
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'pkgs/wine.nix')
0 files changed, 0 insertions, 0 deletions
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, lib, pkgs, auxiliaryPkgs, ... }:

let
  inherit (pkgs) victoriametrics grafana dockerTools;
  inherit (auxiliaryPkgs) common;

  victoriaLocalPort = 8428;
  grafanaLocalPort = 7181;

  monitoringDir = "/srv/monitoring";
  victoriaDir = "${monitoringDir}/victoria";
  grafanaDir = "${monitoringDir}/grafana";

  victoriaImage = dockerTools.streamLayeredImage {
    name = "victoriametrics";
    tag = victoriametrics.version;
    fromImage = common.alpine.base;

    contents = [ victoriametrics ];
  };

  grafanaImage = dockerTools.streamLayeredImage {
    name = "grafana";
    tag = grafana.version;
    fromImage = common.alpine.base;

    contents = [ grafana ];

    extraCommands = ''
      mkdir -p ./var/lib/grafana
      ln -fs ${grafana}/share/grafana/conf ./var/lib/grafana/
      ln -fs ${grafana}/share/grafana/public ./var/lib/grafana/
    '';
  };
in
{
  foundation.service.monitoring = {
    victoria = {
      image = victoriaImage;
      ports = [ (common.tailnetPort me victoriaLocalPort) ];

      volumes = [
        [ "${victoriaDir}" "/var/lib/victoria" ]
      ];

      entrypoint = lib.getExe victoriametrics;
      cmd = [
        "-storageDataPath=/var/lib/victoria"
        "-httpListenAddr=:${toString victoriaLocalPort}"
      ];
    };

    grafana = {
      image = grafanaImage;

      ports = [
        [ grafanaLocalPort 3000 ]
      ];

      volumes = [
        [ "${monitoringDir}/grafana.ini" "/etc/grafana/grafana.ini" ]
        [ "${grafanaDir}/data" "/var/lib/grafana/data" ]
        [ "${grafanaDir}/plugins" "/var/lib/grafana/plugins" ]
        [ "${grafanaDir}/provision" "/var/lib/grafana/provision" ]
      ];

      workdir = "/var/lib/grafana";
      entrypoint = lib.getExe' grafana "grafana";
      cmd = [
        "server"
        "--homepath=/var/lib/grafana"
        "--config=/etc/grafana/grafana.ini"
        "--packaging=docker"
      ];
    };
  };

  services.nginx.virtualHosts."grafana.rnrd.fyi" = {
    useACMEHost = "rnrd.fyi";
    forceSSL = true;
    listenAddresses = [ me.tailscale.ip ];
    locations."/" = {
      proxyPass = "http://127.0.0.1:${toString grafanaLocalPort}/";
      proxyWebsockets = true;
    };
  };
}