dustinlyons/nixos-config

Installation issue on NixOS with xvda boot disk

ryanmsnyder opened this issue · 3 comments

First, thank you for sharing your config! I've been setting it up on MacOS and it's been great.

I wanted to test the config in a linux cloud environment so I consulted this list of NixOS friendly hosters and decided to try Gandi.net's base VPS. NixOS is actually an image option when setting up the VPS, which I thought was great.

Anyway, when I run the install command (without secrets) ...

sudo nix run --extra-experimental-features 'nix-command flakes' github:dustinlyons/nixos-config#install

... I run into some issues that seem to corrupt the filesystem/server. I've included the logs below. A couple things that stood out to me were umount: /mnt: not found and umount: /nix/store: target is busy, which seems to indicate there was a problem unmounting directories (because they're in use or weren't mounted successfully).

Another thing to note is the boot drive type for the VPS is xvd. I checked disko to make sure that xvd is also supported and it looks like support was added last year.

If this is a disko issue, I apologize. I can create an issue over there if so.

Here are the logs from running the install command. I've excluded the beginning of the logs before apply is called.

Found primary network interface enX0
\033[1;33mYou're running as root. Please enter your desired username: \033[0m
ryansnyder
\033[1;33mPlease enter your email: \033[0m
ryansnyder4@gmail.com
\033[1;33mPlease enter your name: \033[0m
Ryan Snyder
\033[1;33mPlease enter a hostname for the system: \033[0m
nixos-playground
\033[1;33mAvailable disks:\033[0m
xvda  25G
\033[0;31mWARNING: All data on the chosen disk will be erased during the installation!\033[0m
\033[1;33mPlease choose your boot disk (e.g., nvme0n1, sda): \033[0m
xvda
\033[1;33mYou have selected xvda as the boot disk. This will delete everything on this disk. Are you sure? (Y/N): \033[0m
Y
\033[0;32mUsername: ryansnyder
Email: ryansnyder4@gmail.com
Name: Ryan Snyder\033[0m
\033[0;32mPrimary interface: enX0
Boot disk: xvda
Hostname: nixos-playground\033[0m
\033[1;33mIs this correct? (Y/N): \033[0m
Y
\033[0;32mContinuing...\033[0m
\033[0;32mUser ryansnyder information applied.\033[0m
+ '[' '!' -f /tmp/username.txt ']'
++ cat /tmp/username.txt
+ export USERNAME=ryansnyder
+ USERNAME=ryansnyder
+ run_disko
+ sudo nix run --extra-experimental-features nix-command --extra-experimental-features flakes github:nix-community/disko -- --mode zap_create_mount ./modules/nixos/disk-config.nix
this derivation will be built:
  /nix/store/zq74n48ndl7wvrl3rq027aja6dikhiqi-disko.drv
these 76 paths will be fetched (27.96 MiB download, 137.27 MiB unpacked):
  /nix/store/072kqjmbhfrmziz5hbs499h6czw7w4pj-jq-1.7-lib
  /nix/store/15wap48wv4rdm1jasvlncs7ivg8f3922-npth-1.6
  /nix/store/16mv7ipba73qn6aads1r2x3vm11bq12x-gnupg-2.4.1
  /nix/store/207d2mg23g6c28f8cpb471a9mc4h44iw-libnfnetlink-1.0.2
  /nix/store/2yxxbsgclg2fx2picgnfi3f4x1vglq3v-audit-3.1.2
  /nix/store/35p0hz5k0fl2fgcgdjxi138xix4bl299-util-linux-2.39.2-swap
  /nix/store/3glzfq0m5pkjywc3a5kk1zi8p6dh35l9-libbsd-unstable-2023-04-29
  /nix/store/3qkckv4scqwzf36nl8dy8rhx0j9mhh3d-shadow-4.14.2
  /nix/store/3yd7qdyl9ix3layh3dlg99qmr9y1pqsq-json-c-0.16
  /nix/store/43pl823dyb6g2i58rf5v71yszk6abfrc-unbound-1.19.0-lib
  /nix/store/4h02i6q6hfvp5avk97lympf43zvnk2d0-util-linux-2.39.2-bin
  /nix/store/4i1p5vr6iai2br2kq8d7mhwlllivf6g8-parted-3.6
  /nix/store/4qlgccn3g3mfw3i0bjibkqhq59cs0rdm-libpcap-1.10.4
  /nix/store/4r1k85y1cp857sy6ndak6327gajqrg45-jq-1.7
  /nix/store/5pwqfff4cmk3f0w6qni8p6g3ja5diw1k-linux-pam-1.5.2
  /nix/store/5pzhzzncm5w39hrsd4g024y3lf85m3ww-elfutils-0.190
  /nix/store/5ri38niq6c90g33i8dw8wd5h16ab2l9w-jq-1.7-man
  /nix/store/5rnczbi8hgzj79bgh23kzmq9aaljgnz1-kmod-31-lib
  /nix/store/69jh5m8vlfifkrvzk3gwphfhbglv2a5z-db-4.8.30
  /nix/store/6ivcrp3mzhav2sxn0c8ki5iipwp63cva-systemd-minimal-libs-254.6
  /nix/store/762lfw3pylbyqpvfx61ldivb0n68a7q3-libmnl-1.0.5
  /nix/store/7n7vhrxhlgr9qjr48zxwxmxm3d91x4s7-tcb-1.2
  /nix/store/84i8hby69rhzcpd8bb8gs2ffhcshc2gj-util-linux-2.39.2-lib
  /nix/store/8fmnax57pv1f2qnsx38ipkd7kp5b6ki6-dosfstools-4.2
  /nix/store/8nv450f5vysch3pv2fvmmfb241aziik3-libassuan-2.5.6
  /nix/store/90pxz1wkwlxd4abnjzbxz6ch25hxrcf6-libbpf-1.2.2
  /nix/store/98cclz91d6mk2sh1dmvn9n34wca5bc2r-oniguruma-6.9.9-lib
  /nix/store/992jdjy03684w846fg0h2bldnjh9v7bv-libcap-ng-0.8.3
  /nix/store/9k3sphy2cwryxq1wpkmfprykg3gw4hyn-popt-1.19
  /nix/store/9mr0pvccggsgdidpi80nyl8594mkkbza-libevent-2.1.12
  /nix/store/9skmhnmgrxqnq5k64n1gn4mmxd0gw5ry-glibc-2.38-27-getent
  /nix/store/a5gbjpq7fbvrxgj81a44nf08ab3rjv5l-util-linux-minimal-2.39.2-mount
  /nix/store/b8rdg9m7rwka4nwn3rw2xb60hqcbnzra-p11-kit-0.25.3
  /nix/store/bh4lz3c2n3qfbm2hhwjhnqcaxcjs2sm8-glibc-2.38-27-bin
  /nix/store/cg2sr37b48p5djkf91jai2c6kigphvvp-util-linux-minimal-2.39.2-lib
  /nix/store/d8d9599pqibwmil6cai7czqpmzqcv7ha-gptfdisk-1.0.9
  /nix/store/dprzgza01whqv34apwvn16ax0qk5wvc1-getent-glibc-2.38-27
  /nix/store/dz5hf9dx2660d1cqdz5a5kg3iihzkfky-jq-1.7-doc
  /nix/store/h882slh5qapvd13cmdn27r3pgk3j7iyw-libgpg-error-1.47
  /nix/store/h9v5cvh23sbhxhsdksgp0vz96pd7q25i-libnetfilter_conntrack-1.0.9
  /nix/store/iglb2fmla149fbprj6fb18swfls033q4-libseccomp-2.5.4-lib
  /nix/store/iidxwcyp8pqhrq3iji17shs4m6gin0kv-systemd-254.6
  /nix/store/iwsavni1qjnrx4gx52l1d7zc67l4wjci-gnutls-3.8.2
  /nix/store/j7fnaznwcxvd6sh5hivcdxhsfi834g9d-util-linux-2.39.2-mount
  /nix/store/k0dkcbfnaq3jb07qamafazsw862xb475-lvm2-2.03.22-lib
  /nix/store/l6l2q7c6xvlb44rxbkpajssz6cma2hwd-bash-interactive-5.2-p21
  /nix/store/lbydzhxxywg3kk4y34yl0f09nwwxiik5-gmp-with-cxx-6.3.0
  /nix/store/lmj8lfkd8h448grf1nf92lsm5gm2fnf6-libcap-2.69-lib
  /nix/store/lmyd230scwqrkym7f5b5y74gn1lmq4gr-util-linux-minimal-2.39.2-login
  /nix/store/lzd1lanwicgs3k4wnl7pms0w7dbi10mk-nettle-3.9.1
  /nix/store/mfcqapbv8qls5fdyk7jp52g8yjhh1yq7-e2fsprogs-1.47.0
  /nix/store/mjsfijxvrynlznpdyqwvgg6mzg4w4wh7-libtasn1-4.19.0
  /nix/store/mv03xraqqqpgckj70cfjrv0ps6cg7a0f-libnftnl-1.2.6
  /nix/store/p5gkxx84ck6gs5iy5hi9caimxl3r8zpj-libmd-1.1.0
  /nix/store/p7ic21469hc43byj4lzjlp7ksa5ni1jp-libcbor-unstable-2023-01-29
  /nix/store/pk2mck2nv2gmp0w7ra3nifvvj87w15s0-libfido2-1.14.0
  /nix/store/ps2ml653c5bxm5q18whsg3rdvhvxray8-pcsclite-1.9.5
  /nix/store/qir6rqd5jl9gl6h64n3729g76xkvf65d-libgcrypt-1.10.3
  /nix/store/qp6kq2m0g4ml94jrb6kb0yy4x1z8wj35-kbd-2.6.3
  /nix/store/svqgxg9q92mw6dpfy2r94pysq1vjn30h-systemd-minimal-254.6
  /nix/store/v818n6imwi4n6gc4qlyyld0n25bf38gs-kmod-31
  /nix/store/vvmm0a9g7wygwzw3rvvxjh1mi46lnw7c-util-linux-minimal-2.39.2-swap
  /nix/store/vwpki5nihab5yssssd54kd8f5c32sg7f-lz4-1.9.4
  /nix/store/w0rr0h1v1lfbjhm4blaqnkzi18wqcqvm-iptables-1.8.10
  /nix/store/wp5c5sjlvm6nxavvs1prdnw5n41mgciq-libapparmor-3.1.6
  /nix/store/wplzchq27f03b0ccw84wnxqpspnixwal-zstd-1.5.5-bin
  /nix/store/x2p2v26yc23vn6xc9j1i8yvnqniwcp01-libargon2-20190702
  /nix/store/xdmynnfk2f5c8z39wrh7h216lhh91bjq-jq-1.7-bin
  /nix/store/xdrsf841kdlf95rxd3qy6yhi57s25krr-dns-root-data-2023-11-27
  /nix/store/y2j4jzz73h9z5w295jjhd8z3agy4aizq-libmicrohttpd-0.9.71
  /nix/store/y6rlcs6v3hjd090666g6yqdpc0wq9wgn-e2fsprogs-1.47.0-bin
  /nix/store/yf0nkhph494py6049fb9031ls332bprc-cryptsetup-2.6.1
  /nix/store/ys0bfhm36c2f3bzzgj82gn85cl52kggz-libnl-3.7.0
  /nix/store/z8cfxl3ywb5knpag542lk6i8gw2yljnm-util-linux-2.39.2-login
  /nix/store/zkgzs99lbmwpgkhqfg7ck0qnwy3dfsdr-kexec-tools-2.0.26
  /nix/store/znnb7n9m1pr4j3nb1mv9x2bpmb8lzsx9-tpm2-tss-4.0.1
copying path '/nix/store/4r1k85y1cp857sy6ndak6327gajqrg45-jq-1.7' from 'https://cache.nixos.org'...
copying path '/nix/store/2yxxbsgclg2fx2picgnfi3f4x1vglq3v-audit-3.1.2' from 'https://cache.nixos.org'...
copying path '/nix/store/l6l2q7c6xvlb44rxbkpajssz6cma2hwd-bash-interactive-5.2-p21' from 'https://cache.nixos.org'...
copying path '/nix/store/69jh5m8vlfifkrvzk3gwphfhbglv2a5z-db-4.8.30' from 'https://cache.nixos.org'...
copying path '/nix/store/xdrsf841kdlf95rxd3qy6yhi57s25krr-dns-root-data-2023-11-27' from 'https://cache.nixos.org'...
copying path '/nix/store/8fmnax57pv1f2qnsx38ipkd7kp5b6ki6-dosfstools-4.2' from 'https://cache.nixos.org'...
copying path '/nix/store/5pzhzzncm5w39hrsd4g024y3lf85m3ww-elfutils-0.190' from 'https://cache.nixos.org'...
copying path '/nix/store/bh4lz3c2n3qfbm2hhwjhnqcaxcjs2sm8-glibc-2.38-27-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/9skmhnmgrxqnq5k64n1gn4mmxd0gw5ry-glibc-2.38-27-getent' from 'https://cache.nixos.org'...
copying path '/nix/store/lbydzhxxywg3kk4y34yl0f09nwwxiik5-gmp-with-cxx-6.3.0' from 'https://cache.nixos.org'...
copying path '/nix/store/dprzgza01whqv34apwvn16ax0qk5wvc1-getent-glibc-2.38-27' from 'https://cache.nixos.org'...
copying path '/nix/store/dz5hf9dx2660d1cqdz5a5kg3iihzkfky-jq-1.7-doc' from 'https://cache.nixos.org'...
copying path '/nix/store/5ri38niq6c90g33i8dw8wd5h16ab2l9w-jq-1.7-man' from 'https://cache.nixos.org'...
copying path '/nix/store/3yd7qdyl9ix3layh3dlg99qmr9y1pqsq-json-c-0.16' from 'https://cache.nixos.org'...
copying path '/nix/store/zkgzs99lbmwpgkhqfg7ck0qnwy3dfsdr-kexec-tools-2.0.26' from 'https://cache.nixos.org'...
copying path '/nix/store/v818n6imwi4n6gc4qlyyld0n25bf38gs-kmod-31' from 'https://cache.nixos.org'...
copying path '/nix/store/5rnczbi8hgzj79bgh23kzmq9aaljgnz1-kmod-31-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/wp5c5sjlvm6nxavvs1prdnw5n41mgciq-libapparmor-3.1.6' from 'https://cache.nixos.org'...
copying path '/nix/store/x2p2v26yc23vn6xc9j1i8yvnqniwcp01-libargon2-20190702' from 'https://cache.nixos.org'...
copying path '/nix/store/90pxz1wkwlxd4abnjzbxz6ch25hxrcf6-libbpf-1.2.2' from 'https://cache.nixos.org'...
copying path '/nix/store/lmj8lfkd8h448grf1nf92lsm5gm2fnf6-libcap-2.69-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/992jdjy03684w846fg0h2bldnjh9v7bv-libcap-ng-0.8.3' from 'https://cache.nixos.org'...
copying path '/nix/store/p7ic21469hc43byj4lzjlp7ksa5ni1jp-libcbor-unstable-2023-01-29' from 'https://cache.nixos.org'...
copying path '/nix/store/9mr0pvccggsgdidpi80nyl8594mkkbza-libevent-2.1.12' from 'https://cache.nixos.org'...
copying path '/nix/store/h882slh5qapvd13cmdn27r3pgk3j7iyw-libgpg-error-1.47' from 'https://cache.nixos.org'...
copying path '/nix/store/p5gkxx84ck6gs5iy5hi9caimxl3r8zpj-libmd-1.1.0' from 'https://cache.nixos.org'...
copying path '/nix/store/8nv450f5vysch3pv2fvmmfb241aziik3-libassuan-2.5.6' from 'https://cache.nixos.org'...
copying path '/nix/store/3glzfq0m5pkjywc3a5kk1zi8p6dh35l9-libbsd-unstable-2023-04-29' from 'https://cache.nixos.org'...
copying path '/nix/store/qir6rqd5jl9gl6h64n3729g76xkvf65d-libgcrypt-1.10.3' from 'https://cache.nixos.org'...
copying path '/nix/store/762lfw3pylbyqpvfx61ldivb0n68a7q3-libmnl-1.0.5' from 'https://cache.nixos.org'...
copying path '/nix/store/207d2mg23g6c28f8cpb471a9mc4h44iw-libnfnetlink-1.0.2' from 'https://cache.nixos.org'...
copying path '/nix/store/mv03xraqqqpgckj70cfjrv0ps6cg7a0f-libnftnl-1.2.6' from 'https://cache.nixos.org'...
copying path '/nix/store/h9v5cvh23sbhxhsdksgp0vz96pd7q25i-libnetfilter_conntrack-1.0.9' from 'https://cache.nixos.org'...
copying path '/nix/store/ys0bfhm36c2f3bzzgj82gn85cl52kggz-libnl-3.7.0' from 'https://cache.nixos.org'...
copying path '/nix/store/iglb2fmla149fbprj6fb18swfls033q4-libseccomp-2.5.4-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/4qlgccn3g3mfw3i0bjibkqhq59cs0rdm-libpcap-1.10.4' from 'https://cache.nixos.org'...
copying path '/nix/store/mjsfijxvrynlznpdyqwvgg6mzg4w4wh7-libtasn1-4.19.0' from 'https://cache.nixos.org'...
copying path '/nix/store/w0rr0h1v1lfbjhm4blaqnkzi18wqcqvm-iptables-1.8.10' from 'https://cache.nixos.org'...
copying path '/nix/store/5pwqfff4cmk3f0w6qni8p6g3ja5diw1k-linux-pam-1.5.2' from 'https://cache.nixos.org'...
copying path '/nix/store/vwpki5nihab5yssssd54kd8f5c32sg7f-lz4-1.9.4' from 'https://cache.nixos.org'...
copying path '/nix/store/lzd1lanwicgs3k4wnl7pms0w7dbi10mk-nettle-3.9.1' from 'https://cache.nixos.org'...
copying path '/nix/store/15wap48wv4rdm1jasvlncs7ivg8f3922-npth-1.6' from 'https://cache.nixos.org'...
copying path '/nix/store/98cclz91d6mk2sh1dmvn9n34wca5bc2r-oniguruma-6.9.9-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/16mv7ipba73qn6aads1r2x3vm11bq12x-gnupg-2.4.1' from 'https://cache.nixos.org'...
copying path '/nix/store/072kqjmbhfrmziz5hbs499h6czw7w4pj-jq-1.7-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/b8rdg9m7rwka4nwn3rw2xb60hqcbnzra-p11-kit-0.25.3' from 'https://cache.nixos.org'...
copying path '/nix/store/xdmynnfk2f5c8z39wrh7h216lhh91bjq-jq-1.7-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/ps2ml653c5bxm5q18whsg3rdvhvxray8-pcsclite-1.9.5' from 'https://cache.nixos.org'...
copying path '/nix/store/9k3sphy2cwryxq1wpkmfprykg3gw4hyn-popt-1.19' from 'https://cache.nixos.org'...
copying path '/nix/store/6ivcrp3mzhav2sxn0c8ki5iipwp63cva-systemd-minimal-libs-254.6' from 'https://cache.nixos.org'...
copying path '/nix/store/7n7vhrxhlgr9qjr48zxwxmxm3d91x4s7-tcb-1.2' from 'https://cache.nixos.org'...
copying path '/nix/store/pk2mck2nv2gmp0w7ra3nifvvj87w15s0-libfido2-1.14.0' from 'https://cache.nixos.org'...
copying path '/nix/store/k0dkcbfnaq3jb07qamafazsw862xb475-lvm2-2.03.22-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/3qkckv4scqwzf36nl8dy8rhx0j9mhh3d-shadow-4.14.2' from 'https://cache.nixos.org'...
copying path '/nix/store/43pl823dyb6g2i58rf5v71yszk6abfrc-unbound-1.19.0-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/84i8hby69rhzcpd8bb8gs2ffhcshc2gj-util-linux-2.39.2-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/iwsavni1qjnrx4gx52l1d7zc67l4wjci-gnutls-3.8.2' from 'https://cache.nixos.org'...
copying path '/nix/store/4i1p5vr6iai2br2kq8d7mhwlllivf6g8-parted-3.6' from 'https://cache.nixos.org'...
copying path '/nix/store/y2j4jzz73h9z5w295jjhd8z3agy4aizq-libmicrohttpd-0.9.71' from 'https://cache.nixos.org'...
copying path '/nix/store/z8cfxl3ywb5knpag542lk6i8gw2yljnm-util-linux-2.39.2-login' from 'https://cache.nixos.org'...
copying path '/nix/store/j7fnaznwcxvd6sh5hivcdxhsfi834g9d-util-linux-2.39.2-mount' from 'https://cache.nixos.org'...
copying path '/nix/store/35p0hz5k0fl2fgcgdjxi138xix4bl299-util-linux-2.39.2-swap' from 'https://cache.nixos.org'...
copying path '/nix/store/cg2sr37b48p5djkf91jai2c6kigphvvp-util-linux-minimal-2.39.2-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/lmyd230scwqrkym7f5b5y74gn1lmq4gr-util-linux-minimal-2.39.2-login' from 'https://cache.nixos.org'...
copying path '/nix/store/yf0nkhph494py6049fb9031ls332bprc-cryptsetup-2.6.1' from 'https://cache.nixos.org'...
copying path '/nix/store/mfcqapbv8qls5fdyk7jp52g8yjhh1yq7-e2fsprogs-1.47.0' from 'https://cache.nixos.org'...
copying path '/nix/store/d8d9599pqibwmil6cai7czqpmzqcv7ha-gptfdisk-1.0.9' from 'https://cache.nixos.org'...
copying path '/nix/store/y6rlcs6v3hjd090666g6yqdpc0wq9wgn-e2fsprogs-1.47.0-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/znnb7n9m1pr4j3nb1mv9x2bpmb8lzsx9-tpm2-tss-4.0.1' from 'https://cache.nixos.org'...
copying path '/nix/store/a5gbjpq7fbvrxgj81a44nf08ab3rjv5l-util-linux-minimal-2.39.2-mount' from 'https://cache.nixos.org'...
copying path '/nix/store/vvmm0a9g7wygwzw3rvvxjh1mi46lnw7c-util-linux-minimal-2.39.2-swap' from 'https://cache.nixos.org'...
copying path '/nix/store/wplzchq27f03b0ccw84wnxqpspnixwal-zstd-1.5.5-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/qp6kq2m0g4ml94jrb6kb0yy4x1z8wj35-kbd-2.6.3' from 'https://cache.nixos.org'...
copying path '/nix/store/iidxwcyp8pqhrq3iji17shs4m6gin0kv-systemd-254.6' from 'https://cache.nixos.org'...
copying path '/nix/store/svqgxg9q92mw6dpfy2r94pysq1vjn30h-systemd-minimal-254.6' from 'https://cache.nixos.org'...
copying path '/nix/store/4h02i6q6hfvp5avk97lympf43zvnk2d0-util-linux-2.39.2-bin' from 'https://cache.nixos.org'...
building '/nix/store/zq74n48ndl7wvrl3rq027aja6dikhiqi-disko.drv'...
umount: /mnt: not found
++ realpath /dev/xvda
+ disk=/dev/xvda
+ lsblk -a -f
NAME    FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0
loop1
loop2
loop3
loop4
loop5
loop6
loop7
xvda
└─xvda1 ext4   1.0   nixos f222513b-ded1-49fa-b591-20ce86a2fe7f   20.1G    13% /nix/store
                                                                               /
+ bash -x
+ lsblk --output-all --json
++ dirname /nix/store/f722nll5akkkv155midnwli1jrrqq2bk-disk-deactivate/disk-deactivate
+ jq -r --arg disk_to_clear /dev/xvda -f /nix/store/f722nll5akkkv155midnwli1jrrqq2bk-disk-deactivate/disk-deactivate.jq
+ set -fu
+ umount -R /nix/store
umount: /nix/store: target is busy.
+ umount -R /
umount: /dev/pts: target is busy.
+ wipefs --all -f /dev/xvda1
/dev/xvda1: 2 bytes were erased at offset 0x00000438 (ext4): 53 ef
++ sed -nr 's/ +name: '\''(.*)'\''/\1/p'
++ zdb -l /dev/xvda
bash: line 5: zdb: command not found
+ zpool=
+ [[ -n '' ]]
+ unset zpool
+ wipefs --all -f /dev/xvda
/dev/xvda: 2 bytes were erased at offset 0x000001fe (dos): 55 aa
+ dd if=/dev/zero of=/dev/xvda bs=440 count=1
1+0 records in
1+0 records out
440 bytes copied, 0.00373755 s, 118 kB/s
+ lsblk -a -f
NAME    FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0
loop1
loop2
loop3
loop4
loop5
loop6
loop7
xvda
└─xvda1 ext4   1.0   nixos f222513b-ded1-49fa-b591-20ce86a2fe7f   20.1G    13% /nix/store
                                                                               /
++ mktemp -d
+ disko_devices_dir=/tmp/tmp.I3HOuftgoz
+ trap 'rm -rf "$disko_devices_dir"' EXIT
+ mkdir -p /tmp/tmp.I3HOuftgoz
+ device=/dev/xvda
+ imageSize=2G
+ name=vdb
+ type=disk
+ device=/dev/xvda
+ type=gpt
+ sgdisk --set-alignment=2048 --align-end --new=1:0:+100M --change-name=1:disk-vdb-ESP --typecode=1:EF00 /dev/xvda
Creating new GPT entries in memory.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
+ partprobe /dev/xvda
/nix/store/k4rgz2yf5f04iplv4i5pizwsm3wnx24c-disko: line 82:  1809 Bus error               partprobe /dev/xvda
+ rm -rf /tmp/tmp.I3HOuftgoz
/nix/store/k4rgz2yf5f04iplv4i5pizwsm3wnx24c-disko: line 1: rm: command not found

Hi, currently I haven't tested this on a server, but I hope to one day as I have a home lab I need to migrate over to Nix. I'm happy you're exploring this though.

One thing to note, on NixOS this will try to install a display manager, window compositor, etc. which may not play well in the server environment. So those would need to be turned off.

Those errors you're currently seeing are coming from disko. Here is the command the script runs:

sudo nix run --extra-experimental-features nix-command --extra-experimental-features flakes \
    github:nix-community/disko -- --mode zap_create_mount ./modules/nixos/disk-config.nix

Their current README shows this command:

sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko /tmp/disko-config.nix

But under the hood it looks like zap_create_mount maps to disko. (zap_create_mount was previously the standard way, looks like they updated it but made zap_create_mount "legacy" and still supported).

So this should work. Here is the disk-config my project uses:

_: {
  # This is the disk layout for a dual-boot system with Windows 10.
  disko.devices = {
    disk = {
      nvme0n1 = {
        device = "/dev/nvme0n1";
        type = "disk";
        content = {
          type = "gpt";
          partitions = {
            ESP = {
              type = "EF00";  # EFI partition type.
              size = "500M";
              content = {
                type = "filesystem";
                format = "vfat";
                mountpoint = "/boot";
              };
            };
            root = {
              start = "901G";  # Start immediately after Windows partition.
              size = "100%";  # Takes the remaining half of the disk space.
              content = {
                type = "filesystem";
                format = "ext4";
                mountpoint = "/";
              };
            };
          };
        };
      };
    };
  };
}

What's interesting is your environment doesn't have the rm command?

/nix/store/k4rgz2yf5f04iplv4i5pizwsm3wnx24c-disko: line 1: rm: command not found

I've had folks tell me NixOS was working for them as of last week, and I see some new regressions listed on the disko project Issues. Maybe you could check with them and report back if you learn something?

Hi @ryanmsnyder, did you ever get this to work?

Hi @dustinlyons, I apologize - I for some reason thought that disko would handle the reinstallation of NixOS. I thought that since I was starting on a NixOS environment that I could skip Step 1 of your NixOS setup instructions. disko was wiping the disk of the VPS and then didn't have anything to boot from.

I've since been able to deploy your config to a Hetzner vm running Ubuntu with nixos-anywhere, which uses disko to partition the disk and then handles the installation of NixOS.

Anyway, it turned out to be unrelated to your config! Thanks again for sharing your configuration. It has been immensely helpful as I learn more about Nix.