Pareto Security Linux Support and Automated Tests: Recently shipped Linux support and built automated tests by setting up different Virtual Machines with various distros and mis-configurations. Used NixOS Integration Tests for Debian, Ubuntu, Fedora and NixOS itself.
- Nix natively on macOS: Installed Nix using the Determinate Systems installer as the official installer has no uninstall support. Found the Setting up Nix on macOS post helpful. Used
nix-darwinto control macOS settings with a single file. Configured it on GitHub at zupo/dotfiles. - Linux Builder: As macOS is a different architecture than NixOS, used the Linux Builder provided by
nix-darwin. Enabled it by addingnix.linux-builder.enable = true;todarwin-configuration.nixand verified it withsudo launchctl list org.nixos.linux-builder. Followed performance optimizations. - NixOS Tests on macOS: Installed and ran NixOS Integration Tests using the Linux Builder. Used Interactive Mode to debug when tests failed by building the test driver with
nix -L build github:tfc/nixos-integration-test-example#default.driverInteractiveand starting it with./result/bin/nixos-test-driver --keep-vm-state. SSHed into the VMs for debugging. Read the extensive NixOS Integration Tests blog post. - Troubleshooting: When getting strange errors, tried upgrading to the latest
nixpkgs, addingnix.linux-builder.ephemeral.enable = true, manually accepting SSH host keys after reinstallingnix-darwin, and checking if the test was using the correctpkgs.. - NixOS in a Virtual Machine: Used UTM to run a full-fledged NixOS. Installed UTM and downloaded the
64-bit ARMMinimal ISO image. Followed NixOS manual steps for partitioning and installation. Configured SSH access by addingservices.openssh.enable = true;andservices.openssh.permitRootLogin = "yes";to/etc/nixos/configuration.nix. Got the IP address withifconfigand SSHed into the VM. Enabled Nix features for NixOS Tests and addednix.settings.experimental-features = [ "nix-command" "flakes" ];to/etc/nixos/configuration.nix. Used nested virtualization for better performance on M3 CPU or newer Macs and Rosetta for x86 virtualization. Integrated VS Code with the VM by adding(fetchTarball "https://github.com/nix-community/nixos-vscode-server/tarball/master")to imports and installing theRemote - SSHextension. FixedCould not start dynamically linked executableerror by addingservices.vscode-server.enableFHS = true;.
- Nix natively on macOS: Installed Nix using the Determinate Systems installer as the official installer has no uninstall support. Found the Setting up Nix on macOS post helpful. Used
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用。你还可以使用@来通知其他用户。