2017-10-24

<clever> kiloreux: yes
<clever> xelxebar: i recently ran out of disk space just trying to `git clone` chromium, that thing is huge
<clever> xelxebar: /tmp/nix-build-<name>
<clever> yep
<clever> but the propagated deps collide silently, and it just picks one without telling you what
<clever> i think the problem is that nix-env only warns about collisions with things you asked to install
<clever> putting them into systemPackages is the simplest way to do that
<clever> so you must always install both from the same nixpkgs
<clever> and $QT_PLUGIN_PATH says to always load the ones in ~/.nix-profile/
<clever> yeah, wireshark and wpa_gui are fighting over what version of the QT libs to put into ~/.nix-profile/
<clever> tnias: and if you run wireshark?
<clever> tnias: try nix-env -e wpa_gui, then check that ls again
<clever> oh, gist truncated the last one
<clever> tnias: does "ls .nix-profile/lib/qt-5.9/plugins/platforms/ -lh" still list 5.9.0 or 5.9.1?
<clever> tnias: can you gist the output of this?
<clever> nix-store -q --tree $(realpath .nix-profile)
<clever> tnias: configuration.nix doesnt come into play here, the problem is currently in your .nix-profile, which is only nix-env
<clever> and once i remove those, wirehshark actually breaks
<clever> in my case, multimc and obs-studio are both leaking a lib/qt-5.9 directory
<clever> nix-env -e usbguard
<clever> try uninstalling that
<clever> or wpa_gui?
<clever> is there anything QT related in there?
<clever> tnias: what does "nix-env -q" say?
<clever> which is exactly what nix was meant to prevent
<clever> it puts stuff specific to one package into your profile, and breaks everything else
<clever> this is why i dont like the idea of propagatedUserEnvPkgs
<clever> and you have 5.9.0 plugins in there
<clever> mine happens to have 5.9.1 plugins, which match the wireshark
<clever> lrwxrwxrwx 1 root root 100 Dec 31 1969 libqxcb.so -> /nix/store/32xflsmyjhidkyaj5nwklfzb1gp8byxk-qtbase-5.9.1-bin/lib/qt-5.9/plugins/platforms/libqxcb.so
<clever> tnias: what about this directory?
<clever> [clever@amd-nixos:~]$ ls .nix-profile/lib/qt-5.9/plugins/platforms/ -lh
<clever> and i only see qt 5.6.2 things in the profile, and none in system
<clever> MichaelRaskin: and wpa_gui is linked to 5.9.0, and loading 5.9.1 stuff it shouldnt
<clever> MichaelRaskin: the strange part, is that wireshark is linked against 5.9.1, and is loading 5.9.0 stuff it shouldnt
<clever> tnias: what does "ls -l ~/.nix-profile/lib/ /run/current-system/sw/lib/" output (it will need a pastebin)
<clever> tnias: so the problem is something else you have installed, and rebuilding wireshark wont fix it
<clever> tnias: it just works
<clever> tnias: when i run "/nix/store/k60z1dnzw2vrp6hv3y79bbzd8w1zv218-wireshark-qt-2.4.1/bin/wireshark
<clever> tnias: 500mb closure size! ouch
<clever> tnias: oops, no, first, "type wireshark" then realpath on that path
<clever> tnias: what does "realpath wireshark" say?
<clever> tnias: the design of nix makes it such that you will get the same binaries even if you rebuild the package
<clever> hyper_ch: modify what the cpu does
<clever> hyper_ch: yes
<clever> i would say that its a bug that the microcode half isnt compressed
<clever> tnias: why do you want to do that?
<clever> hyper_ch: what about this? file -L /run/current-system/initrd
<clever> hyper_ch: i cant see anything in that github that woulc explain the oddness, does "git diff" show any changes to that config?
<clever> hyper_ch: what does this say: file /boot/kernels/bq3i0p29450zhiv11da9w3w036yfx1bh-initrd-initrd
<clever> hyper_ch: can you gist it?
<clever> hyper_ch: what nixos config did you use to generate this?
<clever> and that could break things
<clever> my guess, is that your prepending an uncompressed cpio, to a compressed cpio
<clever> hyper_ch: can you gist the entire grub config file?
<clever> GenuineIntel.bin?
<clever> man page says -i reads stdin
<clever> csingley: you can also just add the module to imports in your configuration.nix, thats how i test most modules
<clever> ma27: i usually just tab-complete the package under nix-repl '<nixpkgs>'
<clever> fusion809: the package has to be added to all-packages.nix for it to be visible within the root of nixpkgs
<clever> also, if you try to poll that http UI every 60 seconds, the router will lock up solid every 29.5 days, like clockwork
<clever> then after another 2gig of invisibly incrementing, it jumps back to 0 and resumes working
<clever> the web ui, uses signed 32bits, and the counter stops at 2gig
<clever> the linux backend, counts up to 4gig (32 bits), then overflows to 0
<clever> oh yeah, and the byte usage counters in the web ui also suck
<clever> the ISP patched it, poorly
<clever> ArdaXi[m]: the website for the router also claims such a mode doesnt exist
<clever> ArdaXi[m]: so i need a 2nd router configured in AP mode, just to use my own wifi
<clever> ArdaXi[m]: except they screwed up, and didnt put an off button in the router config
<clever> so i would have to plug both machines directly into a router
<clever> also, my existing wifi from the ISP doesnt even allow wifi clients to talk to wired clients
<clever> so you can only access the router, and no other machine on the LAN
<clever> and then there are more hostile networks, that actualy protect you from the guy next to you
<clever> :D
<clever> and then how do i ensure the client can use the host as a binary cache?, when i dont know what ip it will be on the network?
<clever> the 2nd request from ipxe may not be as choosy
<clever> but its more messy, and that only works for the first request from the bios
<clever> yeah, ive done that as well
<clever> ArdaXi[m]: i need to control the dhcp server to catch netboot requests
<clever> ArdaXi[m]: just connect the 2 laptops with a cat5, run "justdoit", and the entire install is done
<clever> ArdaXi[m]: but i have a new laptop on-route, and i'll be away from home when i get it, so having the entire system contained within the old laptop helps
<clever> ArdaXi[m]: my old netboot setup is spread over 2 or 3 machines, gentoo runs the tftp, nixos runs the dhcp+bind, gentoo runs the apache
<clever> ArdaXi[m]: it also puts justdoit into the resulting netboot image, so typing "justdoit" into the shell will do the entire install, insta-nuking whatever OS was in the way
<clever> ArdaXi[m]: and sets up NAT between the wifi and ethernet, so the laptop becomes a router
<clever> ArdaXi[m]: this does the full iPXE setup on my laptop, serving it over the ethernet jack
<clever> Harekiet: it will cost you ~300mb on /boot/, but then you can recover from pretty much anything
<clever> Harekiet: this puts a copy of the entire install environment into /boot/ and adds it to the grub menu
<clever> Harekiet: there is also something else i wrote recently that you might find useful: https://github.com/cleverca22/nixos-configs/blob/master/rescue_boot.nix
<clever> ArdaXi[m]: but you can forcibly install nixos-install with the right nix-env args
<clever> ArdaXi[m]: nixos-install makes some assumptions about what the kernel can support, for things like unshare
<clever> ahh
<clever> TweyII: qt does a lot of things, some similar to what cmake does
<clever> TweyII: cmake will hijack the configure phase to use cmake
<clever> TweyII: unzip will mutate the unpack handler, so it can unpack zips
<clever> TweyII: pkg-config will mutate the function that iterates over buildInputs, so every input winds up in the pkgconfig search path
<clever> TweyII: the hooks for a/b/c will get sourced as d starts the build, and then d can also optionally define its own hook, for things that depend on d
<clever> TweyII: if a derivation sets $setupHook, the stdenv setup.sh will copy that file to $out/nix-support/setup-hook and apply substituteAll so things like @out@ get replaced with $out
<clever> kiloreux: restore the line 2 i previously said to delete, and dont use with import nixpkgs
<clever> kiloreux_: the makefile could also mkdir -pv ${STACK}/lib, that would be fine on every platform
<clever> kiloreux_: cp can be really weird and buggy at times
<clever> kiloreux_: oh, you will need to mkdir -p $out/lib in the preinstall then
<clever> kiloreux_: can you paste everything from the terminal to a pastebin?
<clever> kiloreux_: which will set a var that makes the existing makefile do the right thing
<clever> kiloreux_: you could do something like: preInstall = ''installFlags="$installFlags STACK=$out"'';
<clever> kiloreux_: can you link a copy of the makefile?
<clever> kiloreux_: it will depend on what the makefile is doing exactly
<clever> kiloreux_: you must install things under $out, not /lib
<clever> still better to use a set, so you can add more things in the future
<clever> infinisil: i think nix-env gets upset when it doesnt have a name or attr to look for
<clever> kiloreux_: then nix-env -f foo.nix -iA pkgname
<clever> kiloreux_: modify the file to return a set of packages, { pkgname = stdenv.mkDerivation { ... }; }
<clever> nix-env -iA nixos.androidsdk will get the current version from the channel
<clever> "nix-env -i /nix/store/czcykdikj6cbd2zqpizi714bfgj7x0b8-android-sdk-25.2.5" will install exactly that version
<clever> doublehp: you can also run "nix-store -i /nix/store/<hash>-<name>" directly on any storepath, and it will be added to your users profile
<clever> doublehp: then you will want to install the package that provides adb as well
<clever> kiloreux_: correct
<clever> yes
<clever> go will only be available if you put go into the buildInputs
<clever> kiloreux_: the with on line 1 handles all of that for you
<clever> kiloreux_: oh, delete line 2
<clever> kiloreux_: looks good, and does it work when you run nix-build against it?
<clever> kiloreux_: why is it a no-go?
<clever> kiloreux_: nix-shell
<clever> joko: f = prefix: suffix: input: removePrefix prefix (removeSuffix suffix input);
<clever> betaboon: thats the only indication you get, and it just hangs there for a while
<clever> but it gives no indication that it is doing so
<clever> after the remote end has downloaded things from the binary cache, nixops has to push things with nix-copy-closure
<clever> betaboon: run "ps -eH x" or "pstree" in another terminal and paste the area around nixops into a pastebin
<clever> upon 2 sets in the same key, it will recursively call itself to merge them
<clever> lib.recursiveUpdate
<clever> joko: yeah, there is another function for that
<clever> joko: if its a json file, networking.hosts = { "127.0.0.1" = [ "mynixos" ]; } // (builtins.fromJSON (buildins.readFile ./blabla));
<clever> joko: if blabla is another nix file, networking.hosts = { "127.0.0.1" = [ "mynixos" ]; } // import ./blabla;
<clever> joko: // will merge and overwrite keys at the first level
<clever> doublehp: yeah
<clever> doublehp: you need to use the actual hash and version for the old firefox
<clever> that will switch back to the 51 version, until you tell it to update again
<clever> doublehp: just run nix-store -i /nix/store/hash-firefox-51/
<clever> doublehp: using nix-env or systemPackages?
<clever> LexLeoGryfon: does lspci show 1 or 2 gpu's?
<clever> nohTo: and if your rootfs allows, you can always create a swap file and just delete it when your done
<clever> nohTo: so you may need to add swap and "mount -o remount,size=7G /nix/.rw-store" to bump the tmpfs up
<clever> nohTo: there is a bug in recent versions of nixos-install, that try to build the entire OS on the tmpfs, then copy it to the hdd
<clever> LexLeoGryfon: i run nixos on all of my machines now, servers, routers, and desktops/laptops
<clever> nohTo: nixos-install will do the chroot for you
<clever> nohTo: yes
<clever> TweyII: this one for example, will replace the configure phase with the cmake configure phase: https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/tools/build-managers/cmake/setup-hook.sh#L63
<clever> TweyII: so they are free to modify the env vars and functions of the stdenv
<clever> TweyII: a setup hook is simply sourced when going thru the list of buildInputs
<clever> sphalerite: just keep in mind that while the total memory can go a lot higher, each process is limited to 3gig
<clever> sphalerite: i cant see why not
<clever> it might be slightly broken, try "mkdir -pv kernel/x86/microcode" then re-run cpio
<clever> what output did cpio give?
<clever> so run it within a new empty one
<clever> and it unpacks to the current dir

