added ender-ml
This commit is contained in:
42
flake.nix
42
flake.nix
@@ -53,7 +53,7 @@
|
||||
# Host type abstractions
|
||||
hostTypes = {
|
||||
# Server hosts
|
||||
isServer = hostname: builtins.elem hostname [ "buildbox" "acheron" ];
|
||||
isServer = hostname: builtins.elem hostname [ "acheron" "buildbox" "ender-ml" ];
|
||||
|
||||
# Linux desktop hosts
|
||||
isLinuxDesktop = hostname: builtins.elem hostname [ "eva-01" "eva-03" ];
|
||||
@@ -63,13 +63,26 @@
|
||||
|
||||
# Helper to get host type category
|
||||
getHostType = hostname:
|
||||
if builtins.elem hostname [ "buildbox" "acheron" ] then "server"
|
||||
if builtins.elem hostname [ "acheron" "buildbox" "ender-ml" ] then "server"
|
||||
else if hostname == "eva-02" then "macos"
|
||||
else "linux-desktop";
|
||||
};
|
||||
in
|
||||
{
|
||||
nixosConfigurations = {
|
||||
|
||||
acheron = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {
|
||||
inherit inputs pkgs-unstable configPath hostTypes;
|
||||
hostname = "acheron";
|
||||
};
|
||||
system = system;
|
||||
modules = [
|
||||
./hosts/acheron/configuration.nix
|
||||
inputs.home-manager.nixosModules.default
|
||||
];
|
||||
};
|
||||
|
||||
buildbox = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {
|
||||
inherit inputs pkgs-unstable configPath hostTypes;
|
||||
@@ -82,6 +95,18 @@
|
||||
];
|
||||
};
|
||||
|
||||
ender-ml = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {
|
||||
inherit inputs pkgs-unstable configPath hostTypes;
|
||||
hostname = "ender-ml";
|
||||
};
|
||||
system = system;
|
||||
modules = [
|
||||
./hosts/ender-ml/configuration.nix
|
||||
inputs.home-manager.nixosModules.default
|
||||
];
|
||||
};
|
||||
|
||||
eva-01 = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {
|
||||
inherit inputs pkgs-unstable configPath hostTypes;
|
||||
@@ -107,18 +132,7 @@
|
||||
inputs.home-manager.nixosModules.default
|
||||
];
|
||||
};
|
||||
|
||||
acheron = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {
|
||||
inherit inputs pkgs-unstable configPath hostTypes;
|
||||
hostname = "acheron";
|
||||
};
|
||||
system = system;
|
||||
modules = [
|
||||
./hosts/acheron/configuration.nix
|
||||
inputs.home-manager.nixosModules.default
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
darwinConfigurations = {
|
||||
|
||||
235
hosts/ender-ml/configuration.nix
Normal file
235
hosts/ender-ml/configuration.nix
Normal file
@@ -0,0 +1,235 @@
|
||||
# Edit this configuration file to define what should be installed on
|
||||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running 'nixos-help').
|
||||
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
pkgs-unstable,
|
||||
inputs,
|
||||
configPath,
|
||||
hostname,
|
||||
hostTypes,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
inputs.home-manager.nixosModules.default
|
||||
];
|
||||
|
||||
# Bootloader.
|
||||
boot.loader.grub.enable = lib.mkDefault true;
|
||||
boot.loader.grub.devices = [ "nodev" ];
|
||||
|
||||
nix.settings.experimental-features = ["nix-command" "flakes"];
|
||||
|
||||
# Nix optimizations
|
||||
nix.optimise.automatic = true;
|
||||
nix.settings.auto-optimise-store = true;
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
persistent = true;
|
||||
options = "--delete-older-than 30d";
|
||||
};
|
||||
|
||||
networking.hostName = "ender-ml"; # Define your hostname.
|
||||
|
||||
# Enable networking
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
# Enable OpenGL
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
virtualisation.docker.enable = true;
|
||||
|
||||
|
||||
hardware.nvidia = {
|
||||
|
||||
# Modesetting is required.
|
||||
modesetting.enable = true;
|
||||
|
||||
# Use the NVidia open source kernel module (not to be confused with the
|
||||
# independent third-party "nouveau" open source driver).
|
||||
# Support is limited to the Turing and later architectures. Full list of
|
||||
# supported GPUs is at:
|
||||
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
|
||||
# Only available from driver 515.43.04+
|
||||
open = false;
|
||||
|
||||
# Enable the Nvidia settings menu,
|
||||
# accessible via `nvidia-settings`.
|
||||
nvidiaSettings = true;
|
||||
|
||||
# Optionally, you may need to select the appropriate driver version for your specific GPU.
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
};
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "America/Los_Angeles";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ADDRESS = "en_US.UTF-8";
|
||||
LC_IDENTIFICATION = "en_US.UTF-8";
|
||||
LC_MEASUREMENT = "en_US.UTF-8";
|
||||
LC_MONETARY = "en_US.UTF-8";
|
||||
LC_NAME = "en_US.UTF-8";
|
||||
LC_NUMERIC = "en_US.UTF-8";
|
||||
LC_PAPER = "en_US.UTF-8";
|
||||
LC_TELEPHONE = "en_US.UTF-8";
|
||||
LC_TIME = "en_US.UTF-8";
|
||||
};
|
||||
|
||||
# Disable X11 for servers
|
||||
services.xserver.enable = false;
|
||||
|
||||
services.tailscale.enable = true;
|
||||
|
||||
# Configure keymap in X11
|
||||
services.xserver.xkb = {
|
||||
layout = "us";
|
||||
variant = "";
|
||||
};
|
||||
|
||||
# Enable CUPS to print documents.
|
||||
services.printing.enable = false;
|
||||
|
||||
# Enable sound with pipewire.
|
||||
# hardware.pulseaudio.enable = false;
|
||||
#hardware.pulseaudio = {
|
||||
# enable = true;
|
||||
# package = pkgs.pulseaudioFull;
|
||||
#};
|
||||
|
||||
# Enable touchpad support (enabled default in most desktopManager).
|
||||
# services.xserver.libinput.enable = true;
|
||||
|
||||
# VSCode-Server
|
||||
programs.nix-ld.enable = true;
|
||||
|
||||
programs.nix-ld.libraries = with pkgs; [
|
||||
stdenv.cc.cc.lib
|
||||
zlib
|
||||
glib
|
||||
libGL
|
||||
libGLU
|
||||
openssl
|
||||
];
|
||||
|
||||
# Enable ollama
|
||||
services.ollama = {
|
||||
enable = false;
|
||||
host = "0.0.0.0";
|
||||
openFirewall = true;
|
||||
acceleration = "cuda";
|
||||
package = pkgs-unstable.ollama;
|
||||
};
|
||||
|
||||
services.llama-cpp = {
|
||||
enable = true;
|
||||
package = pkgs-unstable.llama-cpp;
|
||||
cudaSupport = true;
|
||||
};
|
||||
|
||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||
programs.zsh.enable = true;
|
||||
users.users.rogueking = {
|
||||
isNormalUser = true;
|
||||
description = "rogueking";
|
||||
extraGroups = [ "networkmanager" "wheel" "docker" ];
|
||||
shell = pkgs.zsh;
|
||||
packages = with pkgs; [];
|
||||
};
|
||||
|
||||
# Install firefox.
|
||||
programs.firefox.enable = true;
|
||||
|
||||
# Allow unfree packages
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
security.polkit.enable = true;
|
||||
programs._1password.enable = true;
|
||||
programs._1password-gui = {
|
||||
enable = true;
|
||||
polkitPolicyOwners = [ "rogueking" ];
|
||||
};
|
||||
|
||||
# Enable OpenSSH daemon
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
ports = [ 22 ];
|
||||
settings = {
|
||||
PasswordAuthentication = true;
|
||||
AllowUsers = [ "rogueking"];
|
||||
UseDns = true;
|
||||
X11Forwarding = false;
|
||||
PermitRootLogin = "no";
|
||||
MaxAuthTries = 8;
|
||||
};
|
||||
};
|
||||
|
||||
users.users."rogueking".openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINXqriPZVIuduc/J7GS1mD171LL0gIbgEjlImsxedWVX"
|
||||
];
|
||||
|
||||
nixpkgs.config.permittedInsecurePackages = [
|
||||
"qtwebengine-5.15.19"
|
||||
"python3.12-ecdsa-0.19.1"
|
||||
];
|
||||
|
||||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Server-specific packages
|
||||
btop
|
||||
curl
|
||||
docker
|
||||
dust
|
||||
file
|
||||
findutils
|
||||
git
|
||||
gparted
|
||||
lazydocker
|
||||
nettools
|
||||
nix-prefetch-github
|
||||
nmap
|
||||
openssh
|
||||
openssl
|
||||
parted
|
||||
plocate
|
||||
ptunnel
|
||||
tailscale
|
||||
tlp
|
||||
unzip
|
||||
vim
|
||||
|
||||
pkgs-unstable.witr
|
||||
];
|
||||
|
||||
home-manager = {
|
||||
extraSpecialArgs = {
|
||||
inherit
|
||||
configPath
|
||||
inputs
|
||||
pkgs-unstable
|
||||
hostname
|
||||
hostTypes
|
||||
;
|
||||
};
|
||||
users = {
|
||||
"rogueking" = import ./../../home-manager/home.nix;
|
||||
};
|
||||
backupFileExtension = "backup";
|
||||
};
|
||||
|
||||
system.stateVersion = "25.11";
|
||||
}
|
||||
35
hosts/ender-ml/hardware-configuration.nix
Normal file
35
hosts/ender-ml/hardware-configuration.nix
Normal file
@@ -0,0 +1,35 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "uas" "sd_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/2387c615-e566-44ed-a708-ebd407ee16f6";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
swapDevices = [ {
|
||||
device = "/var/lib/swapfile";
|
||||
size = 4*1024;
|
||||
} ];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
Reference in New Issue
Block a user