<clever>
ghostyyy: is the luks flagged as before or after lvm?
<clever>
ghostyyy: you will need to add a script somewhere to tell the initrd to mount the usb stick, copy the header into the ramdisk, and then umount it
2017-10-21
<clever>
anyways, its getting late here, i should get back to bed
<clever>
joko: but recently, it got redone, and a bug was introduced, it now builds the entire system on the host rootfs (in the ramdisk), then copies it to the target
<clever>
joko: previously (a few months ago), it was basically just a script to run nix-build under a chroot, after using rsync to get just nix inside /mnt/nix/store/
<clever>
so that module is probably in scope and allowing it
<clever>
joko: its applying sed to target-config.nix (in the same directory) to create the final working configuration.nix of the install
<clever>
joko: and every machine should have a unique value, so they cant import eachothers pools by mistake
<clever>
joko: zfs expects a networking.hostId option in the nixos config, which is just a random blob of hex
<clever>
in the old days, there was udev rules to bind a given name to a given mac, so it would be random on the first boot, and stick to that random layout
<clever>
hyper_ch: which driver loads first?
<clever>
hyper_ch: what about when you have 2 network cards?
<clever>
it wasnt using the new naming style
<clever>
the last machine i used it on, still called the card eth0
<clever>
then i can make another guess and try again
<clever>
hyper_ch: so if i do get the network config wrong and loose all control, it will reboot itself, restoring control to the original OS
<clever>
hyper_ch: one trick, i have configured the kexec image to reboot the machine every hour on the hour
<clever>
joko: DO is also special, in that the static ip is unique to the instance, and they try to edit your /etc/networking/interfaces file to fix the config for you
<clever>
joko: and you must know the name systemd will assign if you want to configure the static ip
<clever>
joko: if the datacenter supports dhcp, thats easy, but with some, you have to configure a static ip
<clever>
joko: the main issue right now with the kexec trick, is getting the network online
<clever>
infinisil: nox has a cache built into it, and i also just use tab-completion in nix-repl
<clever>
dragon__: what about when you add --pure to nix-shell?
<clever>
hyper_ch: the machine has to be able to read the swap after a cold boot, to restore the contents of ram
<clever>
hyper_ch: random key doesnt play nicely with hibernation
<clever>
dragon__: nix-shell -p openssl stdenv
<clever>
joko: mainly planning ahead for hibernation
<clever>
hyper_ch: zfs needs to allocate ram to do IO, and allocating ram inside the swap thread is bad
<clever>
hyper_ch: thats swap on a zvol, which has had deadlocking issues in the past
<clever>
hyper_ch: 2: that wont encrypt swap, and i dont trust a zvol with swap
<clever>
hyper_ch: 1: i havent tested zfs encryption on my end yet
<clever>
joko: yep
<clever>
infinisil: in this case, i wanted a single luks to protect both swap and zfs
<clever>
dragon__: ld will never find things you have installed, you must use nix-shell
<clever>
infinisil: i have also added zfs on lvm on luks to justdoit
<clever>
joko: and its written as a nixos module, so you add it to the imports for the installer (methods 1-3 above), and it will already be "installed" when you boot the installer
<clever>
joko: this is a bash script, that does the entire install with 1 command
<clever>
i now have 3 variants of that ramdisk installer
<clever>
joko: the kexec trick gives you the full nixos installer, running from a ramdisk, so you are free to then format the drive and install nixos normally
<clever>
it may need other libraries added to the fhs
<clever>
srhb: so attempting to debug anything on the system, breaks that software and forces you to reboot the entire machine
<clever>
srhb: there is a windows util similar to strace, and i have discovered at least one application, that fails all license checks if that util has been ran even once, until you reboot to clear the state
<clever>
fearlessKim[m]: its simpler to remove it from home-manager first
<clever>
adamt: that may have options to just unpack things to the current directory
<clever>
adamt: does it accept anything like --help now?
<clever>
srhb: but you could potentialy run that wrapper at build time, within another derivation
<clever>
srhb: all .env does is setup a shellHook, to run the namespacing wrapper when you enter nix-shell
<clever>
CcxWrk: something within nixpkgs would have to be changed, to replace libc with musl
<clever>
CcxWrk: and if you build an arm copy of nix with this, you can use nix-copy-closure to shuffle things between the 2 devices
<clever>
CcxWrk: once its confirmed working, you can use nix to build anything in nixpkgs
<clever>
CcxWrk: the next step, would be to grab the closure of hello with "nix-store -qR /nix/store/hash-hello", tar the whole thing up, then unpack it on the phone at /nix/ (optionaly with a chroot to get it in the right spot) and try to run hello-world
<clever>
CcxWrk: that will build the entire compiler toolchain and also confirm that the compiler is working
<clever>
MichaelRaskin: i dont know how, but the FHSenv is able to mess with the root dir without uid 0
<clever>
srhb: if you have a non-nixos machine, you could try running binwalk over the installer
<clever>
yeah
<clever>
MichaelRaskin: there is still the difference between needing the FHS at build time, vs at runtime
<clever>
there is another util i know of that can help, but i have yet to get it working under nix
<clever>
avn: is the file publicly downloadable?
<clever>
and libredirect wont work either, because its static!
<clever>
avn: i dont think that will work, because the resulting binary is hard-coded to open /lib64/ld-linux-x86-64.so.2
<clever>
CcxWrk: you can either find the gentoo version of it, or just do "nix-build -A qemu-user-arm -o qemu-user && ./qemu-user/bin/register" to build it with nix and auto-register it
<clever>
fearlessKim[m]: thats only the size of msmtp itself
<clever>
CcxWrk: something like this will have to be ran, with the absolute path to your qemu-user-arm binary
<clever>
gleber_: the service options add it to systemPackages for you
<clever>
gleber_: what lines have you added to configuration.nix that reference virtualbox?
<clever>
CcxWrk: oh, and it needs build-extra-platforms = armv7l-linux in /etc/nix/nix.conf
<clever>
CcxWrk: which will run the native arm7 -> arm7 compiler to build hello world
<clever>
CcxWrk: after nix is done building nix, you can do something like: ./result/bin/nix-build '<nixpkgs>' -A hello --argstr system armv7l-linux
<clever>
though with android, that doesnt matter much
<clever>
CcxWrk: dynamic breaks ldd, which messes up the initrd generation for nixos
<clever>
CcxWrk: oh, and the qemu-user binary you have from portage, is it static or dynamic linking?
<clever>
CcxWrk: git clone the nix-misc repo i linked previously, and run "nix-build -A nix" and let me know when that finishes
<clever>
CcxWrk: ah, thats half the work
<clever>
CcxWrk: to start with, are you going to use a nixos or other linux for the build host?
<clever>
CcxWrk: the parts i linked, purely make an x86 machine capable of running arm code, so you can use an x86 machine instead of an arm machine
<clever>
CcxWrk: the musl stuff would come afterwards, and this part wouldnt have to change any
<clever>
jluttine: the next thing to check would be "nixos-rebuild build -vvvvvv" and go over every .nix file its reading
<clever>
joko: i have done most of that before, it just had a few kinks with the kernel and xargs, they may have since been resolved
<clever>
jluttine: i can also see that you have that commented out on line 27-ish
<clever>
jluttine: and that nextcloud derivation is the root for something in nginx
<clever>
jluttine: reading the nextcloud .drv file, i can see calendar.tar.gz is in its $src
<clever>
CcxWrk: there is also a cross-compile framework in nixpkgs, but its got some kinks in it, and nix-env on the arm wont use the cross-compiled libraries, so it would have to rebuild it all again
<clever>
CcxWrk: when the 2 are combined properly, the machine can just run any arm binary, including an arm compiler
<clever>
CcxWrk: and the nix on line 12, is a patched copy of nix, that supports "build-extra-platforms = armv7l-linux" in /etc/nix/nix.conf, which will convince nix-daemon that the x86 machine can "just run" arm binaries
<clever>
CcxWrk: this build of qemu allows you to run armv7 binaries on an x86 machine, without any kernel/system emulation, just build qemu-user-arm, and run the register script as root
<clever>
jluttine: can you gist the files involved in nextcloud and the contents of /nix/store/hl95ln7vif73kiz13wsf3ydq7nn97xfb-nginx.conf.drv and /nix/store/b3k0ivqdiasar8k618l4vbxdqzr7zqwn-nextcloud-12.0.2.drv
<clever>
CcxWrk: ah, thats compatible with the rasberry pi 2 and 3, and also the qemu emulation i have, one min
<clever>
ah
<clever>
or add it to the existing gist
<clever>
jluttine: can you gist your configuration.nix file?
<clever>
jluttine: nginx depends on nextcloud which depends on calendar.tar.gz
<clever>
CcxWrk: do you know if its armv6, armv7 or aarch64?
<clever>
CcxWrk: ah, you could use a different arm device with a compatible cpu
<clever>
jluttine: can you gist the full error?
<clever>
CcxWrk: and what prevents you from running normal glibc based nix on it?
<clever>
CcxWrk: which device are you trying to target?
<clever>
avn: as long as you move the entire /nix to /nix on another device, it will survive
<clever>
CcxWrk: nix has its own build slave setup, but it assumes you can run nix on the target machine
<clever>
CcxWrk: which resulted in a normal nix build inside /nix/store/
<clever>
CcxWrk: i believe i had built nix from source with ./configure, then i used that nix to build nix with nix
<clever>
CcxWrk: i have nix running on one of my raspberry pi's, ive given my hydra a kick to get it going again