2020-03-11

<clever> and then either --update or --upgrade
<clever> (as root)
<clever> tomturbo: you must run `--add` and overwrite the nixos channel with a newer nixos
<clever> tomturbo: `nixos-rebuild --upgrade` runs `nix-channel --update` for you, so that wouldnt help
<clever> tomturbo: --list as root
<clever> tomturbo: which channel are you on?
<clever> lovesegfault: ive been doing basically the same end-goal on my local hydra
<clever> DigitalKiwi: i use plain xterm, it doesnt auto-detect urls, i just select and paste
<clever> DigitalKiwi: ah yeah, the terminal is also a major factor there
<clever> DigitalKiwi: id blame that on the parser in vim not parsing the same way as nix
<clever> lovesegfault: just use builtins.toJSON
<clever> lovesegfault: all yaml parsers accept json as well
<clever> fooker: and this would create one file (thats basically just writeFile)
<clever> runCommand "name" { foo = "bar"; passAsFile = [ "foo" ]; } "mkdir $out ; cp $fooPath $out/foo"
<clever> fooker: if you do `foo = "bar"; passAsFile = [ "foo" ];` then youll get a $fooPath instead of a $foo at build time, which saves you all the escaping nightmares
<clever> fooker: either buildEnv a few writeFile's together, or just use runCommand and maybe passAsFile
<clever> jluttine: only real effect is if you start having weird stuff like maybe a ? or spaces in the url, otherwise they are the same
<clever> jluttine: id prefer to have it quoted
<clever> :D
<clever> lovesegfault: then nix can generate the script for you
<clever> lovesegfault: i also like using pkgs.writeShellScript, then doing `nix-build && ./result`
<clever> git will keep the symlink intact, and the file wont exist on the remote end
<clever> to make it cease to be a symlink
<clever> you may need to `nix-build -o foo.yaml.temp && cat foo.yaml.temp > foo.yaml`
<clever> lovesegfault: make an expression using writeTextFile, and nix-build -o foo.yaml
<clever> lovesegfault: the only place nix can write, is the store, but nix-build can produce symlinks to that result
<clever> lovesegfault: builtins.trace?
<clever> danderson: not easily
<clever> yep, thats the one
<clever> danderson: check the example value in https://nixos.org/nixos/options.html#vdpau
<clever> danderson: and its typically done by proper options, adding it to systemPackages wont work fully
<clever> danderson: that will have to be done in configuration.nix
<clever> danderson: `nix search` is the new replacement, that does include caching
<clever> pie_[bnc]: build-tools is exactly what my example was setting
<clever> ../cardano-db-sync/nix/haskell.nix: build-tools = [ postgresql ];
<clever> just do foo = [ bar ];
<clever> pie_[bnc]: lists in the module framework usually append automatically
<clever> pie_[bnc]: lib.mkForce will work as normal
<clever> pie_[bnc]: the preCheck stuff i linked earlier, is using the module system to override things
<clever> kolby_: line 1027 of the file i linked, if $makefile is set, it will do `make -f $makefile`
<clever> kolby_: `dontConfigure = true;` is enough to make it ignore the configure script
<clever> kolby_: try `dontConfigure = true; makefile = "Makefile.libretro";` first, and see what happens
<clever> kolby_: 1020 does bash magic to compute the right value, make sure its a bash var and not a nix var
<clever> kolby_: or line 1020 from what i linked
<clever> kolby_: dontConfigure = true; makefile = "Makefile.libretro"; ?
<clever> kolby_: and you can use `makeFlags = [ "foo" ];` to add extra flags to make
<clever> kolby_: nix will do that by default
<clever> kolby_: you either want to set vars to make buildPhase() do what you want, or copy line 1020 to your custom buildPhase
<clever> kolby_: what is wrong with the default buildPhase ?
<clever> kolby_: if that variable is empty, you wind up doing `make -j` which tells make to spin up infinite jobs
<clever> kolby_: each nix job, will spin up its own $NIX_BUILD_CORES jobs, so if you `nix-build -j 5`, it will be up to 5 seperate derivations, each doing make -j $NIX_BUILD_CORES
<clever> kolby_: that sounds fine
<clever> cole-h: and that change will result in you needing to re-compile glibc and gcc from scratch
<clever> cole-h: only using an overlay
<clever> pie_[bnc]: to me, that says that qtah isnt in the cabal.project file, and/or the hackage snapshot
<clever> ah, that issue title would explain things
<clever> the library gets built, the executables get built seperately, each test gets built in one drv, then ran in a 2nd
<clever> pie_[bnc]: if a .cabal file defines a library, 3 executeables, and 4 tests, it will turn into 1+3+(4*2) derivations
<clever> pie_[bnc]: derivation per component
<clever> pie_[bnc]: nix-instantiate the drv before and after adding qt, then run nix-diff, what did adding qt change?
<clever> cole-h: yeah, it depends on what has changed in master recently, and how long its been like that
<clever> cole-h: the channels only update after hydra has finished building everything
<clever> cole-h: master hasnt been built by hydra yet
<clever> cole-h: are you getting that nixpkgs from a channel?
<clever> cole-h: to check if /nix/store/hash-name is in the cache, `curl https://cache.nixos.org/hash.narinfo`
<clever> pie_[bnc]: yeah, this is what builtins.derivation automates, generating the right $out
<clever> Church-: you can temporarily edit /etc/resolv.conf to fix dns problems
<clever> rename it to bb-clean-plan-to-nix-pkgs.drv, i mean
<clever> and youll also need to fix the $out path in the drv, to match the hash of the contents, but the error is telling you the right answer
<clever> rename it to bb-clean-plan-to-nix-pkgs
<clever> pie_[bnc]: the name value within the drv, must match the name of the drv
<clever> and drv files must have deps
<clever> ah, yeah, add-fixed cant have deps
<clever> pie_[bnc]: did the --add-fixed trick work?
<clever> but your better off moving the cabal.project to the root, so all paths go down
<clever> pie_[bnc]: to force nix to copy the root dir, and then reference the non-root path, maybe
<clever> pie_[bnc]: then you need `src = "${../.}/non-root";`
<clever> pie_[bnc]: are they going up or down?
<clever> pie_[bnc]: after you strip the hash off the drv file
<clever> pie_[bnc]: try `nix-store --add-fixed sha256 foo.drv`
<clever> pie_[bnc]: all drv files are named after a hash of their contents, there might be a way to add the drv back into the store, but i dont know it off-hand
<clever> pie_[bnc]: isnt really possible
<clever> pie_[bnc]: haskell.nix will find the file on its own, in src
<clever> pie_[bnc]: i think you dont want to set cabalProject at all: https://github.com/input-output-hk/cardano-db-sync/blob/master/nix/haskell.nix#L46-L47
<clever> bb.cabal is not a cabalProject file
<clever> cabalProject = pkgs.lib.traceVal (builtins.readFile "${src}/cabal/bb.cabal");
<clever> pie_[bnc]: its cabal itself that prints the errors you saw, because your `foo.cabal` got renamed into a `cabal.project`
<clever> pie_[bnc]: and then line 24 just runs plain old `cabal v2-configure` to parse it, and compute what should be built
<clever> pie_[bnc]: ok, so line 12 will copy your cabal.project file into the current directory, and forcibly rename it to cabal.project
<clever> pie_[bnc]: https://github.com/NixOS/nix/blob/master/src/libexpr/primops.cc#L104 is the last problem you ran into
<clever> 2020-03-11 00:52:23 < clever> pie_[bnc]: `nix-store --query --binding buildCommand /nix/store/h5gckaa03p228ddmx21wl11d3220cq54-bb-clean-plan-to-nix-pkgs.drv`
<clever> pie_[bnc]: what did the --query --binding print?
<clever> pie_[bnc]: only if the drv is in the nix store, will import treat it specially
<clever> lol
<clever> pie_[bnc]: `nix-store --query --binding buildCommand /nix/store/h5gckaa03p228ddmx21wl11d3220cq54-bb-clean-plan-to-nix-pkgs.drv`
<clever> pie_[bnc]: now we have confirmed which drv is to blame, what does `nix show-derivation` say about it?
<clever> cole-h: i dont think so
<clever> pie_[bnc]: from `man nix-store`
<clever> nix-store {--read-log | -l} paths...
<clever> pie_[bnc]: `nix-store -l /nix/store/foo` will show the logs for when foo was built
<clever> pie_[bnc]: nix may have been building things in parallel, and mixed output from many .drv's up
<clever> pie_[bnc]: first, try running `nix-store -l` on each .drv file, which one did the warnings?
<clever> pie_[bnc]: when cabal tried to fight stack
<clever> pie_[bnc]: check the one in cardano-db-sync, linked above
<clever> pie_[bnc]: the cabal.project should name several subdirs in the project, each one should have a .cabal file in it
<clever> pie_[bnc]: your giving it the wrong file
<clever> pie_[bnc]: thats not a cabal.project file, thats a whatever.cabal file
<clever> then how do you know its failing?
<clever> what error?
<clever> pie_[bnc]: you could use a preUnpack hook, to `set -x` reasonably early on
<clever> pie_[bnc]: this changes the preCheck hook, to start postgresql up before the checks run
<clever> maybe
<clever> let me grab an example
<clever> haskell.nix does have phase overrides
<clever> pie_[bnc]: about all you can really do is read `nix show-derivation`, and then manually call `builtins.derivation` with the same values, using ${/nix/store/foo` where possible to maintain context
<clever> pie_[bnc]: then manually run each phase the .drv would have ran
<clever> pie_[bnc]: you can run nix-shell on a .drv file, to get that env loaded
<clever> pie_[bnc]: ah, thats the same kind of digging ive been doing, to fix all of the IFD stuff
<clever> pie_[bnc]: why cant you import the original nix expr?
<clever> pie_[bnc]: note, that all functions like .overrideAttrs are lost
<clever> pie_[bnc]: run import on the path to the drv
<clever> gchristensen: something else that surprised me early on, is how none and ec2 handle ssh keys in vastly different ways
<clever> adisbladis: that just leaves stateVersion then
<clever> adisbladis: second, the auto-created private keys
<clever> adisbladis: first, nixops will query the stateVersion, and remember it in the state file
<clever> adisbladis: i can see 2 features that would break when doing that...

2020-03-10

<clever> ,tell johnw that might be a bug with --verify not obeying ?root=/path
<clever> ah
<clever> Henson: ?
<clever> Henson: what value did you assign to it?
<clever> Henson: yeah, what are you setting it to exactly?
<clever> ashkitten: systemd also has its own isolation that can do similar, without needing full containers
<clever> ashkitten: none that i know of, but you could search github
<clever> ashkitten: currently, the nixos containers dont support that
<clever> selfsymmetric-mu: yeah, thats definitely the kernel, can you gist the entire configuration.nix file?
<clever> selfsymmetric-mu: what derivation is it building often during updates?
<clever> thats not a patch, but it may need you to build just exfat-nofuse
<clever> selfsymmetric-mu: do you have any kernel patches set?
<clever> selfsymmetric-mu: what exactly is `nix-channel --list` saying?
<clever> selfsymmetric-mu: which channel are you set to?
<clever> johnw: then your just using local->local copies
<clever> johnw: daemon means talk to nix-daemon to get access to /nix/store
<clever> johnw: local means just open things in /nix/store directly
<clever> johnw: local is also the name of the main /nix/store dir
<clever> johnw: do you have several things in the substituters list?

2020-03-09

<clever> evanjs: you may need pkgs.runCommand to unpack the tar
<clever> fresheyeball: it may be off by a few minutes around newyears
<clever> fresheyeball: but now you need to deal with leap seconds in nix
<clever> fresheyeball: note that it will change every second, and ruin any hope of caching the builds if you dont divide down in nix
<clever> > builtins.currentTime

2020-03-08

<clever> lovesegfault: the readme makes it sound like just a very stripped down nixops
<clever> ah, no, ive not used that any
<clever> lovesegfault: dont remember what morph does
<clever> yep
<clever> nice
<clever> lovesegfault: you pinned all the things? :D

2020-03-07

<clever> jlv: i see an example in one of my old clones of nixops
<clever> /home/clever/iohk/nixops-master/examples/route53.nix: resources.route53HostedZones.hs =
<clever> jlv: ah, it was resources.route53HostedZones
<clever> pie_[bnc]: last time i used it, eclipse was pretty nice
<clever> pie_[bnc]: it also has special handling for several languages, but ive not really bothered configuring them, the c++ stuff magically comes to life if i run vim under nix-shell
<clever> pie_[bnc]: youcompleteme + vim will auto-complete any token found in any open file, out of the box
<clever> lovesegfault: the submodule can set a config= for each sub-module, and if you begin adding your own options like i did, then you can also add your own config= .....
<clever> lovesegfault: enless you modify the submodule maybe, check iscsi-boot.nix
<clever> lovesegfault: not really
<clever> lovesegfault: check iscsi-boot.nix in nixos-configs
<clever> lovesegfault: yes
<clever> lovesegfault: submodules
<clever> lovesegfault: then you run that returned map, on the function, and overlayFiles
<clever> lovesegfault: you are running traceVal on map (which prims primop) and returns map
<clever> lovesegfault: line 3, overlayObjs = lib.traceVal builtins.map (f: import ( ./. + "/${f}" ) ) overlayFiles;
<clever> jlv: route53 supports alias's, which basically behave like a cname, but arent visible to the outside
<clever> lovesegfault: what expr did you run?
<clever> jlv: it would be simplest to either cname or alias the extra ones to the one in deployment.route53.hostName
<clever> jlv: here is also a resources.route53 which can create more record sets
<clever> «lambda @ /nix/store/c1jyh069rg3cdlpx3dj0466qg39gq4dl-nixos-20.03pre202088.e89b21504f3/nixos/lib/attrsets.nix:124:17»
<clever> nix-repl> lib.filterAttrs
<clever> lovesegfault: i just did it my way, to group other stuff together
<clever> lovesegfault: youd have to check the nixpkgs docs, but i think it works the way your expecting
<clever> lovesegfault: for <nixpkgs-overlays> it needs a certain format, and i was using foo/default.nix, so foo/other-files.nix would be grouped in a foo/ dir
<clever> lovesegfault: for nixos overlays, you just need to populate nixpkgs.overlays with a list of functions, how you get them doesnt matter
<clever> infinisil: nix eval nixpkgs.lib.version
<clever> pie_[bnc]: i believe cmake is smart enough to know when the CMakeLists.txt is changed
<clever> lovesegfault: use map to generate a list of sets, each with a name/value pair, then listToAttrs to convert
<clever> > :p lib.nameValuePair "name" 42
<clever> > :p lib.listToAttrs [ { name = "a"; value = 42; } ]
<clever> lovesegfault: > :p ...
<clever> lovesegfault: yep
<clever> no idea
<clever> zeta_0: ghcjs can do that too
<clever> zeta_0: no clue, ive never used elm
<clever> 2020-03-06 21:50:24 < clever> zeta_0: line 1 wants a path to nixpkgs, not a pkgs set, so you must either change line 1 to <nixos-unstable> or you must `import /path/to/default.nix { nixpkgs = <nixos-unstable>; }`
<clever> zeta_0: or edit line 1
<clever> zeta_0: when using nix-shell or nix-build, you must `--arg nixpkgs '<nixos-unstable>'`
<clever> zeta_0: what does `--show-trace` show with the error?
<clever> zeta_0: the default.nix that is doing elm stuff, where is it loaded?
<clever> zeta_0: where are you loading https://hastebin.com/bolukumeja.bash
<clever> zeta_0: sure
<clever> zeta_0: line 1 wants a path to nixpkgs, not a pkgs set, so you must either change line 1 to <nixos-unstable> or you must `import /path/to/default.nix { nixpkgs = <nixos-unstable>; }`
<clever> zeta_0: in either https://hastebin.com/bolukumeja.bash or whatever is loading it
<clever> zeta_0: you need to `import <nixos-unstable>` to get the fix
<clever> zeta_0: that change isnt in 19.09
<clever> zeta_0: what does `nix-channel --list` report?
<clever> zeta_0: then your nixpkgs is too old, and is expecting the older style
<clever> cole-h: if you remove the result symlink, and `nix-store --delete /nix/store/hash-dolphin` you can purge it from your store, and then try again without root
<clever> cole-h: either its random network problems that resolved themself, or something is broken with non-root nix
<clever> zeta_0: the error says that fetchElmDeps wants a certain param, try adding that param to the default.nix?
<clever> cole-h: try an strace on that, as root
<clever> cole-h: what happens if you try just `nix-build '<nixpkgs>' -A dolphin` ?
<clever> cole-h: that looks like nix-shell talking to nix-daemon
<clever> bqv[m]: buildInputs doesnt do much at the nix layer, and just becomes an env var for the shell code in stdenv to handle
<clever> bqv[m]: all keys are passed on
<clever> cole-h: what if you use -vvv ?
<clever> cole-h: because you cranked the verbosity up enough to see debug within the http area
<clever> zeta_0: the error does not appear to be coming from the default.nix you pasted
<clever> ,callPackage zeta_0
<clever> lovesegfault: youll need to map over it, and append each filename to the dir
<clever> lovesegfault: nix-repl> builtins.attrNames (builtins.readDir ./.)
<clever> lovesegfault: use builtins.readDir
<clever> samueldr: nice!
<clever> ajs124: but it would save time if things where written right
<clever> ajs124: it tends to get caught when somebody tries to cross-compile something and 30 things break
<clever> ajs124: though nasm is a grey zone, it needs to run on host, but target the target
<clever> ajs124: yeah, those should be native

2020-03-06

<clever> colemickens: the sdimage stuff is more specialized, to deal with the lack of kvm and the wonky boot partition for the rpi
<clever> colemickens: this will generate an ext4 image, optionally with a partition table
<clever> colemickens: and if your on darwin, you need a vm to get linux builds
<clever> colemickens: but it does require a linux build machine
<clever> evanjs: not very
<clever> Cadey: run `nixos-generate-config --root /mnt` in a nixos vm
<clever> Cadey: you would need to boot a linux vm on the mac to be able to modify a nixos image
<clever> Cadey: https://github.com/cleverca22/nix-tests/tree/master/install-helper is a util i made ages ago, to create a custom ISO that would link into my vpn automatically
<clever> Cadey: nixos-generate-config will create one, if your on the target already
<clever> evanjs: no real way to get the date, enless your using json made by nix-prefetch-git
<clever> Cadey: wan and lan are normal nixos options (defined on line 53-64), that you just set in your configuration.nix file
<clever> Cadey: the wan interface is meant to face the internet (wifi card for ex), and the lan interface faces the target (ethernet usually)
<clever> Cadey: that config will turn a laptop with wifi+ethernet into a netboot server, which boots nixos on all of the guests
<clever> Cadey: one minute
<clever> Cadey: after the iso boots, i think you just `passwd`, give it a root pw twice, then `systemctl start sshd.service` and it should work
<clever> Cadey: what board are you booting on?
<clever> then boot that usb on the target
<clever> qyliss: chromium is in the cache, thats the open source build
<clever> benley: gentoo lacks binary caches
<clever> icey_: with nixos, its trivial to do a zfs root, and chrome is in the binary cache
<clever> and that is why i now use nixos on every new install
<clever> :D
<clever> icey_: that is also what hydra itself uses, to know where to send the jobs
<clever> icey_: with that, nix will make other machines help out with the build
<clever> icey_: add a build machine
<clever> alexfmpe[m]: i ran into the exact same problem on an rpi, many years ago
<clever> alexfmpe[m]: and because of how disposable the file is, nix disabled all atomic logic in sqlite to make it perform better, which opens the risk of it becoming corrupt
<clever> alexfmpe[m]: that file is re-created any time its missing
<clever> alexfmpe[m]: you can just `rm /root/.cache/nix/binary-cache-v6.sqlite*`
<clever> Shell: ahh
<clever> coderobe: does that path exist within the bundle?
<clever> coderobe: if you use strace to run the bundle, what errors does execve give?
<clever> coderobe: getting nix itself to work in nix-bundle is tricky
<clever> coderobe: why are you unable to use nix on the host?
<clever> fresheyeball: ref = "branch";
<clever> fresheyeball: you must tell fetchgit what branch the rev is part of
<clever> softinio[m]: what is the exact error it gave?
<clever> softinio[m]: nix-instantiate said it does exist
<clever> softinio[m]: ls -l /nix/var/nix/profiles/per-user/root/channels /nix/var/nix/db/big-lock
<clever> softinio[m]: oops, ^
<clever> sixx: as root, `cat ~/.nix-channels`
<clever> sixx: when doing it with the none backend (as shown here), you need to take care that all of the config for fileSystems."/" is present in the file, or it will loose the ability to boot
<clever> sixx: then you just `nixops create -d name house.nix` and `nixops deploy -d name`
<clever> sixx: lines 12 and 16 tell nixops what to ssh into when deploying
<clever> sixx: nas.nix and router.nix are basically just configuration.nix files, for 2 different machines
<clever> softinio[m]: nix-instantiate --find-file nixpkgs
<clever> sixx: nixops is mainly for deploying a configuration.nix to a remote box, and optionally creating hardware in the cloud
<clever> o1lo01ol1o: using nixops against a machine that nixops didnt provision
<clever> o1lo01ol1o: though baremetal nixops can team-scale without much management of the state
<clever> sixx: sounds like you want nixops
<clever> softinio[m]: roots channels have priority, so what does `sudo -i` then `nix-channel --list` report?
<clever> softinio[m]: echo $NIX_PATH?
<clever> softinio[m]: `nix eval nixpkgs.lib.version` ?
<clever> softinio[m]: but when did you last update the channels?
<clever> softinio[m]: i'm not sure where its finding 12 from then
<clever> softinio[m]: add -A to that search command i believe
<clever> turion: then you need to write a default.nix for it
<clever> turion: in this case, you probably want python.withPackages
<clever> turion: `pip install` wont work on nixos, you must tell nix-shell what you want
<clever> mlatus: and a copy of cachecache.nix (in the same dir)
<clever> mlatus: https://github.com/cleverca22/nixos-configs/blob/master/nas.nix lines 24 and 145, thats pretty much all you need
<clever> cole-h: nix repl uses .type to detect if it should pretty-print things
<clever> cole-h: you can also use this
<clever> > builtins.removeAttrs hello ["type"]
<clever> cole-h: lib.attrNames shows the names
<clever> cole-h: in nix repl, try `hello.<tab><tab>`
<clever> lovesegfault: and https://github.com/NixOS/nixpkgs/pull/72657 added vc4 cross-compile to nixpkgs
<clever> lovesegfault: line 18 pulls in a directory with firmware, that i was already cross-compiling, before nixos worked