School: remove most of the role

This commit is contained in:
Toast 2024-05-18 01:31:40 +02:00
parent 19985c86da
commit 28a3bf2509
11 changed files with 0 additions and 196 deletions

View file

@ -1,8 +1,5 @@
{...}: {
imports = [
./syncthing.nix
./mysql.nix
./xampp.nix
./mongodb.nix
];
}

View file

@ -1,34 +0,0 @@
{
config,
pkgs,
lib,
...
}: {
services.mongodb = {
enable = true;
package = pkgs.mongodb-5_0;
user = "toast";
};
# Don't autostart MySQL
systemd.services.mongodb.wantedBy = lib.mkForce [];
# Allow regular users to start/stop mongodb
# https://stackoverflow.com/questions/61480914/using-policykit-to-allow-non-root-users-to-start-and-stop-a-service
security.polkit.extraConfig = ''
polkit.addRule(function(action, subject) {
if (
action.id == "org.freedesktop.systemd1.manage-units" &&
action.lookup("unit") == "mongodb.service" &&
subject.user == "${config.services.mongodb.user}"
)
{
return polkit.Result.YES;
}
})
'';
environment.systemPackages = with pkgs; [
mongosh
];
}

View file

@ -1,36 +0,0 @@
{
config,
pkgs,
lib,
...
}: {
services.mysql = {
enable = true;
package = pkgs.mysql80;
user = "toast";
group = "users";
};
# Don't autostart MySQL
systemd.services.mysql.wantedBy = lib.mkForce [];
# Allow regular users to start/stop mysql
# https://stackoverflow.com/questions/61480914/using-policykit-to-allow-non-root-users-to-start-and-stop-a-service
security.polkit.extraConfig = ''
polkit.addRule(function(action, subject) {
if (
action.id == "org.freedesktop.systemd1.manage-units" &&
action.lookup("unit") == "mysql.service" &&
subject.user == "${config.services.mysql.user}"
)
{
return polkit.Result.YES;
}
})
'';
environment.systemPackages = with pkgs; [
mysql-workbench
mycli
];
}

View file

@ -1,34 +0,0 @@
{pkgs, ...}: let
booDark = pkgs.fetchzip {
url = "https://github.com/adorade/boodark/releases/download/v1.1.1/boodark-v1.1.1.zip";
hash = "sha256-GE/FtFlU6A4I9sRyjMhQIidGpDLD99Wzzngz3QI/rSo=";
};
in {
# I tried setting up httpd + php in class but I just gave up
virtualisation.oci-containers = {
containers."xampp" = {
autoStart = false;
image = "tomsik68/xampp";
#user = "${toString users.users.atfc.uid}:${toString users.groups.minecraft.gid}";
volumes = [
"xampp-mysql:/opt/lampp/var/mysql"
# No dark mode installed by default :(
"${booDark}:/opt/lampp/phpmyadmin/themes/booDark"
];
ports = ["41061:22" "41062:80"];
};
};
security.polkit.extraConfig = ''
polkit.addRule(function(action, subject) {
if (
action.id == "org.freedesktop.systemd1.manage-units" &&
action.lookup("unit") == "podman-xampp.service" &&
subject.user == "toast"
)
{
return polkit.Result.YES;
}
})
'';
}