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

92
flake.lock generated
View File

@@ -129,6 +129,22 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1747046372,
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
@@ -189,6 +205,24 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_2": {
"inputs": {
"systems": "systems_4"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": { "gitignore": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -536,6 +570,26 @@
"type": "github" "type": "github"
} }
}, },
"nix-minecraft": {
"inputs": {
"flake-compat": "flake-compat_3",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1768357481,
"narHash": "sha256-LpOWVXsHx20x8eRIhn23Q0icmV3Z6ZeFpAPzEqldXFk=",
"owner": "Infinidoge",
"repo": "nix-minecraft",
"rev": "f888492aa1a1eeb0114cf78af40d44e8300e002e",
"type": "github"
},
"original": {
"owner": "Infinidoge",
"repo": "nix-minecraft",
"type": "github"
}
},
"nix-vm-test": { "nix-vm-test": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -640,6 +694,22 @@
} }
}, },
"nixpkgs": { "nixpkgs": {
"locked": {
"lastModified": 1748929857,
"narHash": "sha256-lcZQ8RhsmhsK8u7LIFsJhsLh/pzR9yZ8yqpTzyGdj+Q=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "c2a03962b8e24e669fb37b7df10e7c79531ff1a4",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1760423683, "lastModified": 1760423683,
"narHash": "sha256-Tb+NYuJhWZieDZUxN6PgglB16yuqBYQeMJyYBGCXlt8=", "narHash": "sha256-Tb+NYuJhWZieDZUxN6PgglB16yuqBYQeMJyYBGCXlt8=",
@@ -662,7 +732,7 @@
"nixpkgs" "nixpkgs"
], ],
"nuschtosSearch": "nuschtosSearch", "nuschtosSearch": "nuschtosSearch",
"systems": "systems_4" "systems": "systems_5"
}, },
"locked": { "locked": {
"lastModified": 1752010420, "lastModified": 1752010420,
@@ -681,7 +751,7 @@
}, },
"nuschtosSearch": { "nuschtosSearch": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils_2",
"ixx": "ixx", "ixx": "ixx",
"nixpkgs": [ "nixpkgs": [
"nixvim", "nixvim",
@@ -732,9 +802,10 @@
"home-manager": "home-manager", "home-manager": "home-manager",
"hyprland": "hyprland", "hyprland": "hyprland",
"impermanence": "impermanence", "impermanence": "impermanence",
"nix-minecraft": "nix-minecraft",
"nixos-anywhere": "nixos-anywhere", "nixos-anywhere": "nixos-anywhere",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs_2",
"nixvim": "nixvim", "nixvim": "nixvim",
"rust-overlay": "rust-overlay", "rust-overlay": "rust-overlay",
"sops-nix": "sops-nix" "sops-nix": "sops-nix"
@@ -840,6 +911,21 @@
"type": "github" "type": "github"
} }
}, },
"systems_5": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": { "treefmt-nix": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [

View File

