Code Monkey home page Code Monkey logo

nixos_test1's Introduction

nixos_test1

  1. download qemu (virtual machine), ovmf (uefi support), nixos minimal installer
  2. efi stubs:
    • cp pathto/OVMF.fd pathto/qemu_imagedir/
    • cp pathto/OVMF_VARS.fd pathto/qemu_imagedir/
  3. qemu image creation inside qemu_imagedir/:
    • qemu-img create -f qcow2 nixos-encrypted.img 20G
  4. directory structure should be now the following:
qemu_imagedir/
qemu_imagedir/OVMF.fd
qemu_imagedir/OVMF_VARS.fd
qemu_imagedir/nixos-encrypted.img
  1. qemu run installer in qemu_imagedir/:
qemu-system-x86_64 -enable-kvm -boot d \
-cdrom ../nixos-minimal.iso \
-serial mon:stdio \
-net user \
-net nic \
-drive if=pflash,format=raw,unit=0,readonly=on,file=OVMF.fd \
-drive if=pflash,format=raw,unit=1,file=OVMF_VARS.fd \
-m 2G -cpu host -smp 2 -hda nixos-encrypted.img
# to work from in host shell for efi image (in dos one can select ttyS0 from grub)
# run the following after nixos was booted:
sudo systemctl start serial-getty@ttyS0
  1. setting up harddrive: run install-testbox.sh
  2. TODO: minimal user config for testing uefi:
sudo nixos-generate-config --root /mnt
curl -LO github.com/matu3ba/nixos_test1/archive/master.zip # workaround: git not installed
#wget github.com/matu3ba/nixos_test1/archive/master.zip # wget not installed
unzip master.zip
mv nixos_test1-master/ nixos_test1/ # github archiver being annoyoing
  1. sudo nixos-install --no-root-passwd
  2. qemu run user
qemu-system-x86_64 -enable-kvm \
-serial mon:stdio \
-net user \
-net nic \
-drive if=pflash,format=raw,unit=0,readonly=on,file=OVMF.fd \
-drive if=pflash,format=raw,unit=1,file=OVMF_VARS.fd \
-m 2G -cpu host -smp 2 -hda nixos-encrypted.img
  1. TODO: minimal user config for testing ssh
  2. TODO: minimal user config for automatic sending of commands via ssh
  3. TODO: zig fun: fetch+build stuff from source to test, if setup works
  4. TODO: make stuff OS agnostic?

side tasks

  • TODO usable user config
  • TODO enable logging for sshd
  • TODO fix ssh in nixos user ssh nixos@localhost -p 2022 in qemu (connection refused) ?

sources

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.