236 lines
5.1 KiB
Nix
236 lines
5.1 KiB
Nix
# 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";
|
||
}
|