@@ -42,6 +42,7 @@
url = "github:Mic92/sops-nix"; url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nix-minecraft.url = "github:Infinidoge/nix-minecraft";
}; };
outputs = { outputs = {

View File

@@ -11,10 +11,39 @@
in self.lib.nixpkgs-lib.nixosSystem { in self.lib.nixpkgs-lib.nixosSystem {
pkgs = import inputs.nixpkgs { pkgs = import inputs.nixpkgs {
inherit system; 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 = [ modules = [
{ networking.hostName = name; } { networking.hostName = name; }
(import ./${name}.nix { inherit flake self inputs; }) (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, modulesPath,
config, config,
... ...
}: { }: let system = pkgs.system; in {
imports = [ imports = [
(modulesPath + "/installer/cd-dvd/iso-image.nix")
self.nixosModules.hectic self.nixosModules.hectic
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
./minecraft.nix
./hardware.nix
]; ];
users.users.root.openssh.authorizedKeys.keys = [ 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; # disko.devices = {
boot.loader.efi.canTouchEfiVariables = true; # disk.master = {
boot.initrd.availableKernelModules = [ # device = lib.mkDefault "/dev/disk/by-id/nvme-eui.00000000000000000026b7686dfafe35";
"xhci_pci" # type = "disk";
"ahci" # content = {
"nvme" # type = "gpt";
"usbhid" # partitions = {
"sd_mod" # ESP = {
]; # size = "1G";
boot.initrd.kernelModules = ["nvme"]; # type = "EF00";
# content = {
disko.devices = { # type = "filesystem";
disk.master = { # format = "vfat";
device = lib.mkDefault "/dev/disk/by-id/nvme-eui.00000000000000000026b7686dfafe35"; # mountpoint = "/boot";
type = "disk"; # };
content = { # };
type = "gpt"; # root = {
partitions = { # size = "100%";
ESP = { # content = {
size = "1G"; # type = "filesystem";
type = "EF00"; # format = "ext4";
content = { # mountpoint = "/";
type = "filesystem"; # };
format = "vfat"; # };
mountpoint = "/boot"; # };
}; # };
}; # };
root = { # };
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
};
networking = { networking = {
networkmanager.enable = true; networkmanager.enable = true;
useDHCP = lib.mkDefault true; useDHCP = lib.mkDefault true;
interfaces.enp5s0.useDHCP = lib.mkDefault true; interfaces.enp6s0 = {
useDHCP = lib.mkDefault true;
wakeOnLan.enable = true;
};
firewall = { firewall = {
enable = true; enable = true;
allowedTCPPorts = [ allowedTCPPorts = [
80 443 80 443 # HTTP, HTTPS
]; ];
allowedUDPPorts = [ 9 ]; # Wake on LAN
}; };
}; };
@@ -83,4 +79,51 @@
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
defaultSopsFile = ../../../sus/neuro.yaml; 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
];
} }

View File

@@ -117,6 +117,7 @@ in {
py3-modulegraph = pkgs.callPackage ./py3-modulegraph.nix {}; py3-modulegraph = pkgs.callPackage ./py3-modulegraph.nix {};
py3-swifter = pkgs.callPackage ./py3-swifter.nix {}; py3-swifter = pkgs.callPackage ./py3-swifter.nix {};
py3-aiogram-newsletter = pkgs.callPackage ./py3-swifter.nix {}; py3-aiogram-newsletter = pkgs.callPackage ./py3-swifter.nix {};
py3-openai-shap-e = pkgs.callPackage ./py3-openai-shap-e.nix {};
nvim-alias = pkgs.callPackage ./nvim-alias.nix {}; nvim-alias = pkgs.callPackage ./nvim-alias.nix {};
bolt-unpack = pkgs.callPackage ./bolt-unpack.nix {}; bolt-unpack = pkgs.callPackage ./bolt-unpack.nix {};
nvim-pager = pkgs.callPackage ./nvim-pager.nix {}; nvim-pager = pkgs.callPackage ./nvim-pager.nix {};

View File

@@ -0,0 +1,40 @@
{
lib,
python3Packages,
fetchFromGitHub,
}: python3Packages.buildPythonPackage rec {
pname = "shap-e";
version = "1.0";
src = fetchFromGitHub {
inherit pname version;
owner = "openai";
repo = "shap-e";
rev = "50131012ee11c9d2617f3886c10f000d3c7a3b43";
sha256 = "sha256-RN4dARvz5fzoAFtEOdHWDuMqchCBuoGjsBv/yeWWai0=";
};
propagatedBuildInputs = with python3Packages; [
filelock
pillow
torch
fire
humanize
requests
tqdm
matplotlib
scikit-image
scipy
numpy
blobfile
clip
# NOTE(yukkop): not declared in setup.py, but crash on runtime without that
ipywidgets
];
meta = with lib; {
description = "Shape-e OpenAi model";
platforms = platforms.all;
};
}