2017-10-23

<clever> joko: you would either checkout a nixpkgs you like from git, or double-check that you like where the channel is, then point -I nixpkgs= at that, and then it will persist until overriden again
<clever> joko: and if you did change that, nixos-rebuild -I nixpkgs=/foo switch, would "temporarily" override it, but change what is "current", so it then sticks
<clever> joko: in this case, 56 refers to a fixed-output derivation, but you can also just refer to ${<nixpkgs>} which will indirectly refer to the current nixos's nixpkgs
<clever> joko: at this point, nix-build, nixos-rebuild, and nix-shell will always use that copy, and never look at the channels
<clever> joko: line 48 then sets NIX_PATH to use that
<clever> joko: line 56 bakes a given nixpkgs into the system, which will appear at /run/current-system/nixpkgs at runtime
<clever> how big is a pointer? i wont tell you which cpu, you must give the right answer for every platform!
<clever> sphalerite: llvm will bake the wrong struct into that bitcode
<clever> sphalerite: for example, one of the structs passed to signal handlers, contains various cpu registers at the time of the signal, so segfault can be handled right
<clever> sphalerite: there is still the problem that llvm and the project your building, needs to know what structs and such to build against
<clever> kuznero: i would just do meta.platforms = [ "x86_64-darwin" "x86_64-linux" ]
<clever> sphalerite: i dont know of any way to fix that right now
<clever> sphalerite: but now the arm is incapable of building anything for itself, and must force jobs out to an x86 to get anything done
<clever> sphalerite: you can sorta fix that, by using config.nix to force everything to be cross-compiled
<clever> and then it takes 24 hours to build hello-world
<clever> it will eval it in native mode, and want a glibc + gcc that where built natively
<clever> then i boot it up, and nix-env -iA nixos.hello
<clever> sphalerite: if i build the entire nixos image with a cross-compiler
<clever> sphalerite: the main issue there, is that the purity of nix doesnt really play nicely with that
<clever> yeah, it should see its already in the store and just use that
<clever> depending on if $src was fetched with the arm curl or the x86 curl
<clever> you have 2 different ways of building the same $out
<clever> sphalerite: but the $out hash is
<clever> sphalerite: so the .drv hash isnt protected against changes in curl that fixed-output gives
<clever> sphalerite: the fixed-output derivations refer to the curl nix was built against
<clever> kuznero: so when a linux util scans, it can detect that it is still supported on darwin
<clever> kuznero: and in each version, make sure to set meta.platforms to cover both i think
<clever> in if (stdenv.system == "x86_64-linux") then linux64 else mac64
<clever> kuznero: for example, put both derivations into a let block, followed by
<clever> kuznero: id put an if statement in the file, to select between 2 derivations
<clever> kuznero: OSX doesnt let you change the interpreter, and the rpath goes by a slightly different name
<clever> sphalerite: with the older nix thats in 16.09, all binary cache stuff is handled by perl scripts
<clever> with nixUnstable, all binary caches are handled directly in c++ within nix, and local?root=/mnt handles this type of store
<clever> that is what local?root=/mnt replaced
<clever> sphalerite: this allows the nix inside the chroot to treat a bind mounted store as a binary cache
<clever> sphalerite: there is also another thing, let me find it
<clever> and with those entries removed, it fails to find them
<clever> kuznero: and the --shrink-rpath on line 18 cant detect that, so it removes things you just put into the rpath
<clever> kuznero: the problem, is that dotnet is using dlopen() to open some of its libraries
<clever> sphalerite: you will need to do "nix-shell -p nixUnstable", and if it gets root, it may upgrade the db.sqlite, which then means you have to keep using nixUnstable
<clever> kuznero: but it may also break things, so try with it off and see if that helps
<clever> kuznero: the automatic shrink is still of use, it can remove things you added but didnt actually need
<clever> sphalerite: something like nix copy --to local?root=/mnt
<clever> sphalerite: one sec
<clever> which may break the rpath after your test --version
<clever> kuznero: it turns off the fixup hook that shrinks the rpath
<clever> nix-repl> lib.makeLibraryPath [ curl ]
<clever> "/nix/store/hnmggddfiq3fqxcpl5jclrrxdi21m1wb-curl-7.56.0/lib"
<clever> nix-repl> lib.makeLibraryPath [ stdenv.cc.cc ]
<clever> "/nix/store/klqzvvcy1xyjjflmf7agryayc4s72jg2-gcc-6.4.0-lib/lib"
<clever> kuznero: also makeLibraryPath already handles the .lib and .out stuff
<clever> kuznero: which may remove some elements from your rpath
<clever> kuznero: there is a post-install hook that will run patchelf --shrink-rpath on everything
<clever> kuznero: if you add dontPatchELF=true; to the derivation, does it work better?
<clever> kuznero: ah, and stdenv.lib is where you can find lib
<clever> kuznero: what error does dotnet give when ran?
<clever> kuznero: the stdenv just ignores the version attribute
<clever> kuznero: and the version on line 16 could just as easily be in the let block near 12
<clever> kuznero: that does all of line 12 at once
<clever> kuznero: nix-repl> lib.makeLibraryPath [ stdenv.cc.cc libunwind libuuid icu openssl zlib curl ]
<clever> kuznero: also, there is a function in lib to deal with line 12 for you
<clever> it doesnt even have a copy of nixpkgs in the channel anymore
<clever> ive stripped everything i can out of the host debian, lol
<clever> no free space on /tmp again
<clever> sphalerite: my 3rd attempt at building gcc died while building the info docs
<clever> sphalerite: ondemand was probably already doing its job
<clever> sphalerite: then it would cut the clock rate down to 600mhz, and now it cant decode video in realtime
<clever> sphalerite: i had an old laptop, where i used to watch videos on an external monitor with the display closed, the laptop would overheat because it expected airflow thru the keyboard
<clever> sphalerite: try stopping all load, let it cool down, and then see if the freq goes up
<clever> sphalerite: the cpu will just silently ignore requests to go faster, and run at a lower speed
<clever> sphalerite: thermal throttling is often without logs
<clever> sphalerite: thermal throttling may also be at play, what is the temp?
<clever> MagneticDuck: nix will accept several types of hashes, and will just silently convert them
<clever> evaluating file ‘/root/.nixpkgs/config.nix’
<clever> MagneticDuck: nix-instantiate '<nixpkgs>' -A hello -vvvvv 2>&1 | grep config.nix
<clever> f
<clever> infinisil: if it cant find the file, then sandboxing is of
<clever> infinisil: when nix is installed on ubuntu for ex, it wont have a nix.conf
<clever> MagneticDuck: nix-store --query --hash
<clever> infinisil: single-user nix can work without it on most distros
<clever> kiloreux: /etc/nix/nix.conf
<clever-afk> one option is to keep all the hardware stuff in hardware-configuration.nix and let nixos-generate-config remake that on the new machine
<clever-afk> tanonym: yes
<clever> sphalerite: another more nasty/hacky thing, attach gdb to a random process in the shell, and use gdb to eval system("make -j4"); in the remote process!
<clever> at 11%, its probably faster to restart
<clever> sphalerite: thats always safe, but depending on how long its been running, may cost more time then it would have saved
<clever> heading out now, i'll be back in a few hours
<clever> joko: which can be passed to nix-repl
<clever> joko: -I nixpkgs=/path/to/nixpkgs
<clever> sphalerite: id just leave it be
<clever> joko: does erlang_nox exist in your version of nixpkgs?
<clever> sphalerite: which is a \0 seperated list
<clever> sphalerite: you would want to peek within /proc/<PID>/environ of the make process, to get the real env vars
<clever> sphalerite: that likely wont have vars set by setup.sh and setup hooks
<clever> sphalerite: the env vars would all be wrong
<clever> joko: and what error does that file give?
<clever> joko: can you gist the entire file?
<clever> joko: (foo.override { input1 = bar; }).overrideAttrs (drv: { baz = qux; })
<clever> joko: .override changes the arguments to the package
<clever> ylwghst: you can test other strings by using: nix-repl '<nixpkgs>'
<clever> ylwghst: this path is valid
<clever> nix-repl> "${pkgs.alsaUtils}/bin/amixer set Master 5+"
<clever> "/nix/store/2nc1a365maivx7qvr7dlllzjhrrj2dzq-alsa-utils-1.1.4/bin/amixer set Master 5+"
<clever> error: attribute ‘amixer’ missing, at (string):1:4
<clever> joko: this sets up a full menu, with a password protected ipxe repl
<clever> joko: yeah
<clever> ylwghst: wrong attribute
<clever> error: attribute ‘alsa’ missing, at (string):1:4
<clever> nix-repl> "${pkgs.alsa}/bin/amixer set Master 5+"
<clever> joko: it uses ipxe
<clever> joko: that sets up netboot and nat, with the wifi as the WAN, and the ethernet as the LAN
<clever> joko: and related, here is an actual netboot using the netboot images: https://github.com/cleverca22/nixos-configs/blob/master/netboot_server.nix
<clever> joko: so i need to disable snapshots on /nix/
<clever> joko: yeah, i have snapshots enabled for / but then i cant garbage collect
<clever> joko: the existing livecd iso can also boot on usb, and has a copytoram option to do the same thing
<clever> joko: i used it 2 days ago to move /nix from the / dataset to the /nix dataset in zfs
<clever> joko: so you can mount the rootfs from that, and perform any kind of repair
<clever> joko: it just sticks the same "netboot" images into /boot (minus justdoit) and adds a menu entry to grub
<clever> joko: also, did you see my rescue option?
<clever> joko: that could be done, they all appear in /proc/cmdline
<clever> seequ: thats the bug i mentioned to sphalerite a few minutes ago
<clever> seequ: does it still produce a result link and give directions?
<clever> joko: its only partialy written right now, but you can "nix-build dummy.nix" then run qemu-kvm with the right args (including -append from the pxe config) to boot the resulting image
<clever> joko: also, did you notice the dummy.nix i made for testing?
<clever> joko: ah, sure
<clever> joko: for which changes?
<clever> joko: that will just re-download the entire thing from the binary cache
<clever> nix-store --repair-path paths...
<clever> joko: nix-store --verify-path /nix/store/9ac9bfx006fpvpnx7aqbhn25dz7zfbpb-audit-2.6.6-bin
<clever> joko: one sec