Compare commits

...

7 Commits

6 changed files with 42 additions and 6 deletions
Split View
  1. +2
    -0
      common/variables.nix
  2. +1
    -0
      hosts/hardcase/configuration.nix
  3. +6
    -0
      hosts/hardcase/hardware-configuration.nix
  4. +20
    -0
      packages/percona-server80.nix
  5. +3
    -6
      services/gitea.nix
  6. +10
    -0
      services/mysql.nix

+ 2
- 0
common/variables.nix View File

@@ -1,4 +1,6 @@
{
secrets = import /var/secrets/secrets.nix;

tld = "redbricktest.ml";

certsDir = "/var/lib/acme";


+ 1
- 0
hosts/hardcase/configuration.nix View File

@@ -8,6 +8,7 @@ in {
../../services/ssh.nix
../../services/postgres.nix
../../services/gitea.nix
../../services/mysql.nix
];

# This value determines the NixOS release with which your system is to be


+ 6
- 0
hosts/hardcase/hardware-configuration.nix View File

@@ -28,6 +28,12 @@
fsType = "zfs";
};

# zfs create -o dedup=off -o mountpoint=legacy -o recordsize=4K zroot/postgres
fileSystems."/zroot/mysql" =
{ device = "zroot/mysql";
fsType = "zfs";
};

# zfs create -o mountpoint=legacy zroot/git
fileSystems."/zroot/git" =
{ device = "zroot/git";


+ 20
- 0
packages/percona-server80.nix View File

@@ -0,0 +1,20 @@
{ pkgs ? import <nixpkgs> {} }:
let
version = "8.0.16-7";
in pkgs.mysql80.overrideAttrs (oldAttrs: {
name = "percona-server80";

src = pkgs.fetchurl {
url = "https://www.percona.com/downloads/Percona-Server-8.0/Percona-Server-${version}/source/tarball/percona-server-${version}.tar.gz";
sha256 = "1677jm271l8jy7566r7lb5z1bfbfrc50yfkvggs58w4i4df6i3wg";
};

buildInputs = oldAttrs.buildInputs ++ [
pkgs.rapidjson pkgs.curl pkgs.boost169 pkgs.libtirpc pkgs.cyrus_sasl
];
cmakeFlags = oldAttrs.cmakeFlags ++ [
"-DWITH_ROCKSDB=0"
];

meta = pkgs.percona-server.meta // { inherit version; };
})

+ 3
- 6
services/gitea.nix View File

@@ -3,6 +3,7 @@ let

stateDir = "/var/lib/gitea";
repositoryRoot = "/zroot/git";
tokenPath = "/var/secrets/gitea_token.secret";
in {
users.users.git = {
description = "Service user for gitea";
@@ -70,16 +71,12 @@ in {

[security]
INSTALL_LOCK = true
SECRET_KEY = ZaAgYxsMt3
INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE0OTI2MDcxMDR9.T3CCdLpGcXvOzC_Wg7Uq8fN-YE3TCJPofGmiHnaypUg
SECRET_KEY = ${common.secrets.gitea.secret_key}
INTERNAL_TOKEN_URI = file:${tokenPath}

[openid]
ENABLE_OPENID_SIGNUP = false
ENABLE_OPENID_SIGNIN = false

[oauth2]
JWT_SECRET = 0l4Md3fIHiSXRVK4gFpvO2CFXqhb8qSzWLuHPioWUyo

'';
};



+ 10
- 0
services/mysql.nix View File

@@ -0,0 +1,10 @@
{ pkgs, ... }:
let
package = import ../packages/percona-server80.nix { inherit pkgs; };
in {
services.mysql = {
inherit package;
enable = true;
dataDir = "/zroot/mysql";
};
}

Loading…
Cancel
Save