https://hydra.nixos.org/job/nixos/trunk-combined/nixos.iso_minimal.aarch64-linux
https://docs.getutm.app/advanced/rosetta/ https://krisztianfekete.org/nixos-on-apple-silicon-with-utm/ https://xyno.space/post/nixos-utm-rosetta
parted /dev/vda -- mklabel gpt | |
parted /dev/vda -- mkpart primary 1GiB -8GiB | |
parted /dev/vda -- mkpart primary linux-swap -8GiB 100% | |
parted /dev/vda -- mkpart ESP fat32 1MiB 512MiB | |
parted /dev/vda -- set 3 esp on | |
mkfs.ext4 -L nixos /dev/vda1 | |
mkswap -L swap /dev/vda2 | |
mkfs.fat -F 32 -n boot /dev/vda3 | |
mount /dev/disk/by-label/nixos /mnt | |
mkdir -p /mnt/boot | |
mount /dev/disk/by-label/boot /mnt/boot | |
nixos-generate-config --root /mnt | |
# edit /mnt/etc/nixos/configuration.nix | |
nixos-install --no-root-passwd |
{ config, pkgs, ... }: | |
{ | |
imports = | |
[ # Include the results of the hardware scan. | |
./hardware-configuration.nix | |
]; | |
# Use the systemd-boot EFI boot loader. | |
boot.loader.systemd-boot.enable = true; | |
boot.loader.efi.canTouchEfiVariables = true; | |
virtualisation.rosetta.enable = true; | |
nix.settings.experimental-features = [ "nix-command" "flakes" ]; | |
nix.package = pkgs.nixUnstable; | |
networking.hostName = "nixos"; | |
security.sudo.wheelNeedsPassword = false; | |
users.users.will = { | |
isNormalUser = true; | |
openssh.authorizedKeys.keys =["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGq0NvOp8fyKAS3iHPad2Mz6cOVKNBIElLpnHMy9zNve" ]; | |
extraGroups = [ "wheel" ]; | |
initialHashedPassword=""; # no password local login, still need key for ssh | |
}; | |
environment.systemPackages = with pkgs; [ | |
neovim | |
]; | |
services.openssh.enable = true; | |
system.stateVersion = "23.05"; # Did you read the comment? | |
} |