160 lines
4.1 KiB
Nix
160 lines
4.1 KiB
Nix
{
|
|
inputs,
|
|
flake,
|
|
self,
|
|
}: {
|
|
lib,
|
|
pkgs,
|
|
modulesPath,
|
|
config,
|
|
...
|
|
}: let system = pkgs.stdenv.hostPlatform.system; in {
|
|
imports = [
|
|
self.nixosModules.hectic
|
|
inputs.sops-nix.nixosModules.sops
|
|
./minecraft.nix
|
|
./hardware.nix
|
|
];
|
|
|
|
users.users.root.openssh.authorizedKeys.keys = [
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIETMumAHP+htbRvbrmzVoeesbT0+WcH1Wz8htk+7Ik+6"
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEJZFglwpPMFLnQDOqi84nlMFktZSSu1GzUIafvClUaD"
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGj7u/JuY9RwjoxnmO2b+pwC8XbMn+QOy44UpuN0Y1do riquizu"
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBbR42mLupcsF64ydGSx7HdB+qMVJq41a43UZMI7VvOj"
|
|
];
|
|
|
|
# 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 = "/";
|
|
# };
|
|
# };
|
|
# };
|
|
# };
|
|
# };
|
|
# };
|
|
|
|
#hectic.services.matrix = {
|
|
# enable = true;
|
|
# secretsFile = config.sops.secrets."matrix/secrets".path;
|
|
# turnSecretFile = config.sops.secrets."matrix/turn-secret".path;
|
|
# postgresql = {
|
|
# port = 5432;
|
|
# initialEnvFile = config.sops.secrets."init-postgresql".path;
|
|
# };
|
|
# matrixDomain = "accord.tube";
|
|
#};
|
|
|
|
networking = {
|
|
networkmanager.enable = true;
|
|
useDHCP = lib.mkDefault true;
|
|
interfaces.enp6s0 = {
|
|
useDHCP = lib.mkDefault true;
|
|
wakeOnLan.enable = true;
|
|
};
|
|
firewall = {
|
|
enable = true;
|
|
allowedTCPPorts = [
|
|
80 443 # HTTP, HTTPS
|
|
];
|
|
allowedUDPPorts = [ 9 ]; # Wake on LAN
|
|
};
|
|
};
|
|
|
|
hardware.enableRedistributableFirmware = true;
|
|
|
|
hectic = {
|
|
archetype.base.enable = true;
|
|
archetype.dev.enable = true;
|
|
};
|
|
|
|
sops = {
|
|
gnupg.sshKeyPaths = [ ];
|
|
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
|
defaultSopsFile = ../../../sus/neuro.yaml;
|
|
|
|
secrets."init-postgresql" = {};
|
|
secrets."matrix/secrets" = {};
|
|
secrets."matrix/turn-secret" = {
|
|
owner = "turnserver";
|
|
group = "turnserver";
|
|
mode = "0400";
|
|
};
|
|
};
|
|
|
|
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; let
|
|
python-ai = python3.withPackages (ps: let
|
|
torchCuda = ps.torchWithCuda;
|
|
torchvision = ps.torchvision.override { torch = torchCuda; };
|
|
pytorch3dCuda = ps.pytorch3d.override { torch = torchCuda; };
|
|
in [
|
|
torchCuda
|
|
torchvision
|
|
pytorch3dCuda
|
|
ps.fvcore
|
|
ps.iopath
|
|
ps.tqdm
|
|
hectic.py3-openai-shap-e # Uncomment when needed; depends on torch
|
|
]);
|
|
in [
|
|
#python-ai
|
|
git
|
|
neovim
|
|
wget
|
|
ethtool
|
|
rsync
|
|
# docker
|
|
];
|
|
}
|