apply patch from neuro

This commit is contained in:
2026-02-20 12:51:32 +00:00
parent 799ad9a15d
commit 63a7fd716f
8 changed files with 283 additions and 48 deletions

View File

@@ -11,10 +11,39 @@
in self.lib.nixpkgs-lib.nixosSystem {
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
overlays = [
self.overlays.default
inputs.nix-minecraft.overlay
];
config.allowUnfreePredicate = pkg: builtins.elem (self.lib.nixpkgs-lib.getName pkg) [
"minecraft-server"
"nvidia-x11"
"cuda_nvcc"
"cuda_cudart"
"cuda_cuobjdump"
"cuda_cupti"
"cuda_nvdisasm"
"cuda_cccl"
"cuda_nvml_dev"
"cuda_nvrtc"
"cuda_nvtx"
"cuda_profiler_api"
"libcusparse_lt"
"libcublas"
"libcufft"
"libcufile"
"libcurand"
"libcusolver"
"libnvjitlink"
"libcusparse"
"cudnn"
];
};
modules = [
{ networking.hostName = name; }
(import ./${name}.nix { inherit flake self inputs; })
inputs.nix-minecraft.nixosModules.minecraft-servers
];
}

View File

@@ -0,0 +1,10 @@
{ ... }:
{
services.xserver.videoDrivers = [ "nvidia" ];
hardware.graphics.enable = true;
hardware.nvidia = {
open = false;
nvidiaSettings = false;
modesetting.enable = false;
};
}

View File

@@ -0,0 +1,25 @@
{
pkgs,
...
}:
{
services.minecraft-servers = {
enable = true;
eula = true;
openFirewall = true;
servers.vanilla = {
enable = true;
jvmOpts = "-Xmx6G -Xms2G";
package = pkgs.minecraftServers.vanilla-1_21_11;
serverProperties = {
difficulty = "hard";
online-mode = true;
view-distance = 32;
level-seed = "8306359138650378643";
pause-when-empty-seconds = 0;
};
};
};
}

View File

@@ -8,66 +8,62 @@
modulesPath,
config,
...
}: {
}: let system = pkgs.system; in {
imports = [
(modulesPath + "/installer/cd-dvd/iso-image.nix")
self.nixosModules.hectic
inputs.sops-nix.nixosModules.sops
./minecraft.nix
./hardware.nix
];
users.users.root.openssh.authorizedKeys.keys = [
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEJZFglwpPMFLnQDOqi84nlMFktZSSu1GzUIafvClUaD''
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIETMumAHP+htbRvbrmzVoeesbT0+WcH1Wz8htk+7Ik+6"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEJZFglwpPMFLnQDOqi84nlMFktZSSu1GzUIafvClUaD"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGj7u/JuY9RwjoxnmO2b+pwC8XbMn+QOy44UpuN0Y1do riquizu"
];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usbhid"
"sd_mod"
];
boot.initrd.kernelModules = ["nvme"];
disko.devices = {
disk.master = {
device = lib.mkDefault "/dev/disk/by-id/nvme-eui.00000000000000000026b7686dfafe35";
type = "disk";
content = {
type = "gpt";
partitions = {
ESP = {
size = "1G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
};
# disko.devices = {
# disk.master = {
# device = lib.mkDefault "/dev/disk/by-id/nvme-eui.00000000000000000026b7686dfafe35";
# type = "disk";
# content = {
# type = "gpt";
# partitions = {
# ESP = {
# size = "1G";
# type = "EF00";
# content = {
# type = "filesystem";
# format = "vfat";
# mountpoint = "/boot";
# };
# };
# root = {
# size = "100%";
# content = {
# type = "filesystem";
# format = "ext4";
# mountpoint = "/";
# };
# };
# };
# };
# };
# };
networking = {
networkmanager.enable = true;
useDHCP = lib.mkDefault true;
interfaces.enp5s0.useDHCP = lib.mkDefault true;
interfaces.enp6s0 = {
useDHCP = lib.mkDefault true;
wakeOnLan.enable = true;
};
firewall = {
enable = true;
allowedTCPPorts = [
80 443
80 443 # HTTP, HTTPS
];
allowedUDPPorts = [ 9 ]; # Wake on LAN
};
};
@@ -83,4 +79,51 @@
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
defaultSopsFile = ../../../sus/neuro.yaml;
};
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "sr_mod" "ext4" ];
boot.initrd.kernelModules = [ "nvme" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-label/NIXBOOT";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware = {
cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
};
swapDevices = [ ];
programs.tmux.enable = true;
zramSwap.enable = true;
zramSwap.priority = 100;
zramSwap.memoryMax = null;
zramSwap.algorithm = lib.mkDefault "zstd";
zramSwap.swapDevices = 1;
zramSwap.memoryPercent = lib.mkDefault 100;
environment.systemPackages = with pkgs; [
# (pkgs.python3.withPackages (ps: with ps; [
# hectic.py3-openai-shap-e
# torchWithCuda torchvision pytorch3d
# fvcore iopath tqdm
# ]))
git
neovim
wget
ethtool
rsync
# docker
];
}