2018-03-19

<clever> __sean: does it need to be an FHS env?
<clever> __sean: you can also just set it as an attribute on the derivation
<clever> makefu: there is no way to ever make reading the old name work
<clever> makefu: i recently discovered, that the rename stuff, only works when setting the old name
<clever> ixxie: this symlink causes -I nixpkgs=foo and -I foo to both work, because foo always contains nixpkgs, which points to itself
<clever> lrwxrwxrwx 1 root root 1 Dec 31 1969 /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs -> .
<clever> ixxie: also, if any -I element isnt found, it silently continues to NIX_PATH, so its harder to notice it being broken
<clever> ixxie: the channels also include a nixpkgs symlink to ., which deals with that for you
<clever> ixxie: without that, it looks for nixpkgs inside the directory you give it
<clever> ixxie: i believe it can
<clever> ThatPako: ah, i think somebody else had trouble with that a week ago
<clever> ThatPako: what are the contents of the overlay file?
<clever> ThatPako: how can removing the overlay fix the problem, if you claim to have no overlays?
<clever> ThatPako: 2018-03-19 16:31:44 < ThatPako> Nope, no overlays
<clever> ThatPako: what does nix-info say now?
<clever> ThatPako: yep, that should be normal
<clever> ThatPako: nix-channel --update
<clever> GlennS: the one on the wiki also has a small bug, which is fixed on the branch i linked
<clever> GlennS: its in the repo, at the root, on the branch i linked
<clever> nliadm: where is it missing?
<clever> nliadm: what error does it fail with?
<clever> and maybe update the root one to unstable, if you want to actually run unstable
<clever> so you should remove the nixos channel from your user
<clever> that will cause all kinds of fun problems
<clever> ThatPako: what about the output of nix-channel --list, as root and your own user?
<clever> i prefer gist.github.com
<clever> what is the output?
<clever> ThatPako: what if you run nix-info as root?
<clever> ThatPako: i'm not sure what youve done to break it, does anything change if you reboot?
<clever> GlennS: the `-o nixpkgs` in here leaves behind a symlink, that prevents garbage collection of the result
<clever> ThatPako: what about the output of nix-info?
<clever> so its contents shouldnt matter
<clever> ThatPako: the -v output says it never looked in /nixos
<clever> ThatPako: what about config.nix?
<clever> ThatPako: oh, do you have a config.nix or any overlays configured?
<clever> ThatPako: yep
<clever> ThatPako: try adding more -vvvv's
<clever> Myrl-saki: youve already used up more then half of that just asking!, lol
<clever> ThatPako: what does `which nix-store` return?
<clever> that makes more sense
<clever> plus 3% from other things
<clever> ah, 8 cores would mean that translates to 12.5%
<clever> also, what OS are you on?
<clever> it should be reporting at least 25% :S
<clever> ThatPako: how many cores do you have?
<clever> what is the cpu% for that?
<clever> ThatPako: run top
<clever> ThatPako: what does `top` say nix-build is doing?
<clever> what does it say?
<clever> ThatPako: run it again with -v
<clever> yet also claimed it was in other areas
<clever> gchristensen: but thats still an improvement from what 1.11 did, it refused to even admit it was rooted
<clever> gchristensen: the return type would have to be changed from PathSet to a list of structs that describe why they are roots
<clever> gchristensen: aah, the 14 is just an index into the array findRuntimeRoots() returned, and has no real meaning
<clever> guillaum1: kernel or userland?, what did the grep say exactly?
<clever> guillaum1: is there a pid 14 running? ps aux | grep 14
<clever> guillaum1: can you paste one in-full?
<clever> ThatPako: /lib/ld.so doesnt exist, so 90% of those programs will fail to even start
<clever> ThatPako: it also has pythonPackages and linuxPackages (kernel stuff)
<clever> ThatPako: nix doesnt really care, so its mostly your choice and how you feel about the security
<clever> ThatPako: it is then put into action with nixpkgs.overlays = [ (import ./overlays/qemu-user.nix) ];
<clever> ThatPako: that defines 6 custom packages
<clever> ThatPako: here is an example overlay i recently made: https://github.com/cleverca22/nixos-configs/blob/master/overlays/qemu-user.nix
<clever> ThatPako: overlays also help to make it simpler
<clever> ThatPako: you can manage that file in git if you want to
<clever> ThatPako: so its simpler to just have a single nix file that defines the changes, and not deal with the clone
<clever> ThatPako: even if you had a local nixpkgs clone, you still must import every nix package, in that clone
<clever> ThatPako: thats in the nixpkgs manual
<clever> and the new value would also be ok to keep
<clever> ixxie: if nothing has broken, then you may not run any of that buggy software
<clever> if you mess with it, you break the very things it was meant to fix
<clever> ixxie: things like what role has admin in postgress
<clever> ixxie: it is the version of the state, which nix cant upgrade
<clever> ixxie: it must never be changed, and must remain set at the version you originally installed
<clever> ThatPako: no, you can just put a package override into your configuration.nix and load things with callPackage
<clever> kthnnlg: so builtInputs = [ foo ]; would do it
<clever> kthnnlg: the bin dir of every buildInput is added to PATH automatically
<clever> makefu: sounds good
<clever> makefu: something more along the lines of just building 32bit stuff
<clever> makefu: also, its not really cross-compiling, its a 32bit->32bit compiler
<clever> volhovm: you likely also dont need -m32 at that point, since nix will provide a 32bit only gcc
<clever> then nix will give you 32bit everything
<clever> so things like pkgsi686Linux.stdenv.mkDerivation or pkgsi686Linux.callPackage
<clever> volhovm: ah, you want to use pkgsi686Linux instead of pkgs
<clever> volhovm: what exactly are you trying to do?
<clever> !library
<clever> !libraries
<clever> ottidmes: you can either embed your pubkey into the configuration.nix as standard, or use the file in / on the host
<clever> so it allows ssh
<clever> line 36 of the same file also copies that file out of the initrd, and into the final rootfs
<clever> to set the format
<clever> the hardest part i had to figure out, back when i made my own initrd's for gentoo, is that you must use cpio -H newc
<clever> gzip is also happy with cat'ing several streams together
<clever> oops
<clever> actually, it doesnt re-compress
<clever> kexec itself, doesnt accept a list
<clever> but the compression layer gets a bit more upset over that, so i have to re-compress
<clever> there is a special marker at the start of cpio archives, and the kernel will easily accept joining several with cat
<clever> ottidmes: basically, i uncompress (but not unpack) the initrd, then i generate a 2nd initrd with the ssh pubkey, then i just concat the 2 cpio archives, and re-compress
<clever> ottidmes: my kexec tools already adds files to the initrd
<clever> is there an easy way to do that?, shal i just recursively map over the propagatedBuildInputs?
<clever> oh, related to that pr, i need a way to get the closure of a given haskell package, as a list of derivations
<clever> jtojnar: run it under "strace -f -c"
<clever> woffs: they are attributes of nixos/release.nix
<clever> ref and rev*
<clever> dhess: yeah, dang, no sha256, but it does support ref and ref

