Nix on Z? ( IBM Z and LinuxONE )

G’day,

Apparently multiple of us are interested in seeing if we could get nix running on a Z. Maybe we should co-ordinate efforts somehow? I guess we would all perf one bigger VM, rather than multiple smaller ones? … I’m just excited to get logged into the Z!

As far as Nix goes, I received a couple other requests for VMs from members of the Nix community, so I think there are some folks chipping away at it. I'm trying to put them in touch with each other but I need their permission first. Would you like me to loop you in if I get these discussions going?

Enjoy!

Elizabeth K. Joseph
Global Head, Open Source Program Office for IBM Z and LinuxONE

Thanks,

Dave

4 Likes

Nice video

1 Like

IBM’s community github

1 Like

Woot woot! I’m logged in. Wowza. Old kernel

linux1@z:~$ uname -a
Linux z 5.15.0-56-generic #62-Ubuntu SMP Tue Nov 22 19:57:26 UTC 2022 s390x s390x s390x GNU/Linux
linux1@z:~$ cat /proc/cpuinfo  | head
vendor_id       : IBM/S390
# processors    : 2
bogomips per cpu: 24038.00
max thread id   : 0
features	: esan3 zarch stfle msa ldisp eimm dfp edat etf3eh highgprs te vx vxd vxe gs vxe2 vxp sort dflt sie 
facilities      : 0 1 2 3 4 6 7 8 9 10 12 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 30 31 32 33 34 35 36 37 38 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 69 70 71 72 73 74 75 76 77 80 81 82 128 129 130 131 133 134 135 146 147 148 150 151 152 155 156 168
cache0          : level=1 type=Data scope=Private size=128K line_size=256 associativity=8
cache1          : level=1 type=Instruction scope=Private size=128K line_size=256 associativity=8
cache2          : level=2 type=Data scope=Private size=4096K line_size=256 associativity=8
cache3          : level=2 type=Instruction scope=Private size=4096K line_size=256 associativity=8
linux1@z:~$ cat /proc/meminfo | head
MemTotal:        4088580 kB
MemFree:         2405048 kB
MemAvailable:    2798652 kB
Buffers:           25692 kB
Cached:           441708 kB
SwapCached:            0 kB
Active:           119552 kB
Inactive:         403592 kB
Active(anon):       1620 kB
Inactive(anon):    74856 kB
linux1@z:~$ 

2 Likes

I’m not even sure I can confidently say there are dozens of us as a joke :joy: The venn diagram of people who use IBM Z hardware and people who aren’t vendor locked into Z/OS is already practically two circles that don’t touch.

1 Like

woot woot

linux1@z:~$ uname -a
Linux z 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 14:53:36 UTC 2026 s390x s390x s390x GNU/Linux
linux1@z:~$ date
Fri Mar 27 05:04:28 PM UTC 2026
linux1@z:~$ nix --version                                  <---- woot woot
nix (Nix) 2.35.0
2 Likes

Making a lot of progress. Had to get a bigger VM due to OOM kills, so it’s going a lot faster now. This is with nix compiled with z15 architecture. Fancy :rofl:

3 Likes

Looks like Nix crashes on out of disk space? I guess it doesn’t matter much, cos what are you going to do anyway? Whatever, I’m going to just get a bigger disk. Didn’t realize how much the binary cache helps.

 FAILED: [code=1] CMakeFiles/install.util                                                                                                                                                                                    
 cd /nix/var/nix/builds/nix-3751946-2480156649/clang-src-21.1.8/clang/build && /nix/store/ylkv8n1d5j30gihdjx65g9bw7q3yk2x7-cmake-4.1.2/bin/cmake -P cmake_install.cmake
 ninja: build stopped: subcommand failed.                                                                                                                                                                                    
 error (ignored): write of 65536 bytes: No space left on device                                                                                                                                                            
 Nix crashed. This is a bug. Please report this at https://github.com/NixOS/nix/issues with the following information included:
2 Likes

Lmao. Amazing! Keep up the good work. :joy: How’re compilation times?

woot woot! more testing required. clickhouse has comprehensive tests, so I’ll run them now


linux1@z:~$ ~/nixpkgs/result/bin/clickhouse local --version
ClickHouse local version 26.2.4.23.
linux1@z:~$ uname -a
Linux z 5.15.0-56-generic #62-Ubuntu SMP Tue Nov 22 19:57:26 UTC 2022 s390x s390x s390x GNU/Linux
linux1@z:~$ head /proc/cpuinfo 
vendor_id       : IBM/S390
# processors    : 4
bogomips per cpu: 24038.00
max thread id   : 0
features	: esan3 zarch stfle msa ldisp eimm dfp edat etf3eh highgprs te vx vxd vxe gs vxe2 vxp sort dflt sie 
facilities      : 0 1 2 3 4 6 7 8 9 10 12 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 30 31 32 33 34 35 36 37 38 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 69 70 71 72 73 74 75 76 77 80 81 82 128 129 130 131 133 134 135 146 147 148 150 151 152 155 156 168
cache0          : level=1 type=Data scope=Private size=128K line_size=256 associativity=8
cache1          : level=1 type=Instruction scope=Private size=128K line_size=256 associativity=8
cache2          : level=2 type=Data scope=Private size=4096K line_size=256 associativity=8
cache3          : level=2 type=Instruction scope=Private size=4096K line_size=256 associativity=8
linux1@z:~$ 

1 Like

A number of Linux distros are available for Z (s390x), including Debian, Fedora, OpenSuse:
and I believe they provide nix packages of some form already…

Or are you talking about running nix outside a Z Linux Lpar (vm)?

To my understanding nix does not yet support s390. I did try the instructions here: Download | Nix & NixOS

I’ve now got a number of patches to make nix work on the s390 architecture, including z15 which is the machine type I’m testing on. For testing I’m using one of these legacy non-deterministic operating systems

linux1@z:~$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"
linux1@z:~$ 

I’ve also got a bunch of patches for things in nixpkgs to get clickhouse to compile

Clickhouse has a lot of tests….

Tests are progressing — 145 passed, 69 failed, 0 skipped so far. Currently around test 03813...

IBM have a repo with patches for some ~100-200 libraries, so I’ve been applying these patches to nixpkgs ( which obviously helps a lot :wink: )

Progress … Lots of endian issues

  ┌─────────────────┬────────────────┬───────────────┐                                                                                                                                                                                                         
  │     Metric      │ Run 5 (so far) │ Run 4 (final) │                                                                                                                                                                                                         
  ├─────────────────┼────────────────┼───────────────┤                                                                                                                                                                                                         
  │ Total completed │ 2,965          │ 274           │                                                                                                                                                                                                         
  ├─────────────────┼────────────────┼───────────────┤                                                                                                                                                                                                         
  │ Passed          │ 2,492 (84%)    │ 204 (74%)     │                                                                                                                                                                                                         
  ├─────────────────┼────────────────┼───────────────┤                                                                                                                                                                                                         
  │ Failed          │ 469            │ 70            │                                                                                                                                                                                                         
  ├─────────────────┼────────────────┼───────────────┤                                                                                                                                                                                                         
  │ Skipped         │ 4              │ 0             │                                                                                                                                                                                                         
  └─────────────────┴────────────────┴───────────────┘