2018-10-20

<clever> but that path is winding up in the docs, causing your error
<clever> Unode: it should be the path
<clever> then the manual can correctly render what the default is
<clever> so you need to also defaultText = ''pkgs.writeText "CA.cnf" ...'';
<clever> which is both useless, and causes the manual to depend on things it shouldnt
<clever> default = pkgs.writeText "CA.cnf" ...; causes the documentation to just say default = /nix/store/foo-CA.cnf
<clever> so the manual can show the expression, rather then the storepath
<clever> Unode: you must also set defaultText to a string, containing the same expression
<clever> Unode: also, if your default value ever contains a storepath, you must do something special
<clever> Unode: need to use pkgs.writeText (or writeTextFile) when the string has deps
<clever> and anoyingly, nix-env tells you to install it for all of those utils
<clever> wpcarro: busybox includes duplicates for a large number of util, that behave in slightly different ways
<clever> srid: try removing one of those then
<clever> srid: depends on exactly how they differ, can you paste a single line of the conflict?
<clever> srid: you might have 2 copies of git in your systemPackages
<clever> wpcarro: ive just been ignoring those
<clever> wpcarro: yeah
<clever> wpcarro: remove that, it will cause a large number of problems
<clever> wpcarro: do you have busybox in your systemPackages?
<clever> wpcarro: what is one of the things colliding?
<clever> wpcarro: depends on what is colliding
<clever> __monty__: but toxvpn only routes the IP's peers have, and it wont break the whole range
<clever> __monty__: in the case of hamachi, it routed the entire 5.x.y.z to the vpn, and broke the whole IP block
<clever> about 4 years ago, it ceased being reserved, random sites got IP's in that block, and they just never loaded for me
<clever> so the IP's where technically public, but unused
<clever> __monty__: the hamachi VPN was originally using the 5.x.y.z range, because that was under some special reserved (do not use) area on the internet
<clever> yeah
<clever> and you also have the entire 10.x.y.z space
<clever> so its not likely to cause issues
<clever> and usually, your only needing the router, which is generally x.y.z.1
<clever> it will force .123.64 to use the VPN variant of that ip, and ignore whatever the cafe had there
<clever> if you ever wind up in an internet cafe that is using 192.168.123, then the vpn will only cause problems when refering to 192.168.123.64, and the rest of the cafe machines will work as-normal
<clever> .123 is high enough up there that it has a low chance of conflicting
<clever> 192.168.0 .1 and .2 are commonly used for home routers
<clever> 192.168.0.0/16, 10.0.0.0/8 and 172.16.0.0/12 are the 3 official "private" networks, that will never be used on the web
<clever> thats a tricky part
<clever> other then that, you can choose whatever you want
<clever> and its best to be on a different subnet from any LAN you will be in
<clever> it must not match the LAN ip
<clever> yeah, you still need dyndns for that
<clever> yeah, you can just ignore dyndns
<clever> yeah
<clever> thats just how ipv4 and NAT works
<clever> srid: and that will allow traffic back into the thinkpad, on the router ip
<clever> srid: when the thinkpad connects out on udp, the router dynamicaly sets up a reverse route for the udp replies
<clever> it will use the intermediary nodes to discover the ip of the house, then connect directly to it
<clever> srid: it will auto-discover the public ip of the other machine, and connect to it, even if you dont forward ports
<clever> srid: it uses some bootstrap nodes to connect to a DHT, where it will then discover the other node's public ip, and then uses udp hole punching to form a connection
<clever> srid: https://github.com/cleverca22/nixos-configs/blob/master/deployments/netbooks.nix#L18 each machine needs a localip configured, and .enable = true; set, then run `toxvpn-remote` on each, and use `help`, `status`, and `add` to form links between nodes
<clever> srid: toxvpn would also be an option, then you have a fixed ip for both situations
<clever> srid: if you try to connect to 22 of the public ip, from within the network, some routers (including nixos NAT) wont forward it back into the lan
<clever> srid: ah, another thing to be aware of, port forwarding often doesnt work when your inside the same network
<clever> srid: ah, my home IP is stable enough that i just port-forward once and just setup a fairly static dns
<clever> srid: are the client and server on the same network?
<clever> srid: nixos also allows 22 thru the firewall automatically
<clever> srid: run tcpdump against the given interface, filtered to port 22, then try to ssh into it
<clever> srid: dmesg and journalctl
<clever> does it still fail with the new file in the above gist?
<clever> this is my final expression, and it builds even faster when you enable parallism
<clever> the nix sandbox can prevent that, on every os
<clever> that causes things to work for you on ubuntu, and then fail for all nixos users
<clever> its searching your host include dirs
<clever> clacke[m]: aha, the package is being VERY naughty!
<clever> g++ -DHAVE_CONFIG_H -I. -I./include -I/include/boost-0 -g -O2 -c -o examples/test-register-route.o examples/test-register-route.cpp
<clever> adding protobuf got it further, to a zlib error
<clever> i got your link errors, and just above it, by about 20 lines, was the #error about protobuf
<clever> with protobuf in the inputs, it now fails to find libz
<clever> /nix/store/dxf1m7dhc4qb655bdljc1fsd74v1nag3-binutils-2.30/bin/ld: cannot find -lz
<clever> its giving a #error about protobuf, and its also failing to link to protobuf related symbols
<clever> try adding protobuf to the inputs
<clever> clacke[m]: the symbols in the error are heavily protobuf related
<clever> #error Protobuf is installed but protoc didn't run. Try again to ./configure && make clean && make
<clever> i think its just the order of -l and -L flags
<clever> i dont think it has anything to do with your gcc version
<clever> can you also post the .nix file your using?
<clever> clacke[m]: /usr/bin/g++ will search /usr/lib/ and then find things it shouldnt be using, and make things "work for you"
<clever> clacke[m]: can you post the nix file and error in a gist?
<clever> gchristensen: i might be thinking of https://github.com/NixOS/nixops/pull/958 instead
<clever> gchristensen: i think rvl has a PR open for that
<clever> srhb: :D
<clever> aleph-: https://nixos.org/nixos/options.html#systemd.services.%3Cname%3E.envi
<clever> aleph-: systemd.services.<name>.environment
<clever> aleph-: you would configure the DATABASE_URL within the systemd service
<clever> you can add it to the imports list in your configuration.nix, and then nixos-rebuild will build your thing, and the service, and start it
<clever> thats a very very basic service, that just runs a binary on bootup, with a given config file
<clever> aleph-: definitely sounds like you need a systemd service
<clever> you may need a nixos module, and a systemd service
<clever> and note, that it will only have +w to $out, and wont have any access to DB's
<clever> aleph-: then just run it after you chmod +x it
<clever> aleph-: does it need to be executed at build-time or runtime?
<clever> so it hides such mistakes when in a console
<clever> bash also cheats, and will run itself on anything that looks like a shell script but technically isnt working
<clever> aleph-: /bin/bash doesnt exist on nixos, you want #!${stdenv.shell}
<clever> aleph-: src = ./.; is doing the exact same thing
<clever> aleph-: if you do ${./db.sh}, then nix will dynamically copy those into /nix/store/ and insert the new storepath
<clever> aleph-: also, you want to indent that entire heredoc, to match the nearby lines
<clever> aleph-: the spaces around the = make it a command, not a variable assignment
<clever> aleph-: the 2 args being '=' and the expansion of '$out/bin/install.sh'
<clever> aleph-: you also dont have to set the system attribute, thats likely to cause issues down the road
<clever> aleph-: you are running the command binary, with 2 args
<clever> binary = $out/bin/install.sh
<clever> aleph-: what if its "binary" that is not found?
<clever> dev*
<clever> hyper_ch: there is a def i know, that only ever uses `git add --all`, i have seen him commit lock files to the repo, luckily, the code uses flock and doesnt care
<clever> holy crap
<clever> 1.2G /nix/var/log/nix/
<clever> Unode: not planning on that
<clever> dhess: i'm on my way to nixcon next week
<clever> jtojnar: you could use gcc.cc, rather then gcc, as your compiler
<clever> bpye: a lot like deploying nixops from a mac machine
<clever> bpye: it will need build slaves of the right arch to perform those steps
<clever> bpye: you just need to set the right nixpkgs.system.localSystem param for each machine
<clever> bpye: yes
<clever> jtojnar: i believe cc-wrapper sets some rpath flags when calling the real gcc
<clever> that is the bare minimum grub needs to mount the real /boot
<clever> hyper_ch: in your exact case, it would contain the grub kernel, the zfs drivers for grub, and maybe the luks drivers
<clever> it has no fs, cant be mounted, cant be formatted, and just holds raw x86 assembly code
<clever> so you now need a dedicated partition for that, called the bios boot partition
<clever> and they decided to ban using "unused" space :P
<clever> GPT uses more then 1 sector for its partition table, so that same range is now unsafe to use
<clever> when booting on MBR, grub will shove stage 1.5 between sector 1 and partition 1, in the "unused" space
<clever> hyper_ch: it serves the same purpose as the ESP
<clever> hyper_ch: bios boot only needs <1mb
<clever> hyper_ch: it can also be used as a bios boot partition for legacy booting
<clever> ahh
<clever> and that causes zfs to mess with performance controls of the entire sda
<clever> also of note, if you let zfs paritition the disk like that, it sets a magic "whole disk" flag that cant normally be set
<clever> i'm not entirely sure what zfs intends for that reserved partition, but if it works, it works, lol
<clever> lol
<clever> hyper_ch: and fdisk -l /dev/sda ?
<clever> :O
<clever> and the remote console only works under 7
<clever> the remote cdrom part only works under xp
<clever> yes
<clever> dhess: it could be worse, ive had to install both windows xp and 7, just to get a mess of activex applets to work
<clever> dhess: ah, that would imply that the entire machine is locking up upon kexec
<clever> dhess: thats why ive got the autoreboot flag, so you can retry without needing any special console
<clever> ah
<clever> hyper_ch: then boot.initrd.availableKernelModules and it will auto-load if the card is still present
<clever> hyper_ch: after booting with kexec, check `lspci -vvv` it will tell you which driver owns each device
<clever> dhess: yep
<clever> Unode: services.nixosManual.enable
<clever> somebody that runs one has to tell you about its url and public key
<clever> i dont think so
<clever> its an opt-in thing
<clever> drakonis1: you build your packages on something like travis, using normal nix-build, and then push it to cachix, and then you (and others) can use that as a binary cache
<clever> emily: depends mostly on what hydra has and hasnt built
<clever> if you switch to the nixos-unstable-small channel, you can get it early, at the cost of having to compile a few more things
<clever> hydra is waiting for all of nixpkgs to build before updating nixos-unstable
<clever> only nixos-unstable-small has 3.6.0
<clever> and nixpkgs-unstable too
<clever> drakonis1: the same is true for the latest commit of nixos-unstable!
<clever> drakonis1: for the commit you have on root, gzdoom is at version 3.5.1
<clever> > gzdoom.meta.position
<clever> home-manager shouldnt have any impact on nix-build
<clever> now what does `nix-build '<nixpkgs>' -A gzdoom` and `nix-instantiate --find-file nixpkgs` report?
<clever> but --update wont run if you have zero channels to update
<clever> i think the bug is that you need to --update to make it notice the removable of any channel
<clever> that also works
<clever> if you `rm /nix/var/nix/profiles/per-user/drakonis/channels*` then the problem will go away, as will any ability to do rollbacks for the non-root channels
<clever> drakonis1: what does `ls -lh /home/drakonis/.nix-defexpr/channels` report?
<clever> drakonis1: it sounds like you previously added a channel to your user, then deleted it, and nix-channel is glitching a bit and wont let you remove it
<clever> drakonis1: realpath /home/drakonis/.nix-defexpr/channels/nixpkgs
<clever> try doing `nix-channel --update` as your user, then do `nix-instantiate --find-file nixpkgs` again
<clever> what does nix-channel --list report for your user?
<clever> check the file and line it mentions
<clever> drakonis1: then you have another older channel on your user, which should be in nix-channel --list
<clever> and `nix-instantiate --find-file nixpkgs` ?
<clever> what does `nix-build '<nixpkgs>' -A doom` output? (attr may not be right)
<clever> dont use home-manager myself
<clever> what commit is leading you to think its 18.09?
<clever> yeah, thats a recent unstable
<clever> drakonis1: ls -l /root/.nix-defexpr/channels/nixos
<clever> drakonis1: nix-channel --list, as root
<clever> infinisil: current template haskell is capable of launching missles at compile time, do you 100% trust all code your compiling (not running, just compiling), http://hackage.haskell.org/package/acme-missiles-0.3/docs/Acme-Missiles.html
<clever> a variant that lacks IO, cant have side effects, so its perfectly safe to run in different contexts, because its now pure
<clever> but because you have it, there is no safe way for the compiler to know if running it on the wrong platform will have side-effects
<clever> infinisil: 90% of the time, your TH doesnt need IO
<clever> infinisil: i want to be able to run template haskell on the "wrong" platform, to make cross-compile simpler
<clever> infinisil: i at least want a Q monad that lacks IO
<clever> :D
<clever> lol
<clever> exactly, i learned that trick from domen
<clever> explain that! :D
<clever> > a: b
<clever> > a:b
<clever> samueldr: have fun patching every cabal2nix output if you want to convert - to _
<clever> > haskellPackages.js-jquery

2018-10-19

<clever> no, it will download a tarball of the channel, and ignore git entirely
<clever> dmj`: that is a limitation of the git protocol, you must know which branch the commit is in, try adding ref = "master";
<clever> this has nothing to do with nix-channel
<clever> dmj`: the problem is with the git internals, you must have common commits to fetch
<clever> you may need to wipe ~/.cache/nix/git/
<clever> the problem is more likely that something else you fetched in the past, with fetchGit, is incompatible
<clever> dmj`: the cache is held in ~/.cache/nix/git/
<clever> that typically happens if you try to fetch from 2 entirely different repos
<clever> so it cant compute the differences for a fetch
<clever> the problem is that the branches you have in your local cache dont share any common commits with the remote git repo
<clever> fetchTarball fetches the state at that rev, so it has less to download
<clever> fetchGit will clone the repo, including the full history, and the cache you have is breaking things
<clever> it would probably be faster to use fetchTarball
<clever> dmj`: what are the exact args you gave it?
<clever> for haskell, you want overrideCabal
<clever> dmj`: yeah, overrideAttrs is better, when not dealing with haskell
<clever> at start,up, it will run /etc/runit/1, 3 is for shutdown, i think 2 was for when it finishes booting?, and then the run's under /etc/service/name/run are services it keeps running
<clever> catern: runit may be of interest to you then
<clever> catern: what kind of container is it?
<clever> catern: what stops you from running nscd in the container?
<clever> Ericson2314: and config can also be used here, to default other options to eachother, or what you specified, after merging
<clever> Ericson2314: the attr you used, becomes the name on line 28, which 62 then uses as the default mountPoint
<clever> if you try to assign fileSystems."/", it will act more like you had assigned fileSystems = [ { name = "/"; } ];
<clever> Ericson2314: internally, fileSystems is a list based option
<clever> Ericson2314: one sec
<clever> and the map is within boot.initrd
<clever> Ericson2314: this for examples defines some submodule options within fileSystems, then it just maps over a the result of running filter on all fileSystems
<clever> Ericson2314: i think what you do is mapAttr or attrsOf over the entire config, outside of the submodule, when assigning other config (like systemd services)
<clever> nkaretnikov: the .env attribute is rather basic
<clever> catern: basic dns and /etc/hosts still work without nscd, you just loose advanced things like avahi
<clever> you will want to do `lib.overrideDerivation drv.env (old: { buildInputs = old.buildInputs ++ [ portaudio ]; })` in the area between `then` and `else`
<clever> nkaretnikov: the .env at the very end accesses the env for building haskell packages, which ignores most things you pass to mkDerivation
<clever> nkaretnikov: yeah, that would help
<clever> nkaretnikov: what else is in that file?
<clever> and what are the contents of shell.nix?
<clever> nkaretnikov: what nix-shell command are you running?
<clever> nkaretnikov: every attribute on the derivation is automatically made into an env var
<clever> an old a somebody else made
<clever> > a
<clever> > { a = 5; b = a; }
<clever> > rec { a = 5; b = a; }
<clever> nkaretnikov: you want rec there
<clever> electrocat: the bigger question, is how many evals back you want to cache things, and how you garbage collect
<clever> electrocat: ive heard that a single full build of nixpkgs is about 80gig
<clever> if you do `nixops deploy --build-only` and have never created, then it will just not set things like publicIPv4, and they will default to null
<clever> and then does a nix-build to build the machines
<clever> then it creates all of those resources, and generates a nix file with the state
<clever> python then parses that xml, to find the names and cloud-hosters of every vm, and what resources must exist
<clever> it does a first nix-instantiate pass over things, with --to-xml
<clever> behind the scenes, nixops generates an extra deployment file with that kind of state, and adds it to the nix eval
<clever> arianvp: this will generate nixos config, based on python variables
<clever> maxJobs is at the `nix-build -j5` layer, and will run up to 5 packages in parallel
<clever> o1lo01ol1o: it will run `make -j72` inside each build, and it will depend on the deptree within a given package, and if the package even has enableParallelBuilding = true;
<clever> if the vm hasnt been created, the param will be null
<clever> when deploying, it will create the vm, query its state, then build the nixos with that ip as a param
<clever> arianvp: nixops will get the IP from the vm system, before it builds the modules
<clever> arianvp: yeah, i think it was networking.publicipv4 or something like that
<clever> electrocat: only aarch64 has binary cache coverage
<clever> nope
<clever> Lisanna: declare what the output hash is and it will do that
<clever> everything is stored in a single amazon S3 bucket, several terrabytes
<clever> `nix-env -f https://nixos.org/channels/nixos-18.03/nixexprs.tar.xz -iA pandoc` will install the verison from the 18.03 channel
<clever> the old version was removed from nixpkgs, so you will need to either choose an older version of nixpkgs, or use an override
<clever> the problem might be that -i is picking the wrong package, but its also very likely that hydra is not pre-building 32bit as well
<clever> which version does it start building?
<clever> try nix-env -iA nixpkgs.pandoc
<clever> fiatjaf: how exactly did the build fail?
<clever> fiatjaf: yeah, you can just run nix-env -i on that path if you want to
<clever> fiatjaf: it looks like it was removed from the release.nix, so hydra isnt building it anymore
<clever> This job is not a member of the latest evaluation of its jobset. This means it was removed or had an evaluation error.
<clever> oldandwise: oh yeah, every contributor will have his own fork, where he makes some changes, and then files a PR
<clever> oldandwise: no need to fork nixpkgs, if you properly use the nix expressions (rather then using the nix-env cmd fiatjaf gave), it will detect what arch its being ran on, and build for that arch (or download a prebuilt one)
<clever> oldandwise: so it will just blindly download the exact build you gave it (a 64bit build) which will then fail to start
<clever> oldandwise: the hash in that path is a hash over the build instructions, which includes the arch
<clever> oldandwise: yep, downloading things from the cache
<clever> without flags, it will only collect the unused things
<clever> fiatjaf: you can regain some of the space it doesnt really need by running nix-collect-garbage
<clever> fiatjaf: then youll want to use the above gist to create a mostly matching profile, that is 32bit (it will default to the same arch as the host nix-env was compiled for)
<clever> creating the derivation itself from nix is a bit more tricky
<clever> you could also use nix-copy-closure to copy the current profile to another machine, and then run `nix-env --set -i /nix/store/thatpath` to overwrite your current profile with the copy
<clever> fiatjaf: what is your end goal?
<clever> corepkgs/buildenv.nix was a c++ binary at one time, but now its become a builtin function of nix itself, so it just runs this function in the context of a build sandbox: https://github.com/NixOS/nix/blob/6924bdf2bf8f50f2e6ec5d490571594450aba13a/src/libstore/builtins/buildenv.cc#L149
<clever> which is used to build a new version of the profile
<clever> fiatjaf: behind the scenes, nix will read ~/.nix-profile/manifest.nix, mutate it (based on your -e, -i and -r flags), then pass the mutated version to https://github.com/NixOS/nix/blob/master/corepkgs/buildenv.nix
<clever> fiatjaf: yeah
<clever> deployment.gce.rootDiskSize

2018-10-18

<clever> `curl https://gist.github.com/tbenst/0e2c7bd0219eda87e3915182071f224b/raw -v` confirms that, 301 redirect
<clever> your curl command didnt work right
<clever> that file is 0 bytes in size
<clever> tbenst: ls -lh ~/.config/nixpkgs/overlays/tb.nix
<clever> tbenst: what is the exact command you ran?
<clever> tbenst: does the error give a line number?
<clever> yeah, we could update it
<clever> the faq also lacks a script that saves you from having to remember the magic incantation of `nix-env -iA userPackages -f '<nixpkgs>'`
<clever> colemickens: the faq is using buildEnv to merge things into a single package, and then `nix-env -q` only shows "user-packages"
<clever> colemickens: in the case of that gist, you are telling nix-env to install an attrset, so it will just install every attr of the set, and all will appear in `nix-env -q`