2017-06-01

<clever> ah, is there a way to save the compile output?
<clever> deba5e12: just run "nix-shell -p libpcap" and then try to compile under that
<clever> and there is a lot of other things nix-shell does to help
<clever> that tells it where to look at runtime, but not where to look at link-time
<clever> deba5e12: it will never look in ~/.nix-profile by default
<clever> deba5e12: nix only sets the linker flags up if your using nix-build or nix-shell
<clever> apeyroux: does it do anything with emacs?
<clever> i would just check to see where the symlink points after it gives the warning, and it should stay pointing in that direction
<clever> simukis: in the case of systemPackages, it will ignore the collisions, so i believe it will depend on the order of the entires within systemPackages
<clever> simukis: what package provides the original executable?
<clever> simukis: thats better handled with an alias
<clever> su is the older program, sudo has replaced it
<clever> ioserjg: i think su is skipping a step in creating the shell
<clever> ioserjg: what if you use "sudo -u miner -i"
<clever> ioserjg: does miner own /home/miner?
<clever> it just uses -E to generate a runCommand expression on the fly
<clever> thats almost exactly what -p does
<clever> i think i have an example somewhere recent
<clever> and if its a custom package, you will need a default.nix file that defines a runCommand depending on it
<clever> ertes-w: -p, which cant be mixed with -A
<clever> { foo = "bar"; }
<clever> nix-repl> lib.listToAttrs [ { name = "foo"; value = "bar"; } ]
<clever> ertes-w: lib.listToAttrs is close
<clever> thats part of the etc module in nixos
<clever> joehh: you can make nixos generate that for you with environment.etc."mdadm.conf".text = ".....";
<clever> not sure, it just connects to port 25 on localhost last time i used it
<clever> Isorkin: echo test-mail | sudo sendmail root@localhost
<clever> Isorkin: it ran the echo as root, then sendmail without root
<clever> Isorkin: sudo and | dont work like that
<clever> ertes-w: runCommandCC includes gcc
<clever> ertes-w: it also includes the stdenv, but not gcc
<clever> joehh: config.boot.initrd.mdadmConf controls the content of /etc/mdadm.conf within the initrd
<clever> ertes-w: so buildInputs works as normal, and all attributes in it become env variables
<clever> ertes-w: that will get added to the derivation, and will do everything the attrset for mkDerivation can do
<clever> ertes-w: runCommand "name" {attrset} "script to generate $out";
<clever> Isorkin: what about using sendmail instead of mail?
<clever> oops, meant that for aloiscochard
<clever> you must use nix-shell for a linker to work
<clever> amosbird: also, nix wont setup the linker flags to find libraries installed with nix-env
<clever> and non-exported variables
<clever> bash also has 'set' which will show functions as well
<clever> Isorkin: can you confirm that exim is running?
<clever> Isorkin: services.postfix.enable = true; i'm guessing
<clever> yep :)
<clever> amosbird: the exact path will differ between nixos and centos, look around in that area
<clever> grep on nixpkgs can also find the domain for software where the name isnt clear
<clever> and a grep directly on nixpkgs (not nix-env) will find the attribute i pasted when i first found Keras
<clever> $ grep -ir keras --color ~/.nix-defexpr/channels_root/*/pkgs/
<clever> you can also grep -ir on nixpkgs
<clever> yeah, thats simpler
<clever> but its regex, so you could do .*[kK]eras.* if you wanted to
<clever> yeah, caps trip me up soemtimes too
<clever> ah, so for python packages, always use the case that pypi shows
<clever> the output of git blame
<clever> 397e59b4c93 (Frederik Rietdijk 2017-02-15 12:56:58 +0100 29871) Keras = callPackage ../development/python-modules/keras { };
<clever> because somebody called it Keras!!
<clever> pkgs/top-level/python-packages.nix: Keras = callPackage ../development/python-modules/keras { };
<clever> i cant find it when using master directly
<clever> do nix-channel --update
<clever> you can try updating
<clever> yeah
<clever> and what does nix-channel --list say?
<clever> are you on nixos or another distro?
<clever> amosbird: they are all listed on the site i linked
<clever> nix-channel expects a directory containing a nixexpr.tar.gz
<clever> and they dont have to be installed
<clever> nix-shell will download everything you list in -p for you
<clever> thats not how nix works
<clever> yep
<clever> amosbird: then give it to nix-shell with -p
<clever> chpatrick: and cmakePhase
<clever> chpatrick: when you run nix-shell like that, it will drop you into a shell suitable for building the derivation you pointed it at
<clever> i believe its an issue within cloudflare/front
<clever> but that url works from this end
<clever> it sets the ip range for the guest network, and runs a tftp server pointed at a given dir
<clever> srhb: this is from my automated testing of ipxe
<clever> -net user,vlan=0,net=10.0.2.0/24,host=10.0.2.2,dns=10.0.2.3,hostfwd=tcp::2222-:22,tftp=${ftpdir}
<clever> srhb: qemu can also embed a tftp server inside the userland nat for you
<clever> and it needs zero config
<clever> so the guests can get internet access without having to give qemu root
<clever> then it opens a normal tcp connection on the host, and sends it to linux, which re-packetizes it
<clever> the userland nat in qemu will decode packets the guest tries to send out, and turn them into a simple bytestream
<clever> s/scribe/script/
<clever> srhb: "bridge helper failed" implies that qemu is supposed to be running a scribe to deal with bridging, if you dont need very fast network, you can just omit -netdev entirely, and qemu should setup userland nat
<clever> srhb: and if you want it to get into the internet, you also need to add the main ethernet card to that bridge in the nixos config
<clever> srhb: 'ip link' should show what bridge things have been enslaved to
<clever> and this allows different programs to depend on different libc's
<clever> everything on nix has an rpath set, which contains the absolute paths for things like libc
<clever> Rodenbach: anything compiled by nix expects LD_LIBRARY_PATH to either be blank, or to contain the opengl drivers
<clever> that looks normal at a glance
<clever> nix-shell '<nixpkgs>' -A gzdoom then run genericBuild
<clever> ah
<clever> nix doesnt allow you to use things you manualy built long-term
<clever> drakonis: for testing, or to use the built product?
<clever> there should be an option for that somewhere in the kde gui
<clever> drakonis: gzdoom lacks a .desktop file, you have to manualy run gzdoom in a terminal, or create a shortcut that runs gzdoom
<clever> drakonis: how are you installing them, and looking for them?
<clever> nohup firefox &
<clever> tanonym: nohup and & are the main way

2017-05-31

<clever> ah
<clever> puffnfresh: i was able to get xen to run under qemu
<clever> dhess: ive noticed that scp can get great speeds, but winscp (windows gui for it) on the identical hardware has horid speeds
<clever> dhess: works for me
<clever> in the form of an eMMC
<clever> only the compute modules have onboard storage
<clever> it was the armv6 model, so the cpu sucked pretty badly to begin with
<clever> the rootfs was stored on a 4tb hdd in the other room, and could be freely resized
<clever> dhess: i used to boot my rpi1's from iscsi, with /boot on an SD card
<clever> so you can experiment with things, without breaking the host
<clever> and i just had a thought, your free to make an imperative mess in /lib and /usr on a container, and just rm -rf it when your done
<clever> pie_: check the man page for nixos-container, and the containers. attribute in configuration.nix
<clever> i sometimes do something like HOME=/tmp/foobar; mkdir -p $HOME
<clever> you can also change HOME
<clever> yep
<clever> so they wont be used once you leave the shell
<clever> pie_: nix-shell does similiar, it will leave a cached copy of things in /nix/store/ but nothing refers to them
<clever> that will allow inserting the uboot path and other things
<clever> pie_: havent had a look yet, just woke up
<clever> so just clone the whole generic-extlinux loader and call it bbb-uboot
<clever> ah, line 22 says its u-boot compatible
<clever> dhess: i'm not sure, but i think this config file is compatible with u-boot, so you could clone this loader and add a dd step
<clever> yep
<clever> and that bash script is responsible for generating the bootloader config, copying kernels to /boot, and installing the bootloader
<clever> dhess: if you set system.build.installBootLoader to a bash script, nixos will run that any time it needs to update /boot
<clever> and if you just copy things around, it will use the old location as root
<clever> detran`: the uuid or devpath of the rootfs has to be embeded into the initrd by nixos
<clever> and it will re-compute the paths, and discover its all in the cache
<clever> normally, you would just give it the same configuration.nix and nixpkgs
<clever> *doh*
<clever> drakonis: fileSystems. in configuration.nix
<clever> drakonis: my printer happens to support google cloud print, so i can print to it from any computer, even on a different network
<clever> there is an open issue about it deleting things sooner in the process
<clever> mbrgm: you need to gc, then do another deploy, and maybe delete one of them by hand
<clever> mbrgm: ah, systemd-boot doesnt have a limit, you can only GC things
<clever> mbrgm: oops, see above
<clever> makefu: boot.loader.grub.configurationLimit can be used to limit how many generations are actually put into /boot, seperate from garbage collecting them
<clever> makefu: grub or efi?
<clever> makefu: look at the man page for nix-collect-garbage, the --delete-older-than options
<clever> systemPackages means you can keep track of stuff you installed by tracking configuration.nix in git
<clever> its mostly preference which one you use
<clever> nix-env is for more imperative installations
<clever> WinterFox[m]: or nix-env -iA nixos.firefox
<clever> WinterFox[m]: either add it to environment.systemPackages in configuration.nix and nixos-rebuild
<clever> makefu: feel free to bounce questions off me if you want to fill more things on the wiki in
<clever> makefu: ah nice

2017-05-30

<clever> formatting was off a bit on the 1st edit
<clever> simpson: at one point, i also managed to crash systemd's pid 1, and made the host unable to shutdown
<clever> simpson: last i was working on that, i did have a nixos container booting under systemd-nspawn, with the entire store going thru fuse
<clever> simpson: then ipfs could share those blobs without having any extra disk overhead
<clever> simpson: the idea with narfuse, was to mount a pile of uncompressed .nar files as /nix/store/, and leave them as NAR's
<clever> simpson: ive also used HFuse, but that was just an ffi wrapper: https://github.com/taktoa/narfuse/blob/master/Main.hs#L268
<clever> simpson: oh, thats your own question? heh
<clever> simpson: fuse passes struct's over the open file handle, to implement the api, and if you know the format, you could re-implement libfuse in any language
<clever> simpson: but modprobe was never meant to be used in a setuid context, and obeyed env varaibles, causing an exploit
<clever> simpson: i also recently saw an exploit in fuse, where it would automaticaly "modprobe fuse", from a setuid root binary
<clever> zetok: and the rdm that sphalerite mentioned is in rust
<clever> zetok: hsdm is in haskell
<clever> Infinisil: basicaly, it will launch X, then connect to X and present a login screen (optionaly with shutdown/reboot buttons), and once you give valid credentials, it will drop root to that user, and execute a desktop manager
<clever> sphalerite: more like getty + startx in a single binary, with no shell in the middle
<clever> i recently thought about cheating a bit, and doing the entire gui in textmode, then spawning X after you auth
<clever> sphalerite: there is also https://github.com/taktoa/hsdm
<clever> Infinisil: :D
<clever> Infinisil: ~6months ago, buildenv got rewritten to use c++ rather then perl, but the buildenv in nixpkgs hasnt been re-synced
<clever> that script has been written, but the one in nixpkgs is behind
<clever> Infinisil: it needs writeScriptBin
<clever> shnupta: depends on if you prefer wpa_supplicant or networkmanager
<clever> pie__: it will give an error telling the user to download it in a browser, and how to add it to the store
<clever> pie__: requireFile
<clever> is there a link i can download civ6 at?
<clever> weird
<clever> :D
<clever> if a dialog can show, then its still loading it
<clever> that can happen when the patching isnt fully done right
<clever> pie__: and you should never install libraries with nix-env
<clever> pie__: if you use a nix expression like this, nix will give you the correct openal
<clever> pie__: ah, that explains how you wound up with a 32bit version
<clever> pie__: what nix expression are you using?
<clever> pie__: the result/bin/mist made by compiling the nix expression, oh wait, thats miko___'s expression
<clever> pie__: what if you run ldd on the built mist file?
<clever> pie__: it should default to the same arch as the nix binary, what does this say? nix-instantiate --eval -E builtins.currentSystem
<clever> pie__: yeah, you have a 32bit file in the commented out fetchurl, but a 64bit file in the src attribute
<clever> Guillaum: that sounds related
<clever> Guillaum: doesnt sound like it would cause the timer issues
<clever> Guillaum: anything interesting in dmesg?
<clever> miko___: and the full error message it gave?
<clever> miko___: can you gist the nix expression you have?
<clever> yeah, the lib you want is in gtk2
<clever> --set-rpath ${lib.makeLibraryPath [ gtk2 ]} i think
<clever> --set-rpath for patchelf
<clever> ah, then you need to add gtk to the rpath
<clever> miko___: is it saying file not found when you run the file in bin?
<clever> juselius: overrideDerivation normally takes a function, that will return an attrset of new values, but callPackage makes an entirely new derivation
<clever> juselius: and overrideDerivation doesnt work like that
<clever> juselius: your also importing a 2nd nixpkgs, which uses different config and can cause any number of weird things
<clever> juselius: line 4 replaces the entire linuxPackages attrset with a set containing only virtualboxGuestAdditions
<clever> juselius: yep, exactly what i helped somebody with just ~4 hours ago
<clever> drakonis: by default, nixpkgs will load ~/.config/nixpkgs/config.nix, but nixos forces it to use the nixpkgs.config attrset from the nixos config, and only for the pkgs passed to configuration.nix
<clever> you beat me by 1 second!
<clever> miko___: add unzip to the buildInputs
<clever> juselius: can you gist the nix files you changed?
<clever> gchristensen: yeah, i always see people either bumping it on update (which breaks what it was meant to fix), or thinking that changing it can update everything
<clever> jsgrant: the only thing stateVersion controls is the version of pgsql and some sshd config
<clever> line 51 has to be un-commented
<clever> shnupta: oh right i saw this one a week ago, your missing services.xserver.enable = true;
<clever> LD_TRACE_LOADED_OBJECTS, LD_DEBUG, LD_VERBOSE
<clever> pie__: check the man page for ld.so
<clever> shnupta: can you upload the configuration.nix to gist?
<clever> and everything breaks
<clever> so next week when you want to make a proper package, or next year when upgrading curl, you wont remember this command
<clever> the problem with this, is that nix-env doesnt save that override
<clever> just make a new curl, and leave the old one alone!
<clever> nix-env -iA nixos.myCurl --arg config '{packageOverrides = pkgs: { myCurl = pkgs.curl.override { gnutlsSupport=true; sslSupport = false; };};}'
<clever> pie__: oh right, the stdenv uses curl for things
<clever> nix-env -iA nixos.curl --arg config '{packageOverrides = pkgs: { curl = pkgs.curl.override { gnutlsSupport=true; sslSupport = false; };};}'
<clever> oh wait no, disabled
<clever> pie__: ssl has to be enabled in the same override
<clever> assert !(gnutlsSupport && sslSupport);
<clever> Sonarpulse: which helps to shrink the runtime closure and clean up /tmp folders
<clever> Sonarpulse: yeah, the fixupPhase should run patchelf --shrink-rpath, which gets rid of entries that are of no use to the DT_NEEDED libs
<clever> pie__: ah, 3 { and 2 }
<clever> nix-env -iA nixos.curl --arg config '{packageOverrides = pkgs: { curl = pkgs.curl.override { gnutlsSupport=true; };};}'
<clever> pie__: ah, i was just guessing on that one-liner, let me look closer
<clever> Sonarpulse: are you allowing the fixupPhase to run?
<clever> pie__: can you gist a copy after you have modified it to include curl?
<clever> if you re-run nixos-install without a format, it will do exactly what you want
<clever> did you sucessfully nixos-rebuild after changing configuration.nix?
<clever> shnupta: then wireless isnt enabled in configuration.nix
<clever> dash: but that requires switching networkmanager on and doing a nixos-rebuild, without internet
<clever> shnupta: does "wpa<tab><tab>" find anything?
<clever> iwconfig can only do no-encryption and wep
<clever> shnupta: as long as they are wpa based
<clever> shnupta: that should work for most networks
<clever> shnupta: run "wpa_passphrase <networkname> <password> >> /etc/wpa_supplicant.conf" and then restart the wpa_supplicant service in systemd
<clever> shnupta: do you know how to use wpa_passphrase?
<clever> [ "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7l-linux" "mips64el-linux" "i686-cygwin" "i686-freebsd" "i686-linux" "i686-netbsd" "i686-openbsd" "x86_64-cygwin" "x86_64-darwin" "x86_64-freebsd" "x86_64-linux" "x86_64-netbsd" "x86_64-openbsd" "x86_64-solaris" ]
<clever> pie__: if you dont set system, it defaults to the same arch as the nix you ran
<clever> nix-env -iA nixos.curl --arg config '{packageOverrides = pkgs: { curl = pkgs.curl.override { gnutlsSupport=true; };}'
<clever> in theory, it could still be used, but it would be messy
<clever> just replace zlib with (curl.override { gnutlsSupport = true; })
<clever> pie__: when compiled, this creates a bash script that patchelf's things for you
<clever> pie__: and if you dont want a full nix expression, you can use this one i made a while ago: https://gist.github.com/cleverca22/8cae5bc9c02c12099a3bf5e20e75161f
<clever> pie__: if your using patchelf, then include that curl in the nix expression that is setting rpath
<clever> you must add that to the buildInputs of a nix expression thats needing it
<clever> pie__: and also, you never want to install libraries on nixos
<clever> pie__: --args sets arguments to the import <nixpkgs>, not the callPackage
<clever> pie__: (curl.override { gnutlsSupport = true; })
<clever> pie__: gnutlsSupport has to be set to true, so you want to use .override
<clever> pop: could open an issue against nixos-homepage and let somebody else figure it out
<clever> pop: i cant find any trace of monitor.nixos.org in https://github.com/NixOS/nixos-org-configurations so i'm not sure what happened to it
<clever> shnupta: networking.wireless.enable = true; in the configuration.nix, and there is "nixos-install --chroot" on the installer, where you can then do "nixos-rebuild boot"
<clever> dtzWill: oh, somebody has that exact issue open: https://github.com/NixOS/nix/issues/1245
<clever> there is an issue on github about allowing things like nix-store -qR to run inside builds, and be restricted to a subset of the store
<clever> Tekmo_: but seperating the attributes on the derivation from the .passthru attributes would be tricky
<clever> if i do buildPhase = "${cmake}/bin/cmake}"; it wont be in either buildInput list
<clever> that only gets you part of the inputs
<clever> dtzWill: the runtime closure can be see with i think its called exportReferenceGraph
<clever> miko__: i see a go-ethereum package in nixpkgs
<clever> miko__: and ethereum has already been packaged
<clever> yeah
<clever> everything installed on nixos must be packaged in nix
<clever> miko__: because nixos doesnt have a ld.so in /lib/
<clever> more like this
<clever> attribute merge
<clever> that can go into the override
<clever> this will overwrite just the cuda attribute, and pass the rest on
<clever> python35Packages = pkgs.python35Packages // { libgpuarray-cuda = ... };
<clever> its easy to make this mistake
<clever> so python32Packages is now missing wrapPython
<clever> that replaces the entire python35Packages with just { libgpuarray-cuda = ... };
<clever> thought so
<clever> can you gist them?
<clever> justan0theruser: do you have any overrides in configuration.nix?
<clever> justan0theruser: what does sudo nix-channel --list say?
<clever> thats odd
<clever> and its a dependency of chromium
<clever> justan0theruser: line 19 of speechd/default.nix is trying to call wrapPython, which doesnt exist
<clever> yep
<clever> boomshroom: i have used terminal color codes in nix