-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MacOS and nix #7
Comments
The nixpkgs#darwin.builderMain references:
nix show-derivation nixpkgs#darwin.builder nix show-derivation --system aarch64-darwin nixpkgs#darwin.builder | jq '.[]."inputDrvs"' -r nix build -L --system aarch64-darwin nixpkgs#darwin.builder nix \
--option allowed-impure-host-deps \
'/bin/sh /usr/lib/libSystem.B.dylib /usr/lib/system/libunc.dylib /dev/zero /dev/random /dev/urandom' \
build \
-L \
--system aarch64-darwin \
nixpkgs#darwin.builder file /bin/sh /bin/sh: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64e:Mach-O 64-bit executable arm64e]
/bin/sh (for architecture x86_64): Mach-O 64-bit executable x86_64
/bin/sh (for architecture arm64e): Mach-O 64-bit executable arm64e TODO: Name itnix profile install nixpkgs#qemu_kvm nixpkgs#podman nixpkgs#socat podman machine stop; \
podman machine rm --force; \
podman --log-level=trace machine init --memory=3072 --cpus=8 \
&& podman --log-level=trace machine start socat -u OPEN:/dev/null UNIX-CONNECT:"${XDG_RUNTIME_DIR}"/tmp/podman-run-1000/podman/podman-machine-default_ready.sock curl -v -s -X GET --unix-socket /tmp/podman-run-1000/podman/podman-machine-default_ready.sock "http:///libpod/containers/json" qemu-system-x86_64 \
-m 3072 \
-smp 4 \
-fw_cfg name=opt/com.coreos/config,file=/home/vagrant/.config/containers/podman/machine/qemu/podman-machine-default.ign \
-qmp unix:/tmp/podman-run-$(id -u)/podman/qmp_podman-machine-default.sock,server=on,wait=off \
-netdev socket,id=vlan,fd=3 \
-device virtio-net-pci,netdev=vlan,mac=5a:94:ef:e4:0c:ee \
-device virtio-serial \
-chardev socket,path=/tmp/podman-run-$(id -u)/podman/podman-machine-default_ready.sock,server=on,wait=off,id=apodman-machine-default_ready \
-device virtserialport,chardev=apodman-machine-default_ready,name=org.fedoraproject.port.0 \
-pidfile /tmp/podman-run-$(id -u)/podman/podman-machine-default_vm.pid \
-accel kvm \
-cpu host \
-virtfs local,path=/home/vagrant,mount_tag=vol0,security_model=none \
-drive if=virtio,file=/home/vagrant/.local/share/containers/podman/machine/qemu/podman-machine-default_fedora-coreos-37.20230303.2.0-qemu.x86_64.qcow2 \
-nographic & podman system service --time=0 unix:///tmp/podman.sock & curl -s --unix-socket /tmp/podman.sock http://d/v1.0.0/libpod/info Refs.: NixOS build-vm--memory=3072 --cpus=8 podman machine stop; \
podman machine rm --force; \
podman --log-level=trace machine init --image-path $(show-coreos-path) \
&& podman --log-level=trace machine start Alpinepodman machine stop; \
podman machine rm --force; \
podman --log-level=trace machine init \
&& sleep 30 \
&& podman --log-level=trace machine start podman machine stop; \
podman machine rm --force; \
podman --log-level=trace machine init --memory=3072 --cpus=8 \
&& sleep 30 \
&& podman --log-level=trace machine start mkdir -p ~/.config/containers
cat << 'EOF' >> ~/.config/containers/policy.json
{
"default": [
{
"type": "insecureAcceptAnything"
}
],
"transports":
{
"docker-daemon":
{
"": [{"type":"insecureAcceptAnything"}]
}
}
}
EOF
mkdir -p ~/.config/containers
cat << 'EOF' >> ~/.config/containers/registries.conf
[registries.search]
registries = ['docker.io']
[registries.block]
registries = []
EOF Troubleshootingpodman machine list podman machine inspect cat /home/nixuser/.config/containers/storage.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Notes about nix and MacOS and AMD and ARM
Some background about AMD vs ARM
Take a look at:
brew
on Linux)., aboutdtruss
and https://ianthehenry.com/posts/how-to-learn-nix/more-flakes/-It only supports Linux, not macOS (some people use
brew
on Linux)., aboutdtrace
llvm-otool
, was it renamed?nix shell nixpkgs#llvm
it hasllvm-objdump
UTM
It worked, but still missing a lot of documentation!
Why?
https://www.slant.co/topics/511/~best-mac-package-managers
https://news.ycombinator.com/item?id=27825420
Setting up nix-darwin home-manager and flakes on M1 Macbook Pro OSX Monterey 12.0.1
Discontinuing support for macOS Monterey
Mitchell is a Co-founder and CTO of HashiCorp, creators of popular tools such as Terraform, Vault, Vagrant, Packer, and more.
List:
TODO: watch it
this Did someone say virtual is slow?, start=76&end=181
+
Walkthrough of Nix Install and Setup on MacOS
+
This Linux PC Runs macOS Faster Than a Real Mac
TODO:
The sandbox
Really watch this:
See https://discourse.nixos.org/t/nixos-virtual-machine-on-apple-m1-arm64/15167 and https://mac.getutm.app/
NixOS/nixpkgs#95903 (comment)
Bugs, many bugs
I tried 10 code editors, start=0&end=19
how a silent computer bug ended 6 lives
Bugs and more bugs:
https://github.com/NixOS/nix/pull/9860
Take an look at this:
List:
Domen Kožar - Nix Is Going Mainstream (SoN2022 - public lecture series), start=480&end=516
The NixOS "shebang" and the GNU/Linux kernel:
https://github.com/NixOS/nixpkgs/issues/24485#issuecomment-429636677
https://www.youtube.com/embed/QkcjCRE8Vvs?start=673&end=807&version=3
+
https://discussion.fedoraproject.org/t/disabling-selinux-breaks-docker-overlayfs/20232
MWEs + how to never write bug, start=264&end=294
Unfortunately there are really hard/impossible to reproduce bugs:
how to never write bug, start=294&end=319
If nothing works:
Specific to javascript, but valid for many other situations:
This kind of bug is scary:
TODO: test is
nix \ --extra-experimental-features 'nix-command flakes ca-derivations' \ realisation \ info \ github:NixOS/nixpkgs/58c85835512b0db938600b6fe13cc3e3dc4b364e#hello
"aarch64-darwin"
Darwin 22.3.0, macOS 13.2.1
yes
no
nix-env (Nix) 2.10.2
"nixpkgs"
/nix/var/nix/profiles/per-user/root/channels/nixpkgs
nix --extra-experimental-features 'nix-command flakes ca-derivations' realisation info github:NixOS/nixpkgs/nixpkgs-unstable#python3
The rosetta thing
List:
The qemu-user-static thing
What name put here?
macOS to NixOS the Purely Functional Linux Distribution by Daniel Britten
Franz Pletz: NixOS, start=913&end=928, about homebrew vs nix
https://discourse.nixos.org/t/nixos-on-the-new-apple-macbook-m1/15715/2
Remember Mac uses
zsh
(since when?):utmapp/UTM#2688 (comment)
MacOS Simple KVM
Part 1:
Part 2:
Part 3:
About the installer
TODO: try to test that
NixOS/nix#3616 (comment)
qemu
TODO: it documents part of history: https://stackoverflow.com/a/66887947
TODO: https://www.willhaley.com/blog/debian-arm-qemu/
nix \ build \ --no-write-lock-file \ --override-input nixpkgs github:nixos/nixpkgs/nixpkgs-unstable \ 'github:Mic92/nixos-aarch64-images#aarch64Image'
curl -O http://ftp.us.debian.org/debian/dists/stable/main/installer-armhf/current/images/cdrom/initrd.gz \ && curl -O http://ftp.us.debian.org/debian/dists/stable/main/installer-armhf/current/images/cdrom/vmlinuz curl -O -L https://cdimage.debian.org/debian-cd/current/armhf/iso-dvd/debian-11.1.0-armhf-DVD-1.iso
https://www.willhaley.com/blog/debian-arm-qemu/
file $(nix --system aarch64-darwin build --no-link --print-out-paths --print-build-logs github:NixOS/nixpkgs/nixpkgs-unstable#qemu)/bin/qemu-system-aarch64 nix --system aarch64-darwin run github:NixOS/nixpkgs/nixpkgs-unstable#qemu -- --version
qemu + NixOS => build-vm
Excelent: Running qemu-system-aarch64 with -accel hvf on aarch64-darwin
Copying files like .img .qcow2
https://serverfault.com/a/670227
https://stackoverflow.com/questions/41733410/remove-qcow2-image-files-holes
The text was updated successfully, but these errors were encountered: