Skip to content
Oeiuwq Faith Blog OpenSource Porfolio

adeci/guix-by-nix.json
{
"createdAt": "2026-07-13T19:53:15Z",
"defaultBranch": "main",
"description": "are we guix yet?",
"fullName": "adeci/guix-by-nix",
"homepage": "",
"language": "Nix",
"name": "guix-by-nix",
"pushedAt": "2026-07-30T04:06:11Z",
"stargazersCount": 5,
"topics": [],
"updatedAt": "2026-07-30T22:48:06Z",
"url": "https://github.com/adeci/guix-by-nix"
}

NixOSn’t. Nix builds it. Shepherd runs it.

Guix by Nix is an interactive x86_64 QEMU VM. Nix builds it from translated Guix package graphs. The guest boots Guix Linux-libre 6.12.62-gnu and runs GNU Shepherd 1.0.9 as PID 1.

Nix evaluates the checked-in package expressions, builds the system, creates the initrd and disk image, starts QEMU, and runs the tests. Nix is not installed in the guest.

Guix package definitions
-> guix-transfer translates the evaluated derivation graph
-> GuixPkgs stores the generated Nix expressions
-> Nix builds the kernel and userland
-> QEMU boots Guix Linux-libre
-> Guix Bash runs the initrd and activation
-> GNU Shepherd starts as PID 1

guix-transfer converts concrete Guix derivations from /gnu/store to /nix/store. GuixPkgs checks the generated expressions into a flake.

Guix and the Guix daemon are not needed when this project is evaluated.

PartImplementation
KernelGuix Linux-libre 6.12.62-gnu and its modules
InitrdGuix Bash, Coreutils, kmod, and util-linux
ActivationA Nix-written shell script run by Guix Bash
PID 1GNU Shepherd 1.0.9
Deviceseudev
Networkdhcpcd, openresolv, iproute2, iputils, curl, and Mozilla CA certificates
LoginShadow, Linux-PAM, sudo, and Guix Bash
UserlandRaw translated Guix package outputs

The guest has no systemd, D-Bus, logind, NixOS activation, GuixPkgs wrapper trees, or firmware files. Nix adds the metadata required by its VM builder to the translated kernel output. It does not rebuild or patch the kernel.

The system path contains 42 selected Guix packages:

  • Shell and language: Bash, Guile
  • Core tools: Coreutils, grep, sed, gawk, findutils, diffutils, procps, which, time
  • Interactive tools: htop, tmux, nano, less, ncurses
  • Archives: tar, gzip, bzip2, xz, zstd, cpio, patch
  • Administration: util-linux, Shadow, sudo, kbd, ACL, attr, libcap, kmod, e2fsprogs
  • Networking: inetutils, iproute2, iputils, dhcpcd, openresolv, curl, nss-certs
  • Services and login: Shepherd, eudev, Linux-PAM

Git, an SSH server, compilers, graphical software, the Nix CLI, the Guix CLI, and both package-manager daemons are left out.

GuixPkgs normally wraps each command so it can source that package’s generated runtime profile. That is useful for a standalone nix shell or nix run.

This VM uses each package’s .unwrapped output for its shared system path. It takes the available .runtimeEnv profile fragments, checks them, removes duplicates, and writes one /etc/profile.

Inside the VM, wrappers would repeat profile setup for every command and replace raw Guix executables with launcher scripts.

Sudo also needs a raw ELF file for its privileged copy. A wrapper script cannot be used there. Wrapped and unwrapped packages depend on the same translated Guix derivation, so .unwrapped changes only how the guest is assembled.

The translated sudo file in the Nix store has mode 0555. During activation it is copied to /run/privileged/bin/sudo, changed to root:root, and then given mode 4755. /run/setuid-programs/sudo is a compatibility link to the same copy.

The guest account belongs to wheel and uses its own password with sudo. Ping does not use a setuid binary; activation enables unprivileged ICMP echo sockets through net.ipv4.ping_group_range.

Terminal window
nix run --accept-flake-config . --option filter-syscalls false

The default app runs the VM; nix build produces the same VM runner.

Serial login credentials:

root / guix-by-nix
guest / guix-by-nix

The 42 packages listed above are available directly from the login shell.

QEMU provides outbound NAT at 10.0.2.15, gateway 10.0.2.2, and resolver 10.0.2.3. The login profile points curl at the CA certificates from Guix nss-certs. Public network access still depends on the host. No inbound ports are forwarded.

From guest, shut down or reboot with:

Terminal window
sudo shutdown
sudo reboot

Both commands act immediately. Shepherd does not accept the systemd-style now argument.

flake.nix public packages, apps, configuration, and checks
nix/modules/ VM configurations
nix/activation/ accounts, /etc, and privileged programs
nix/initrd/ initrd module list
nix/kernel/ Linux-libre adapter
nix/runtime/ raw packages and the merged profile
nix/audit/ closure, executable, and status reports
tests/ Nix checks and Python VM drivers
docs/ implementation and testing notes

See the [documentation index]!(docs/README.md) for implementation and test details.