Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save OllionDavidCunliffe/b95c7b2632efa7b803dde7ebe28dffd6 to your computer and use it in GitHub Desktop.
Save OllionDavidCunliffe/b95c7b2632efa7b803dde7ebe28dffd6 to your computer and use it in GitHub Desktop.
nixos
{ config, pkgs, ... }:
{
imports = [
./hardware-configuration.nix
];
# Proxmox agent installation
services.qemuGuest.enable = true;
# Enable SSH access to configure the system without a display
services.openssh.enable = true;
services.openssh.permitRootLogin = "yes"; # Allow root login for initial setup, disable it later for security.
# Allow connection via SSH after boot
networking.firewall.allowedTCPPorts = [ 22 ];
# Plasma 6 setup
services.xserver.enable = true;
services.xserver.layout = "us";
services.xserver.xkbOptions = "eurosign:e";
services.xserver.libinput.enable = true;
services.xserver.displayManager.sddm.enable = true;
services.xserver.desktopManager.plasma5.enable = true;
# GPU passthrough setup - NVIDIA driver installation for passthrough GPU (Nvidia 4090)
boot.extraModulePackages = [ config.boot.kernelPackages.nvidiaPackages.latest ];
services.xserver.videoDrivers = [ "nvidia" ];
hardware.opengl.enable = true;
hardware.nvidia.modesetting.enable = true;
# Install basic tools
environment.systemPackages = with pkgs; [
plasma-workspace
plasma-desktop
konsole
tmux
vim
go
python3
rustc
cargo
awscli
google-cloud-sdk
1password
firefox
];
# NetworkManager for easy networking
networking.networkmanager.enable = true;
# Set the default shell
programs.bash.enable = true;
# User configuration
users.users.yourUserName = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" ];
packages = with pkgs; [
go
python3
tmux
vim
awscli
google-cloud-sdk
rustc
cargo
];
};
# Enable serial console for Proxmox access
boot.loader.grub.terminalOutput = "serial";
boot.kernelParams = [ "console=tty0" "console=ttyS0,115200n8" ];
boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/vda"; # Adjust this according to your VM disk
# Allow unfree packages for NVIDIA driver
nixpkgs.config.allowUnfree = true;
system.stateVersion = "23.05"; # NixOS version
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment