2018-07-06

<clever> infinisil: yaml2json is go, but there was a matching binary in haskell at one point
<clever> kitemikaze_: then you can just builtins.readFile + fromJSON
<clever> haskellPackages.yaml.out 26,688 x /nix/store/q99hymykq8858kg37f56gibx5cp9gjj6-yaml-0.8.22/bin/yaml2json
<clever> kitemikaze_: using import-from-derivation, you should be able to call yaml2json
<clever> gchristensen: the last time i tried to use it on nixos, the buttons just had a 0x0 size
<clever> gchristensen: they also delete the old binaries, disable them from connecting to the servers, and make changes that break the nix package with every update
<clever> sagnik: lately, ive only gotten it to work by running windows 10 inside virtualbox, lol

2018-07-05

<clever> cocreature: is the nixos cache in nix.conf?
<clever> cocreature: in your case, curl cache.nixos.org/8kp1k26il5n08bqm3f18nhxm0p8qimjc.narinfo
<clever> cocreature: using the hash from the output (cat the .drv file, its one of the first paths)
<clever> cocreature: curl https://cache.nixos.org/HASH.narinfo
<clever> bpye: /etc/nix/nix.conf still
<clever> bpye: and how cacti has been removing features i used to improve performance
<clever> bpye: my main issues with cacti currently, is that you have to configure what to graph at a central point, while push-based things like DD have that configured on the remote machines
<clever> bpye: but the cacti ui has been getting worse lately, and a push based model is just simpler to use
<clever> bpye: prior to getting into nixos, i used cacti and net-snmp for everything
<clever> bpye: but i have seen his alerts go off a few times
<clever> bpye: i know somebody that uses prometheous heavily, but i havent seen how he configured it
<clever> bpye: the free version also has a fairly low host count
<clever> cocreature: it should be in the binary cache
<clever> bpye: yep
<clever> bpye: and also make sure it can still boot
<clever> bpye: yeah
<clever> worldofpeace: read the wrapper script, manually run the export statements, then run gdb against the -wrapped binary
<clever> bpye: yeah
<clever> bpye: the aws backend handles the hardware stuff automatically, but none requires it to be manually done
<clever> bpye: you have to specify all of that locally
<clever> bpye: yeah, nixops builds the config locally (ignoring the remote configuration.nix), then pushes the finished build over
<clever> bpye: yeah
<clever> bebarker: if nix is ran without root, then it works without build users
<clever> and file a PR when its working good
<clever> and freely modify the copy
<clever> then you can add a copy of it via imports = [ ./zfs.nix ];
<clever> bpye: using disabledModules, you can stop nixos from using the zfs.nix in nixpkgs
<clever> bpye: it may be best to modify zfs.nix to allow a pre and post snapshot comand
<clever> bpye: which is the zfs-auto-snapshot binary in the autosnapPkg, which comes from an overridden zfstools
<clever> bpye: the systemd units are configured to run the command in zfsAutoSnap
<clever> thats 32bit
<clever> > pkgsi686Linux.libredirect
<clever> phry: use the i686 pkgs
<clever> goibhniu: if thats in the set passed to callPackage, then .override can change it
<clever> phry: what does nix-channel --list print?
<clever> samueldr: ah, nice
<clever> you can convert the single-user install into a multi-user one, after its installed
<clever> yeah, its not meant to work as root
<clever> waynr: it has no multi-user mode
<clever> waynr: on debian, you just run the install script as a non-root user to do a single-user install
<clever> nix-shell -p utillinux
<clever> hakujin: its under the utillinux attribute
<clever> and it appears to be a buildenv called utillinux-compat-1003.1-2008, that collects other darwin packages together
<clever> lrwxrwxrwx 1 root root 67 Dec 31 1969 col -> /nix/store/ngw4nhjjwmg516h2v6anhk2012s90jwd-col-1003.1-2008/bin/col
<clever> hakujin: but that variant doesnt contain uuidgen
<clever> nix-build '<nixpkgs>' -A utillinux --argstr system x86_64-darwin
<clever> hakujin: oddly, utillinux can build on darwin
<clever> from `lspci -v`
<clever> Kernel driver in use: e1000e
<clever> 03:00.0 Ethernet controller: Intel Corporation 82583V Gigabit Network Connection
<clever> hyper_ch: nice
<clever> and if the url is already in the cmd, just move it a bit
<clever> you would have to -f '<nixpkgs>' to make it search
<clever> jgt: by default, nix-env will entirely ignore -I and $NIX_PATH
<clever> hyper_ch: i helped somebody debug something a few days ago, where his channel was configured with nginx+nixos, and was hosting a tar directly from the store
<clever> infinisil: and nginx etag's are generated based on the filesize and last-mod timestamp, so nix's timestamp fudging can massively break it
<clever> infinisil: fetchTarball will use the last-modified and etag headers the remote server advertises to cache the reply
<clever> on nixos, it can look under roots channels
<clever> [clever@system76:~]$ echo $NIX_PATH
<clever> nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels
<clever> ah, id call that a bug then
<clever> not nixos?
<clever> Lisanna: the default NIX_PATH points to the dir nix-channel manages

2018-07-04

<clever> joepie91: thats what happens when you let CERN help out with enforcing laws
<clever> tnks: sounds like the problem is at the bash/stdenv layer, not the nix layer
<clever> tnks: and if you run nix-shell on the .drv file instantiate gave?
<clever> i also miss it
<clever> pikajude: tail-reload was removed months ago
<clever> tnks: but you can just `nix-instantiate shell.nix` to test the shell file
<clever> tnks: nix-shell is just a renamed copy of nix-build
<clever> tnks: and there is a nix-build bug that ignores stats, use nix-instantiate to get around it
<clever> tnks: one counts every function call, the other shows total memory usage
<clever> tnks: export NIX_SHOW_STATS=1
<clever> tnks: export NIX_COUNT_CALLS=1
<clever> infinisil: thats a lot more complex, because things on the binary cache can be downloaded without having to build
<clever> 1.1G /nix/store/360zh9xvnqzvzvl567b43960fhgq90dw-go-1.10.3
<clever> 9.5G total
<clever> 449M /nix/store/d7qiksl0hzk4kl43j57f0cxscb7zdls8-chromium-67.0.3396.87
<clever> infinisil: [root@amd-nixos:~]# du --max=0 -hc $(nix-store -qR /run/current-system) | sort -h | tail
<clever> infinisil: one sec
<clever> worldofpeace: nix-store --query --roots
<clever> infinisil: yeah, thats all of the ones i know
<clever> but nix repl also saves all history
<clever> nix repl has messed up tab-completion, and appends a space every time you up-arrow
<clever> but i still like the ui of nix-repl often
<clever> yeah
<clever> `_: `nix-repl` links to nix1, and cant auto-detect $NIX_REMOTE
<clever> bkchr[m]: this script delt with starting pulseaudio and teamspeak without any X11
<clever> bkchr[m]: one min
<clever> infinisil: on the other hand, ive had PR's merged within 15 minutes, then i notice a typo :P
<clever> winem_: you want `nix-store -r /nix/store/foo.drv`

2018-07-03

<clever> ah, if its in another jobset, that gets a bit tricky
<clever> Lisanna: use the test as an input, then the build will fail because a dep cant be built?
<clever> Lisanna: pkgs.releaseTools.aggregate lets you create a new hydra job, that depends on many other jobs
<clever> samueldr: the heavy-fix-all idea i had, is to store every single Value in a hashtable, and check for duplicates at creation, and merge
<clever> Lisanna: one sec
<clever> samueldr: i have a nixops deployment that is currently using 26gig of ram to eval
<clever> Lisanna: this is how hydra fetches each input
<clever> infinisil: file a PR to nixpkgs/lib/!, lol
<clever> checking one more idea...
<clever> or just add what you said above
<clever> infinisil: so you can either abuse the toxml, or somehow call the show function
<clever> > "${ { a, b, ... }: 42 }"
<clever> yeah
<clever> but you can detect if it has a default
<clever> > builtins.functionArgs ({ foo, bar?42 }: 1)
<clever> eren: ~/.nix-profile/share/man for things in your local profile
<clever> pie_: just use bind, its a lot less painful :P
<clever> also open here, and i dont see wmertens being mentioned
<clever> nlytend: --delete-older-than 3d will delete generations from older then 3 days, then the normal GC deletes all garbage, including partial results from a recent nixos-rebuild
<clever> booglewoogle: nix-store --delete, and dont use force if it says its in use
<clever> sphalerite: it shows both of these right on the site
<clever> $ alias nixpaste="curl -F 'text=<-' http://nixpaste.lbr.uno"
<clever> $ <command> | curl -F 'text=<-' http://nixpaste.lbr.uno
<clever> sphalerite: yes
<clever> sphalerite: gist -p or http://nixpaste.lbr.uno/
<clever> pie_: so you have to reconfigure dnsmasq to listen on 127.0.0.1:53
<clever> pie_: you cant bind on 0.0.0.0:53 if something else is already listening on 192.168.2.3:53
<clever> netstat -anp | grep 53
<clever> netstat -anp | grep 53
<clever> dig www.google.com @127.0.0.1
<clever> what happens when you run this?
<clever> dig www.google.com @192.168.1.1
<clever> check ps aux
<clever> is dnsmasq running?
<clever> pie_: double-check the contents of resolv.conf on your machine?
<clever> yeah
<clever> __monty__: networking.nameservers = [ "127.0.0.1" ]; can bypass that
<clever> 2nd, setting resolv.conf to 127.0.0.1, easy
<clever> 1st is reading the dhcp config, and configuring dnsmasq to use the right dns servers (tricky with nix, since its not predictable)
<clever> there are 2 phases
<clever> pie_: it needs a custom dhcp hook to read the dns servers, generate some bind config, and reload bind
<clever> pie_: ive only done similar with bind when i was on gentoo
<clever> thblt: yes, leave it on the old value
<clever> infinisil: it builds it under a different path, remaping things with the sandbox, then does an atomic swap when its done the repair
<clever> or re-fetches it from a binary cache
<clever> it rebuilds the derivation based on the directions in the .drv file
<clever> .drv files cant be repaired
<clever> infinisil: ext3 can loose the contents after an improper shutdown
<clever> avn: nix-store --delete /nix/store/foo.drv
<clever> nope
<clever> you may need to increase the connection count in postgresql then
<clever> ah
<clever> Lisanna: you need to ensure postgres is running
<clever> i only use that to get a copy of the src
<clever> booglewoogle: i dont usually build it from a nix-shell
<clever> and then make an override to add that to patches
<clever> then make a patch with `diff src-orig src -u > foo.patch`
<clever> booglewoogle: then edit the non-orig version, to look for the config elsewhere, maybe obey a $FOO_CONFIG_PATH var
<clever> booglewoogle: then copy the entire directory to src-orig
<clever> booglewoogle: first, i would nix-shell into an env suitable for building the package, and run unpackPhase and patchPhase in the unpacked directory
<clever> booglewoogle: or patched to look for the config in a better location
<clever> booglewoogle: it has to be patched at build time to have the new config
<clever> disasm: look at the shell.nix in iohk-ops, under passthru
<clever> Lisanna: nix-instantiate?
<clever> arahael: i grepped all of nixpkgs, nothing refers to it
<clever> arahael: that is a different project that some people have been working on
<clever> pile*
<clever> nix-darwin is just a pipe of scripts that let you manage some things in a nixos like way
<clever> kernel is also untouched
<clever> the ui is untouched
<clever> it just manages a few files in /etc/ via nix
<clever> arahael: nix-darwin still runs on the darwin kernel and the whole darwin ui
<clever> it looks like valgrind needs fixed, but it appears to actually support darwin
<clever> valgrind: mmap-FIXED(0x0, 253952) failed in UME (load_segment1) with error 12 (Cannot allocate memory).
<clever> Michaels-iMac:~ clever$ /nix/store/38bnaqmk0pihml5js8p5m4vyx4nn0dk4-valgrind-3.13.0/bin/valgrind /nix/store/38bnaqmk0pihml5js8p5m4vyx4nn0dk4-valgrind-3.13.0/bin/valgrind --help
<clever> dont know about those
<clever> Xephyr cannot open host display. Is DISPLAY set?
<clever> x shouldnt work...
<clever> thats strange, $DISPLAY isnt set on my mac
<clever> its already in been built by hydra
<clever> copying path '/nix/store/38bnaqmk0pihml5js8p5m4vyx4nn0dk4-valgrind-3.13.0' from 'https://cache.nixos.org'...
<clever> it claims to build
<clever> at least on linux
<clever> arahael: valgrind does work
<clever> arahael: and this copies the darwin packages from my desktop to my mac
<clever> $ nix-copy-closure --to 192.168.2.167 /nix/store/xw86a7239a95cp6qk6vbjrjdrm594nnq-xorg-server-1.18.4
<clever> /nix/store/xw86a7239a95cp6qk6vbjrjdrm594nnq-xorg-server-1.18.4/bin/Xephyr: Mach-O 64-bit x86_64 executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|PIE>
<clever> $ nix-build '<nixpkgs>' -A xlibs.xorgserver --argstr system x86_64-darwin
<clever> arahael: it may silently exit if the search passes over any unfree packages
<clever> and it uses a different language from nix, it uses guile
<clever> arahael: it lacks all unfree software, so no more oraclejdk or google-chrome
<clever> no need to actually build the jdk
<clever> that should give an error explaining how to enable unfree
<clever> arahael: nix-build '<nixpkgs>' -A oraclejdk
<clever> arahael: if you dont have unfree packages enabled in config.nix, it will silently fail, rather then explaining how to enable them
<clever> nix has its own language
<clever> i think its the unfree exception bug in nix-env
<clever> yeah, thats normal nixpkgs
<clever> yep
<clever> arahael: but when timezones apply, that turns into a few hours before midnight, for people in utc-4 for ex
<clever> arahael: all files are last modified at 12:00:01 jan 1st 1970 (1 second after midnight)
<clever> 0 is treated as an error by some programs
<clever> srhb: its actually unix 1
<clever> yeah, timezones
<clever> a whole year? or a few hours?
<clever> thats what i have
<clever> -r--r--r-- 1 root root 557 Dec 31 1969 /home/clever/.nix-defexpr/channels_root/nixos/default.nix
<clever> ls -l ~/.nix-defexpr/*/*/default.nix
<clever> arahael: does one of the subdirs of channels_root contain a default.nix?
<clever> srhb: yeah
<clever> srhb: nix copy will try to build the .drv, then copy its result
<clever> arahael: what is in ~/.nix-defexpr/ and `echo $NIX_PATH` ?
<clever> ocharles_: yep
<clever> arahael: c++
<clever> ocharles_: nix-copy-closure
<clever> __monty__: nox is a search util that basically does that, with automatic update
<clever> Taneb: this is the same mechanism that gives the names like nixpkgs and nixos when doing nix-env -iA nixpkgs.hello
<clever> Taneb: and it will use whatever nixpkgs you left in that dir
<clever> Taneb: if you create this file, then you can nix-env -iA foo.hello
<clever> [clever@amd-nixos:~]$ cat .nix-defexpr/test/foo/default.nix
<clever> import /home/clever/apps/nixpkgs
<clever> arahael: nix-channel --list
<clever> arahael: oh and the nix command is new and lacks man pages
<clever> arahael: the manpages are in ~/.nix-profile/share/man/ and the man from your distro doesnt look there
<clever> arahael: your MANPATH has to be updated
<clever> that command is more about finding a package that contains a given file, then searching by package name
<clever> arahael: there is also this bot on irc
<clever> ,locate bin/firefox
<clever> nix-env has some magic flags for that, cant remember the exact ones
<clever> s/can/scan/
<clever> arahael: in nixos, its done via /run/current-system mostly, which replaces /bin and /lib for example
<clever> angerman: if you try to ++ yourself, the bot will take away a point
<clever> :D
<clever> it works best under the linux kernel, but can also function on darwin, and it can generate results that are usable on more platforms
<clever> you must untar nix from ubuntu, then rename things
<clever> so you have no way to just install a nix based os
<clever> arahael: you also have no way to manage a 2nd rootfs within a given user
<clever> arahael: so the only way to install a custom WSL distro is to untar it inside ubuntu, then use atomic move's from explorer to swap the rootfs
<clever> arahael: one WSL problem ive heard, is that the files in the rootfs have to be tagged with a special attribute, which windows explorer cant copy when copying files
<clever> :D
<clever> no need for any cross-compile fun
<clever> arahael: this command will build the darwin version of hello, using darwin build slaves
<clever> nix-build '<nixpkgs>' -A hello --argstr system x86_64-darwin
<clever> there is also qemu-user, which can run linux binaries for the "wrong" arch
<clever> arahael: an example of just building haskell without cabal: https://github.com/cleverca22/arcstats/blob/master/default.nix#L3-L13
<clever> arahael: angerman has mainly done cross-compiling of haskell to ios
<clever> arahael: angerman would know more about ios targeting
<clever> arahael: aarch64
<clever> nix-build '<nixpkgs>' --arg crossSystem '(import <nixpkgs/lib>).systems.examples.aarch64-multiplatform' -A hello
<clever> arahael: this cross-compiles to a raspberry pi
<clever> 2018-05-09 20:23:00<@clever> (import <nixpkgs> { crossSystem = (import <nixpkgs/lib>).systems.examples.raspberryPi; }).linuxPackages_rpi.kernel
<clever> so darwin could make linux binaries
<clever> arahael: this should cross-compile to 64bit linux, when ran on any machine
<clever> nix-build -E '(import <nixpkgs> { crossSystem = { arch = "x86_64"; config = "x86_64-unknown-linux-gnu"; }; }).hello' --keep-going -Q
<clever> arahael: yes

2018-07-02

<clever> aminechikhaoui: but you still need enough free to complete max-jobs in parallel
<clever> aminechikhaoui: oh, min-free also lets you go a lot lower, because it will auto-gc at the start of any action on the store, so you dont need to keep enough free to survive the next 24 hours
<clever> LnL: it has also caused builds to fail randomly, by deleting something thats in use by a building derivation
<clever> LnL: import-from-derivation sometimes triggers a GC and eats stuff the build needs, but hasnt computed the path to yet
<clever> LnL: i have them enabled on 2 or 3 of my machines
<clever> but it has some bugs involving gcroots and sometimes breaks builds
<clever> that triggers a gc with 3gig free, and aims to get 6gig free
<clever> max-free = 6442450944
<clever> min-free = 3221225472
<clever> aminechikhaoui: but the new min-free and max-free in nix.conf work better, doing a larger gc less often, rather then a small gc every day at the same time
<clever> aminechikhaoui: the goal is to get 128gig free, and keep anything that remains, so it can still act as a cache
<clever> and i keep that in a git repo of nixos configs, so all hosts automatically known all other host keys, from the first install
<clever> i like programs.ssh.knownHosts, because it eliminates the risk of a mitm on the 1st connection
<clever> aminechikhaoui: or use programs.ssh.knownHosts in configuration.nix to configure the known_hosts globally
<clever> aminechikhaoui: yep, `sudo -u hydra-queue-runner -i`
<clever> aminechikhaoui: which user did you run ssh as?
<clever> tilpner: that example didnt say where nur is coming from
<clever> imports = [ nur.repos.mic92.modules.transocks ];
<clever> tilpner: so the imports cant reference pkgs
<clever> tilpner: the value of pkgs depends on the value of imports
<clever> booglewoogle: try adding pkgconfig to the buildInputs
<clever> the gcc6Stdenv is missing for some reason, but its trivial enough to just make it on the fly
<clever> yep
<clever> ij^: nix-shell -E 'with import <nixpkgs> {}; (overrideCC gccStdenv gcc6).mkDerivation { name = "name"; buildInputs = []; }' i think
<clever> 6209 gcc7Stdenv = overrideCC gccStdenv gcc7;
<clever> 6210 gcc8Stdenv = overrideCC gccStdenv gcc8;
<clever> ij^: it may help to look at how gcc7Stdenv is defined
<clever> ij^: nix-shell uses stdenv.mkDerivation, which provides a gcc
<clever> theo: everything you put into imports is a nixos module
<clever> theo: add it to the imports list in configuration.nix
<clever> theo: overlays cant set nixos options, only make changes to packages in nixpkgs
<clever> Lisanna: you could overwrite vmTools with super.vmTools // { more attrs };