2018-03-18

<clever> hyperbolic_: it happens if the nix.conf is from nix 1.11, and your running nix 2.0
<clever> hyperbolic_: ah, the error should be safe to ignore at that time
<clever> hyperbolic_: did you recently try to upgrade to nix 2.0?
<clever> hyperbolic_: are you on nixos?
<clever> boomshroom: if src is set on the derivation, yes
<clever> and then clearly document them in the nix expression
<clever> and thats why nix exists, to find the un-documented deps!
<clever> boomshroom: the unpackPhase handles that for you, but the buildCommand disables all of that
<clever> tos9: wrapProgram or makeWrapper can be used to modify the PERLPATH when starting irssi
<clever> tos9: yeah, thats how i would handle things
<clever> boomshroom: it should be a temp dir under /tmp, which nix will nuke when its done
<clever> boomshroom: you can just insert a pwd and ls -ltrh into there to find that
<clever> NickHu_: and all of the master based channels are 2 days or older, QT broke things
<clever> NickHu_: the branches on this repo coresponde to the channels
<clever> boomshroom: or finding a cp flag to override the chmod bits
<clever> boomshroom: you could also speed it up by just doing the chmod on what you just copied
<clever> boomshroom: probably after each copy
<clever> NickHu_: why do you think nixpkgs-unstable has something newer then 2.0.6?
<clever> boomshroom: the stuff your copying is read-only, and gets in the way of more copies
<clever> boomshroom: you need to chmod -R +w $out
<clever> the man page tells you how to set the name when you add
<clever> what does nix-channel --list say?
<clever> NickHu_: how are you installing it?
<clever> NickHu_: check `nix-channel --list` as each user
<clever> NickHu_: each user has his own channels, and root's are available to all users
<clever> runCommand is just a helper to set buildCommand for you
<clever> so you dont need ${coreutils} anymore
<clever> also, runCommand sets up PATH for you
<clever> the stdenv will eval the buildCommand for you
<clever> i also replaced builder with buildCommand in the 2nd derivation
<clever> so i'm editing a copy that i own
<clever> i clicked the fork button
<clever> edited to correct a typo
<clever> it will run "bash script" in bash, and expects it to produce $out
<clever> boomshroom: if you do runCommand "name" {} "bash script"
<clever> you pretty much never need to do that
<clever> if you are setting builder, your doing it wrong
<clever> also, runCommand does things without having to even make a builder
<clever> you want "$build"
<clever> $build drops all \n's
<clever> line 55
<clever> i see your problem
<clever> oh
<clever> it needs to be properly quoted in the bash level
<clever> is the problem happening in nix-build or nix-shell?
<clever> boomshroom: and what are you running when it gets flattened to one line?
<clever> boomshroom: can you link the gist again?
<clever> boomshroom: can you gist your entire nix file?
<clever> shout-user93: that gives you the url to the exact source you just installed
<clever> nix-instantiate --eval '<nixpkgs>' -A nixStable.src.urls
<clever> one sec
<clever> but we know your running whats in nixpkgs, so thats simpler
<clever> ah, it should at least have the deriver this time
<clever> what version did it say it was installing?
<clever> i think
<clever> nix-env -iA nixpkgs.nixStable2
<clever> sudo -i
<clever> you could just upgrade it, then youll know what version it is
<clever> ah, its been GC'd, or maybe its the initial one you installed
<clever> shout-user93: what does this say?
<clever> shout-user93: nix-store --query --deriver /nix/store/xmi4fylvx4qc79ji9v5q3zfy9vfdy4sv-nix-2.0
<clever> normally there is a hash after the 2.0
<clever> shout-user93: not easily
<clever> ls -lh /nix/var/nix/profiles/default/bin/nix
<clever> ls -l that path
<clever> yeah, thats roots profile
<clever> that*
<clever> and then ls -l tat
<clever> shout-user93: which nix
<clever> shout-user93: ls -l ~/.nix-profile/bin/nix
<clever> rauno: and this one manages setting up services:
<clever> and this is how nixos auto-detects what filesystems you have, and configures what manveru mentioned automatically
<clever> ottidmes: :O
<clever> ottidmes: there is also an openvpn config file, which is seperately in .gitignore
<clever> testuser: so youll want to export prefix=/path/you/can/write/to before you configure
<clever> testuser: the configurePhase uses $prefix to tell the package where to install itself
<clever> ottidmes: and then i just let secrets = import ./secrets.nix; in everywhere
<clever> ottidmes: i just keep all the secrets in secrets.nix, which is in .gitignore
<clever> tobiasBora: the hydra will copy all outputs to itself once built, so there is no need to keep the results on the build slaves
<clever> that will forciably disable mysql, even if other things wanted it on
<clever> leotaku: for example, services.mysql.enable = lib.mkForce false;
<clever> leotaku: you can set just about any option in nixos with mkForce and it will ignore other values set in other modules
<clever> leotaku: you can do it with mkForce
<clever> testuser: genericBuild will automatically do the cd after running the unpackPhase
<clever> tobiasBora: but you can review things with `nix-build foo.nix -A bar --repeat 2`, as root, it will build it 3 times, and tell you if it differs
<clever> tobiasBora: also, not a lot of the compilers are able to produce bit-perfect results, so such checks can falsely fail
<clever> then the slaves can GC safely and you dont loose anything
<clever> tobiasBora: hydra is more used to build things automatically, on an array of trusted machines, and then pull the results back to 1 central place
<clever> tobiasBora: not currently
<clever> testuser: and it will then use the result of that function to modify some attrs
<clever> testuser: oops, ^
<clever> tobiasBora: overrideAttrs takes a function that accepts 1 argument (typically called drv), and it will call that function with the original attributes
<clever> tobiasBora: not really, you should probably just use hydra for this kind of thing
<clever> testuser: the drv attrset is all of the old values
<clever> so you need rec { and ${name} to refer to the name you just set
<clever> testuser: ah yeah, drv.name refers to the old name
<clever> tobiasBora: thats what i plan for this to turn into: https://github.com/cleverca22/cachecache
<clever> tobiasBora: currently, you need to setup every machine as a seperate binary cache, and configure every machine to ask every other machine
<clever> testuser: i also prefer writing my files so that the secrets are all in secrets.nix: https://github.com/cleverca22/nixos-configs/blob/master/core.nix#L79
<clever> testuser: you could also just delete the lines that have the secrets
<clever> testuser: can you pastebin the entire configuration.nix file?
<clever> rec allows you to refer to other keys in the same set
<clever> or use rec { on line 2
<clever> oh
<clever> testuser: you need to use drv.name there
<clever> nixpkgs.config.packageOverrides = pkgs: { hello = pkgs.hello.overrideAttrs (drv: { src = pkgs.fetchurl { ... }; }); };
<clever> you can use overrides to change it without a new file
<clever> setting the version variable will have no real effect
<clever> testuser: you must override the src, and its recomended to also override the name
<clever> Lisanna: maybe, after trying the FOD and letting it pass or fail
<clever> to just read it, wether it worked or not
<clever> Lisanna: but you could maybe use readFile on the potentially invalid output of a FOD
<clever> Lisanna: only in certain modes, there is a special prefetch flag you have to set
<clever> which can then do anything you want
<clever> Lisanna: i think that lets you write your own primops in c++
<clever> Lisanna: importnative may also be of interest to you
<clever> a fixed-output derivation may leave html in the .tar.gz
<clever> nix leaves those behind, so you can inspect why it failed
<clever> yeah, pathExist would find it
<clever> GC also eats those first
<clever> and it gets deleted automatically if its in the way
<clever> so no proper nix tool will read it
<clever> its just not registered as valid
<clever> Lisanna: oh, also, when a derivation fails to build, nix leaves the failed output in /nix/store/!
<clever> then nix wont even bother trying to build it
<clever> Lisanna: if you call pathExists on anything with dependencies, it throws an error
<clever> which nix will parse, and return as-if you did import on it
<clever> Lisanna: aha, builtins.exec must print a nix expression to stdout
<clever> arg 0 is a program
<clever> the 1st argument is a list
<clever> this un-hides builtins.exec
<clever> Lisanna: nix repl --option allow-unsafe-native-code-during-evaluation true
<clever> :D
<clever> its hidden by default, to keep it out of your hands :P
<clever> builtins.exec
<clever> exec?
<clever> tryEval?
<clever> it made use of md5 hash collisions
<clever> Lisanna: there was already a trick in the chrome expressions, to have a non-fixed fixedoutput derivation
<clever> Lisanna: at least you didnt brick 100's of network cards: https://lwn.net/Articles/304105/
<clever> yep
<clever> ottidmes: i suspect isDir is broken on symlinks
<clever> can you try "builtins.pathExists /etc/nixpkgs/overlays.nix" and `builtins.pathExists (/etc/nixpkgs/overlays.nix + "/.")` in `nix repl` ?
<clever> ottidmes: and does that file exist?
<clever> ottidmes: what line#'s does it give with --show-trace?
<clever> import path;
<clever> # it's a file, so the result is the contents of the file itself
<clever> if pathOverlays != "" && pathExists pathOverlays then overlays pathOverlays
<clever> pathOverlays = try <nixpkgs-overlays> "";
<clever> ah, yeah, nix isnt really capable of that
<clever> then if you only depend on an output of the 2nd, it will be able to gc the unused parts
<clever> Lisanna: it would be easyer to make a fixed-output derivation that returns a single directory, then have a non-fixed derivation that splits it into many outputs
<clever> though the gentoo one at least mentions the oracle archives, so you can find old versions
<clever> robstr_: i see messages in the jdk package that parallel what nix has to say
<clever> robstr_: maybe i'm mis-remembering things some, or oracle's licenses was different
<clever> einfo "Oracle requires you to download the needed files manually after"
<clever> robstr_: i havent really used gentoo in a year or 2, so id have to look at how it does the download again
<clever> and if oracle changes the licenes, a new licenes is added to the package manager, and you must read that and add it to the accepted list
<clever> robstr_: then emerge can download packages for things you have accepted
<clever> robstr_: and you are supposed to read them, and put them into a list of licenses you have accepted
<clever> robstr_: gentoo solved the issue in a bit of a different way, there is a list of license files in the package manager
<clever> nioncode: the error is at least clear about the version#'s causing the issue, but less clear on where they came from
<clever> nioncode: i have an issue open about that
<clever> nioncode: if you install anything qt based with nix-env, its libraries wind up in ~/.nix-profile/lib/ and can break other versions
<clever> its loading them somewhere it shouldnt, and not really using the result
<clever> ottidmes: there is also a bug where nixos will fail due to problems in the default overlays, but never actually obey them
<clever> it defaults to just []
<clever> ottidmes: nixos-rebuild uses the overlays set in nixpkgs.overlays = [ ... ];
<clever> sphalerite: ahh, fixed
<clever> amdgpu doesnt even change the res in text mode
<clever> sphalerite: dang, X is still broken
<clever> you have to nixpkgs.overlays = [ (import /path/to/overlay) ];
<clever> abcdw: configuration.nix doesnt load those overlays by default
<clever> ah, much more
<clever> i only see a 64bit flag on my end
<clever> true
<clever> error: attribute 'is32bit' missing, at (string):1:1
<clever> nix-repl> stdenv.is64bit