Skip to content

charles-dyfis-net/nixos-lima

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Run NixOS on a Lima VM

Heavily inspired from patryk4815/ctftools

Generating the image

On a linux machine or ubuntu lima vm for example:

# install nix
sh <(curl -L https://nixos.org/nix/install) --daemon
# enable kvm feature
echo "system-features = nixos-test benchmark big-parallel kvm" >> /etc/nix/nix.conf
reboot

# build image
nix --extra-experimental-features 'nix-command flakes' build .#packages.aarch64-linux.img
cp result/nixos.img /tmp/lima/nixos-aarch64.img

On your mac:

  • Move nixos-aarch64.img under imgs

Running NixOS

limactl start --name=default nixos.yaml

lima
# switch to this repo directory
nixos-rebuild switch --flake .#nixos --use-remote-sudo

About

Create a NixOS VM using Lima

Resources

Stars

Watchers

Forks

Languages

  • Nix 65.9%
  • Shell 34.1%