2018-03-13

<clever> hyper_ch2: you want export
<clever> hyper_ch2: offline isnt what you want
<clever> dtz: on the subject of ghc error messages: https://twitter.com/mattoflambda/status/968978886313721856?s=19
<clever> lol
<clever> dang
<clever> read(0, "", 8192) = 0
<clever> [clever@system76:~/iohk/daedalus]$ exec 2>&1 | strace tee /tmp/test.txt
<clever> seen it :D
<clever> electron can load plugins that define custom javascript methods
<clever> dtz: https://github.com/cleverca22/unify/ haskell binaries can be turned into c libraries
<clever> and all kinds of fun problems happen if you dont run both
<clever> currently, there is a haskell binary, that has to run at the same time as the electron binary
<clever> dtz: oh, but i have been thinking of something similar to your idea
<clever> fixing dbus does
<clever> fixing opengl doesnt resolve the issue
<clever> for example, electron will print a dbus error, then some opengl errors, then crash
<clever> or it fails after doing more things first
<clever> and often wont give clear errors
<clever> electron requires a surprising number of files to even start
<clever> dtz: i also need to look into seeing if this is possible
<clever> exec 2>&1 | tee $DAEDALUS_DIR/Logs/pub/post-install.log
<clever> the glibc's didnt like being mixed up
<clever> and i already broke everything once when trying to just merge everything into a single $out/lib/
<clever> the issue, is that each github repo has its own nixpkgs pinned
<clever> i could still fix this though
<clever> 20M /nix/store/d54amiggq6bw23jw6mdsgamvs6v1g3bh-glibc-2.25-123
<clever> 20M /nix/store/zpg78y1mf0di6127q6r51kgx2q8cxsvv-glibc-2.25-49
<clever> dtz: i dont think llvm can fix that, lol
<clever> 128M /nix/store/1410zkfr47ykbd6y1fcadfz49cxnd5h6-electron-1.7.11
<clever> dtz: let me see where all my closure size is going to...
<clever> i learned screen first
<clever> i just run irssi under screen over ssh
<clever> or you can just choose to ignore the safety and turn force on for all of your machines
<clever> and you can scramble the livecd hostid, before you create the pool, to mantain uniqueness
<clever> hyper_ch2: if your installation has the same hostid as the livecd, it wont have the problem
<clever> hyper_ch2: and you get an initrd shell by booting with boot.allow_shell i think
<clever> hyper_ch2: run the zpool import with the force flag, from the initrd shell
<clever> hyper_ch2: you have to tell the initrd to force-import once, to repair the state
<clever> dtz: which is technically a 124mb "bash" script
<clever> dtz: i was getting an OOM just executing an arx bundle
<clever> hyper_ch2: i do agree that turning force off is better
<clever> hyper_ch2: because the wrong hostid was last using it
<clever> hyper_ch2: then you WILL have the issue
<clever> dtz: yep, it was just a ram shortage, i gave it a gig of swap and it now runs
<clever> hyper_ch2: and force import disables the safeties for concurrent access detection
<clever> hyper_ch2: zfs uses the hostId to keep track of which machine is using a pool, incase its on a shared block device like iscsi/nbd
<clever> thats my understanding
<clever> hyper_ch2: ah, as long as the hostId baked into the initrd is the one to last import a pool, it will just work
<clever> dtz: namespacing works, but nesting namespaces doesnt
<clever> oh, the swap uuid is missing
<clever> i'm going to see wht happens if i just double the ram again
<clever> [updater] /home/clever/.local/share/Daedalus/mainnet/installer.sh: fork: Cannot allocate memory
<clever> currently, i'm having some upgrade troubles
<clever> but that includes a couple haskell binaries, and electron
<clever> my installer is 125mb
<clever> dtz: ive just been packing up entire nix closures in nix-bundle
<clever> dtz: ahh
<clever> hyper_ch2: ?
<clever> dtz: does allmux need source to do that?
<clever> and supplies a working namespace helper to chroot into it, without root
<clever> this generates a nix bundle that installs nix under ~/nix-installl/nix/store/
<clever> dtz: have you seen what ive done with nix-bundle recently?
<clever> kaychaks: i dont think nix2 has that option right now
<clever> kaychaks: what happens if you put it in this area?
<clever> ca-bundle.crt ca-certificates.crt
<clever> [clever@amd-nixos:~]$ ls /etc/ssl/certs/
<clever> kaychaks: nix 2.0 uses libcurl, rather then the curl command, so it probably needs the certs in a different place
<clever> justanotheruser: you need to switch to the nixos-unstable channel
<clever> justanotheruser: you must never run nixos from the nixpkgs channel
<clever> justanotheruser: what does `sudo nix-channel --list` say?
<clever> dmj`: pong
<clever> Myrl-saki: pong

2018-03-12

<clever> a heap of undocumented examples
<clever> Baughn: its trying to create a whole new store in result/madoka/nix/store to act as the source
<clever> Baughn: skip the --from
<clever> ambro718: an issue is already open on nixops, and i think Baughn commented on it
<clever> "oh, your package manager turned off the network"
<clever> "your package manager is crap, let me do that for you"
<clever> Myrl-saki: ive seen one package use Setup.hs to pre-download and build a c++ project from source, so the ffi code could link into it
<clever> Myrl-saki: i think things like native dependencies that cabal doesnt understand
<clever> Myrl-saki: but a custom Setup.hs could do extra stuff in the configure
<clever> Myrl-saki: the 2 line default i gave above compiles into a binary that is basically identical to cabal, so you can just `./Setup configure` or `./Setup repl`
<clever> Myrl-saki: its a wrapper around cabal, that allows a package to extend cabal
<clever> Myrl-saki: i suspect (but havent confirmed) that the defaultMain is already compiled and will run fast even in runhaskell
<clever> Myrl-saki: yes, but 99% of the time, Setup.hs is 2 lines: import Distribution.Simple ; main = defaultMain
<clever> Myrl-saki: compileBuildDriverPhase is what compiles it
<clever> Myrl-saki: potentially, we can just runhaskell Setup.hs
<clever> Myrl-saki: ah, one problem ive noticed, nixpkgs wants to compile Setup.hs, and the linking can be rather slow
<clever> Myrl-saki: for haskell projects, there isnt much in the configure phase
<clever> Myrl-saki: for autoconf based projects, there is a lot of useless checking of things like the size of an int, which the stdenv could be caching
<clever> Myrl-saki: i think it depends a lot on the package
<clever> Myrl-saki: the dependency tree doesnt always allow it to do things in parallel
<clever> hlolli: as root
<clever> hlolli: what channel does `nix-channel --list` say your on?
<clever> hlolli: yeah, that could explain it
<clever> hlolli: add one of these 5 keys to your configuration.nix
<clever> nodejs nodejs-4_x nodejs-6_x nodejs-8_x nodejs-9_x
<clever> gchristensen: hydra cant do local builds
<clever> manveru: and hydra doesnt schedule things to slaves that have given paths, so it took another 12 hours to push it back out
<clever> manveru: it took hydra 12 hours to transfer the unpacked source from a build slave back to the master
<clever> manveru: at one point, the chrome derivation had its unpack&patch phase in a dedicated derivation
<clever> manveru: pushd and popd can manage that without subshells
<clever> so i would expect that to break a lot
<clever> Baughn: ive found that some builds set bash vars in each phase, and expect it to spread to the next phase
<clever> Baughn: what exactly are you changing?
<clever> roconnor: check the entire nix-store -q --tree ~/.nix-profile/ to see what depends on that version
<clever> which makes nix-env silently act as if you had directly nix-env -i'd qt-base
<clever> roconnor: something in your profile had qt-base in the propagated-user-env-packages
<clever> roconnor: one min
<clever> monotux: i think theres an after field in the systemd config on nixos, for each service
<clever> niksnut: main issue i ran into, is that nix doesnt have a way to serialize a set into a .nix file, so i cant generate a manifest.nix, which means `nix-env -i` wont work right
<clever> niksnut: this generates an arx bundle containing the closure of nix and a basic shell env, run sh on it to install, and then you have a full non-root mount namespace in ~/nix-install along with a script for entering the namespace
<clever> niksnut: that is something i wrote last week
<clever> 4
<clever> Li[m]: i think override has to go first, so just swap the order from that example
<clever> i cant remember how though
<clever> the dummy is somehting i added
<clever> 58 2018-02-24 15:04:58 (current)
<clever> [root@amd-nixos:~]# nix-env -p /nix/var/nix/profiles/per-user/root/channels --list-generations
<clever> nixos-18.03pre129076.831ef4756e3
<clever> dummy
<clever> [root@amd-nixos:~]# nix-env -p /nix/var/nix/profiles/per-user/root/channels -q
<clever> so when you add/update a channel, it basically just does nix-env -p <foo> -i /path/to/channel
<clever> behind the scenes, nix-channel will manage a nix-env profile
<clever> +1
<clever> makefu: pasted more into it
<clever> i dont have a wiki acct
<clever> and it will search within it
<clever> makefu: any directories above that (like test in my example) are basically ignored, but allow you to symlink into dirs owned by other users
<clever> makefu: nix-env will recursively search ~/.nix-defexpr/ until it either finds <name>.nix or <name>/default.nix, and then create a channel with <name>
<clever> makefu: for a more complete explanation of how things work
<clever> just the vm
<clever> yeah
<clever> you might be able to remove those udev rules now and still have it work
<clever> so it relied on the udev rules
<clever> i'm guessing that previously, the helper to gain root and not need udev was just missing
<clever> ah
<clever> something must have changed
<clever> where you running things as root?
<clever> you need the config listed in the comment to make it setuid
<clever> installing it wont make it setuid root
<clever> then you need to enable something
<clever> does the target of that symlink exist?
<clever> ah, a symlink
<clever> hyper_ch: and if you run file on it?
<clever> hyper_ch: does that path exist?
<clever> i'm also not sure what nix2 has done with ~/.nix-defexpr/
<clever> makefu: that would be a good idea
<clever> the-kenny: nix-env is the only tool that reads ~/.nix-defexpr/ and the structure is un-documented
<clever> the-kenny: no changes at all to it
<clever> or have entirely custom package sets
<clever> all nix-env cares about, is that it returns a function, which returns a package set, so you can import any nixpkgs you want, fetched any way you want
<clever> makefu: this creates a foo channel, so i can now nix-env -iA foo.hello
<clever> import /home/clever/apps/nixpkgs
<clever> [clever@amd-nixos:~]$ cat .nix-defexpr/test/foo/default.nix
<clever> Lisanna: my plan is to go thru every example i scraped off irc, and document how each works
<clever> Lisanna: NIX_REMOTE?
<clever> --delete-generations*
<clever> boomshroom: ah, nix-env -p /path/to/profile --delete-generation 5
<clever> ExprSelect(const Pos & pos, Expr * e, const AttrPath & attrPath, Expr * def)
<clever> boomshroom: is it just a result symlink you left somewhere?
<clever> line 360 of parser.y also has special handling, to let you call a function named `or`
<clever> ah
<clever> then `or` and another expr_select
<clever> (import <nixpkgs>{}).hello
<clever> and then an attribute path
<clever> a .
<clever> any simple expression, even (import <nixpkgs>{})
<clever> and how the parser parses it
<clever> from lexer.l
<clever> or { return OR_KW; }
<clever> Lisanna: `or` is for attributes, it will use the right side of the attribute on the left doesnt exist
<clever> then the perl was purged, and nix-build became a c++ binary that just called the library functions in turn
<clever> nix-build was a perl script that used both
<clever> nix-instantiate '<nixpkgs>' -A hello turns a nix expression into a derivation
<clever> nix-store -r /nix/store/foo.drv builds a derivation
<clever> ive only use `nix copy`, `nix copy-sigs` and `nix repl`
<clever> ive not really used `nix` for building for building yet
<clever> Lisanna: i still use nix-build and it outputs the logs
<clever> thats a bit ugly, but it makes sense
<clever> where to get the source, how to build and configure it, what depends on what
<clever> nixpkgs is just build scripts, not source code
<clever> rawtaz: so it helps if they are tracked in the same repo and kept in sync with eachother
<clever> rawtaz: the commands you use to start a daemon depend on what version it is
<clever> and when ran, it boots a distro
<clever> rawtaz: yeah, nixos is just a single giant package called top-level, that depends on a ton of other specialized packages
<clever> boomshroom: each nixos had a unique value for its device=
<clever> so i used a bind-mount at boot time to change the whole profiles directory
<clever> yeah
<clever> nixos-rebuild cant be told to use a different profile
<clever> profiles-arm/system
<clever> or rather
<clever> yeah
<clever> but in my case, i was running arm and x86 nixos from the same disk
<clever> that would probably be simpler, if you only have 1 nixos
<clever> ah yeah, if you just mess with the ~/.nix-profile symlink, you can get nix-env to use any profile
<clever> boomshroom: the default profile is roots nix-env profile
<clever> boomshroom: i had to manually add both to the gcroots directory
<clever> to bind-mount the right one
<clever> boomshroom: when i shared a store between platforms, i had a profiles.x86 and a profiles.arm, and then i used fileSystems."/nix/var/nix/profiles" = { fsType = "bind"; ...
<clever> dtz: yeah, the commit messages are a bit cut off
<clever> or that?
<clever> 2018-03-11 16:52:11-{^_^}:#nixos- → 0edb8f7b by @dtzWill: Merge pull request #36810 from dtzWill/fix/glibc-with-mus
<clever> samueldr: maybe that?
<clever> 2018-03-11 16:44:45-{^_^}:#nixos- → 880311a5 by @grahamc: Merge pull request #36824 from dupgit/patch-
<clever> samueldr: i checked it here, nothing looks cut off
<clever> if you wipe that, it will re-check everything
<clever> Lisanna: ~/.cache/nix/tarballs/ is where it stores the cache
<clever> ahh
<clever> heh
<clever> ?
<clever> an hour i think?
<clever> yep
<clever> yes
<clever> Lisanna: the ttl for builtins.fetchTarball
<clever> boomshroom: if your on wep or open, you can manually connect using iwconfig
<clever> boomshroom: yeah
<clever> and hardware.wireless.enable = truee;
<clever> boomshroom: for all of my systems, the wifi drivers just work, and all i have to do is copy /etc/wpa_supplicant.conf in to make it live
<clever> yeah, something sometimes doesnt work right with that in the binary cache
<clever> so it never uses it
<clever> disasm: you dont have cache.nixos.org listed
<clever> substituters = https://hydra.iohk.io
<clever> disasm: what is in your nix.conf?
<clever> disasm: zziplib is on the binary cache
<clever> URL: nar/0rn7rf3y36cvhv2gypbkl8vq18f2p3vql7v9bm1sgdv4nr8s962x.nar.xz
<clever> i need the outpath of it
<clever> disasm: can you give me an example of a storepath its building?

2018-03-11

<clever> disasm: hydra no longer has the capability to store anything, it caused too many IO issues
<clever> disasm: everything hydra builds is automatically uploaded to cache.nixos.org
<clever> the initrd contains the entire rootfs
<clever> until the installer overwrites /boot
<clever> then it will always boot into the installer
<clever> just copy the kernel&initrd to /boot, and add it as the default in grub config
<clever> you can also manually edit the grub config, and do it without kexec
<clever> its a kernel option that is enabled on most systems
<clever> but kexec lets you change the fs, and even add luks
<clever> so your stuck with whatever FS and partition layout the machine started with
<clever> then upgrades it to full nixos
<clever> one of them (i forget which) just does a single-user nix install on the host OS
<clever> the other tools reuse the existing partition layout
<clever> but kexec allows you to repartition the machine as you infect it
<clever> yep
<clever> only issue, is that you have no way to recover from any mistakes, because you cant just plug in a usb stick and reboot it
<clever> when thats done, reboot, it now runs nixos
<clever> then run justdoit
<clever> within 30-60 seconds, its running nixos from ram, reconnect ssh
<clever> scp that to practically any server, unpack to /, and run /kexec_nixos
<clever> rawtaz: the files in here generate a tarball
<clever> rawtaz: also, have you heard of kexec?
<clever> rawtaz: yep
<clever> so you could just run it on a remote server and then connect to it over http
<clever> so you could remotely control the installer
<clever> because i wanted it to be http based
<clever> but then i redid it in QX
<clever> rawtaz: it started out in QT
<clever> rawtaz: i couldnt fully make up my mind on what to make the UI in
<clever> so you literally plug any machine into the ethernet jack, netboot it, then type in justdoit
<clever> and netboot_server as a whole, configures my old laptop to act like a router and netboot server
<clever> rawtaz: this bakes justdoit into the netboot image
<clever> rawtaz: the last install i did was a network boot based one
<clever> all of the config is baked into the installer image at build time
<clever> and it just does it :P
<clever> rawtaz: so you just boot the installer, and run justdoit
<clever> rawtaz: that file is a nixos module, that installs it into the ISO or whatever else your booting
<clever> rawtaz: i have a bash script that automates the whole thing
<clever> rawtaz: and a 512mb /boot partition, plus some swap
<clever> rawtaz: i prefer using zfs for the filesystem, with /nix on its own dataset so it doesnt get snapshotted
<clever> Guanin: the channels are all branches on the nixpkgs-channels repo
<clever> rawtaz: the partition editor and configuration.nix editor still need work
<clever> havent tried it calamares
<clever> yeah, thats the gui i was working on
<clever> manveru: ive got some bash scripts to fully automate installing nixos, and have a gui installer i was working on at one point
<clever> epta: instead use `nixos-rebuild boot` and then reboot the machine
<clever> manveru: i once ran armv6 and x86-64 on the same rootfs
<clever> nix-env only changes it for 1 user, and doesnt change any configs
<clever> fendor: that changes the version of nix system-wide, and updates a few config files for nix
<clever> yes
<clever> fendor: if your on nixos, then you should set nix.package = pkgs.nixUnstable; to upgrade it
<clever> fendor: only if your not on nixos
<clever> id avoid using the latest. section for now, that definitely sounds like its to blame
<clever> yeah, wabt is too small to have an issye
<clever> i'm guessing its the mozilla overlay
<clever> *reads*