nix-community / nixos-anywhere

install nixos everywhere via ssh [maintainer=@numtide]
https://nix-community.github.io/nixos-anywhere/
MIT License
1.67k stars 115 forks source link

Using --build-on-remote targets i686-linux #169

Open dustinlyons opened 1 year ago

dustinlyons commented 1 year ago

Describe the bug

When trying to build my x86_64-linux machine from my M1 Macbook, I get the following error:

Failed to find a machine for remote build!
derivation: bm173dm4why0gsh6h485v6q9dgz1r9gb-nv-codec-headers-11.1.5.2.drv
required (system, features): (i686-linux, [])
1 available machines:
(systems, maxjobs, supportedFeatures, mandatoryFeatures)
([x86_64-linux], 1, [], [])

Previously I was able to build this system successfully if running locally. The x86_64-linux machine in question is a local bare metal PC in my office, running the latest NixOS installer (23.05).

I'm unsure why i686-linux is being targeted here.

To Reproduce

Steps to reproduce the behavior:

I ran this on my local LAN:

nix run github:dustinlyons/nixos-anywhere -- root@192.168.0.134 --flake .#felix --build-on-remote -L

Expected behavior

I expect the system closure to be built. I'm unsure why ffmpeg headers are being targeted for i686-linux.

System information

Here's my code: https://github.com/dustinlyons/nixos-config

Additional context

Logs:

nix run github:numtide/nixos-anywhere -- root@192.168.0.134 --flake .#felix --build-on-remote -L
### Uploading install SSH keys ###
/Users/dustin/.nix-profile/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/tmp/tmp.6LIk7zZn2o/nixos-anywhere.pub"
/Users/dustin/.nix-profile/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/Users/dustin/.nix-profile/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
Warning: Permanently added '192.168.0.134' (ED25519) to the list of known hosts.
(root@192.168.0.134) Password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh -o 'ConnectTimeout=10' -o 'UserKnownHostsFile=/dev/null' -o 'StrictHostKeyChecking=no' 'root@192.168.0.134'"
and check to make sure that only the key(s) you wanted were added.

### Gathering machine facts ###
Warning: Permanently added '192.168.0.134' (ED25519) to the list of known hosts.
### Building disko script ###
warning: Git tree '/Users/dustin/.local/share/src/nixos-config' is dirty
warning: not writing modified lock file of flake 'git+file:///Users/dustin/.local/share/src/nixos-config':
• Removed input 'nixos'
### Formatting hard drive with disko ###
Warning: Permanently added '192.168.0.134' (ED25519) to the list of known hosts.
Warning: Permanently added '192.168.0.134' (ED25519) to the list of known hosts.
umount: /mnt/boot unmounted
umount: /mnt unmounted
++ realpath /dev/nvme0n1
+ disk=/dev/nvme0n1
+ lsblk --output-all --json
++ dirname /nix/store/bxq686x89kkmkaamh9qnk8178gqvr4vn-disk-deactivate/disk-deactivate
+ jq -r --arg disk_to_clear /dev/nvme0n1 -f /nix/store/bxq686x89kkmkaamh9qnk8178gqvr4vn-disk-deactivate/disk-deactivate.jq
+ set -fu
+ wipefs --all -f /dev/nvme0n1p1
/dev/nvme0n1p1: 8 bytes were erased at offset 0x00000036 (vfat): 46 41 54 31 36 20 20 20
/dev/nvme0n1p1: 1 byte was erased at offset 0x00000000 (vfat): eb
/dev/nvme0n1p1: 2 bytes were erased at offset 0x000001fe (vfat): 55 aa
+ wipefs --all -f /dev/nvme0n1p2
/dev/nvme0n1p2: 2 bytes were erased at offset 0x00000438 (ext4): 53 ef
++ zdb -l /dev/nvme0n1
++ sed -nr 's/ +name: '\''(.*)'\''/\1/p'
+ zpool=
+ [[ -n '' ]]
+ unset zpool
+ wipefs --all -f /dev/nvme0n1
/dev/nvme0n1: 8 bytes were erased at offset 0x00000200 (gpt): 45 46 49 20 50 41 52 54
/dev/nvme0n1: 8 bytes were erased at offset 0x1d1c1115e00 (gpt): 45 46 49 20 50 41 52 54
/dev/nvme0n1: 2 bytes were erased at offset 0x000001fe (PMBR): 55 aa
++ mktemp -d
+ disko_devices_dir=/tmp/tmp.9CsDqk3PLa
+ trap 'rm -rf "$disko_devices_dir"' EXIT
+ mkdir -p /tmp/tmp.9CsDqk3PLa
+ device=/dev/nvme0n1
+ imageSize=2G
+ name=nvme0n1
+ type=disk
+ device=/dev/nvme0n1
+ type=gpt
+ sgdisk --new=1:0:+100M --change-name=1:disk-nvme0n1-ESP --typecode=1:EF00 /dev/nvme0n1
Creating new GPT entries in memory.
The operation has completed successfully.
+ udevadm trigger --subsystem-match=block
+ udevadm settle
+ device=/dev/disk/by-partlabel/disk-nvme0n1-ESP
+ extraArgs=()
+ declare -a extraArgs
+ format=vfat
+ mountOptions=('defaults')
+ declare -a mountOptions
+ mountpoint=/boot
+ type=filesystem
+ mkfs.vfat /dev/disk/by-partlabel/disk-nvme0n1-ESP
mkfs.fat 4.2 (2021-01-31)
+ sgdisk --new=2:0:-0 --change-name=2:disk-nvme0n1-root --typecode=2:8300 /dev/nvme0n1
The operation has completed successfully.
Discarding device blocks: + udevadm trigger --subsystem-match=block
+ udevadm settle
+ device=/dev/disk/by-partlabel/disk-nvme0n1-root
+ extraArgs=()
+ declare -a extraArgs
+ format=ext4
+ mountOptions=('defaults')
+ declare -a mountOptions
+ mountpoint=/
+ type=filesystem
+ mkfs.ext4 /dev/disk/by-partlabel/disk-nvme0n1-root
mke2fs 1.47.0 (5-Feb-2023)
done
Creating filesystem with 488352785 4k blocks and 122093568 inodes
Filesystem UUID: e59daada-f9ac-4699-871e-14606c0afc86
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
    4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
    102400000, 214990848

Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done

