fix: BIOS/MBR boot, crablo SSH key

This commit is contained in:
2026-05-08 05:04:57 +00:00
parent c228a37fd8
commit 0de970e349
+40 -39
View File
@@ -1,99 +1,100 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
# VM Hardware Configuration # ─── Boot ──────────────────────────────────────────────────────────────────
boot.loader.grub = { boot.loader.grub = {
enable = true; enable = true;
device = "/dev/sda"; device = "/dev/sda"; # BIOS/MBR install on scsi0
useOSProber = false; useOSProber = false;
}; };
# Filesystem — will be generated by nixos-generate-config, but override boot.kernelPackages = pkgs.linuxPackages_latest;
fileSystems."/" = lib.mkDefault {
# ─── Filesystems ───────────────────────────────────────────────────────────
fileSystems."/" = {
device = "/dev/disk/by-label/nixos"; device = "/dev/disk/by-label/nixos";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = lib.mkDefault {
device = "/dev/disk/by-label/boot";
fsType = "vfat";
};
# Network swapDevices = [{ device = "/dev/disk/by-label/swap"; }];
# ─── Hardware ──────────────────────────────────────────────────────────────
services.qemuGuest.enable = true;
# ─── Network ───────────────────────────────────────────────────────────────
networking = { networking = {
hostName = "nixos-dev"; hostName = "nixos-dev";
networkmanager.enable = true; networkmanager.enable = true;
useDHCP = true; useDHCP = lib.mkDefault true;
firewall = { firewall = {
enable = true; enable = true;
allowedTCPPorts = [ 22 8000 8080 3000 ]; allowedTCPPorts = [ 22 3000 8000 8080 ];
}; };
}; };
# QEMU Guest Agent (for Proxmox integration) # ─── SSH ───────────────────────────────────────────────────────────────────
services.qemuGuest.enable = true;
# SSH
services.openssh = { services.openssh = {
enable = true; enable = true;
settings = { settings = {
PermitRootLogin = "no"; PermitRootLogin = "no";
PasswordAuthentication = true; # change to no after keys deployed PasswordAuthentication = false;
}; };
}; };
# User configuration # ─── Users ─────────────────────────────────────────────────────────────────
users.users.konrad = { users.users.konrad = {
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" "docker" "networkmanager" ]; extraGroups = [ "wheel" "docker" "networkmanager" ];
shell = pkgs.zsh; shell = pkgs.zsh;
# Temporary password — change after first login openssh.authorizedKeys.keys = [
initialPassword = "changeme"; # crablo (OpenClaw agent)
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJLK3oQWZNq7vanyv6E6DM4QTN03sKhp149Ob44YTiS4 crablo@proxmox"
];
}; };
# System-wide programs security.sudo.wheelNeedsPassword = false;
# ─── Programs ──────────────────────────────────────────────────────────────
programs = { programs = {
zsh.enable = true; zsh.enable = true;
git.enable = true; git.enable = true;
}; };
# System packages (minimal core)
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
curl curl
wget
git git
vim vim
neovim
htop htop
btop
ripgrep
fd
jq
tree
unzip
tmux
]; ];
# Docker # ─── Docker ────────────────────────────────────────────────────────────────
virtualisation.docker = { virtualisation.docker = {
enable = true; enable = true;
enableOnBoot = true; enableOnBoot = true;
}; };
# Nix configuration # ─── Nix ───────────────────────────────────────────────────────────────────
nix = { nix.settings = {
settings = {
experimental-features = [ "nix-command" "flakes" ]; experimental-features = [ "nix-command" "flakes" ];
auto-optimise-store = true; auto-optimise-store = true;
trusted-users = [ "root" "konrad" ];
}; };
gc = {
nix.gc = {
automatic = true; automatic = true;
dates = "weekly"; dates = "weekly";
options = "--delete-older-than 7d"; options = "--delete-older-than 7d";
}; };
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
# Auto-upgrades system.stateVersion = "24.11";
system = {
stateVersion = "24.11";
autoUpgrade = {
enable = true;
allowReboot = false;
};
};
# Enable flakes in this boot configuration
boot.kernelPackages = pkgs.linuxPackages_latest;
} }