+ set -efux
+ findmnt /dev/disk/by-partlabel/disk-nvme0n1-root /mnt/
+ mount /dev/disk/by-partlabel/disk-nvme0n1-root /mnt/ -t ext4 -o defaults -o X-mount.mkdir
+ findmnt /dev/disk/by-partlabel/disk-nvme0n1-ESP /mnt/boot
+ mount /dev/disk/by-partlabel/disk-nvme0n1-ESP /mnt/boot -t vfat -o defaults -o X-mount.mkdir
+ rm -rf /tmp/tmp.9CsDqk3PLa
### Building the system closure ###
warning: Git tree '/Users/dustin/.local/share/src/nixos-config' is dirty
warning: not writing modified lock file of flake 'git+file:///Users/dustin/.local/share/src/nixos-config':
• Removed input 'nixos'
trace: warning: optionsDocBook is deprecated since 23.11 and will be removed in 24.05
trace: warning: optionsDocBook is deprecated since 23.11 and will be removed in 24.05
trace: warning: optionsDocBook is deprecated since 23.11 and will be removed in 24.05
trace: warning: The option `fonts.fonts' defined in `/nix/store/xb426qj1fkj48rw3fwx6mqh6vj0488mk-source/nixos' has been renamed to `fonts.packages'.
Failed to find a machine for remote build!
derivation: bm173dm4why0gsh6h485v6q9dgz1r9gb-nv-codec-headers-11.1.5.2.drv
required (system, features): (i686-linux, [])
1 available machines:
(systems, maxjobs, supportedFeatures, mandatoryFeatures)
([x86_64-linux], 1, [], [])
error: a 'i686-linux' with features {} is required to build '/nix/store/bm173dm4why0gsh6h485v6q9dgz1r9gb-nv-codec-headers-11.1.5.2.drv', but I am a 'aarch64-darwin' with features {benchmark, big-parallel, nixos-test}
dustinlyons commented 1 year ago

I'm inspecting the live installer ISO, the target of the remote build.

Running nix show-config:

extra-platforms = i686-linux x86_64-v1-linux x86_64-v2-linux x86_64-v3-linux x86_64-v4-linux
system = x86_64-linux
multivac61 commented 4 months ago

I get similar issues when calling --build-on-remote when building for x86_64-linux on M3 mac. The nixos-configuration is gdrn from here https://github.com/multivac61/nixos-config.

The same configuration builds fine from another nixos x86 machine.

Note my user is a trusted

error:
       … while calling the 'head' builtin

         at /nix/store/q43321jn4spvsf1vzmiv56cgm4wgiss3-source/lib/attrsets.nix:1575:11:

         1574|         || pred here (elemAt values 1) (head values) then
         1575|           head values
             |           ^
         1576|         else

       … while evaluating the attribute 'value'

         at /nix/store/q43321jn4spvsf1vzmiv56cgm4wgiss3-source/lib/modules.nix:821:9:

          820|     in warnDeprecation opt //
          821|       { value = addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          822|         inherit (res.defsFinal') highestPrio;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: a 'x86_64-linux' with features {} is required to build '/nix/store/s4hs4qxwr3snrcfg5f6dsp41nhb5fczi-converted.json.drv', but I am a 'aarch64-darwin' with features {apple-virt, benchmark, big-parallel, nixos-test}