2017-10-15

<clever> rosa_: that source code does not appear to be valid
<clever> 2017-10-15 07:18:01 < clever> rosa_: what IP does "ifconfig" say you have?
<clever> rosa_: still waiting for the IP stuff i asked above
<clever> rosa_: looks like its part of mono
<clever> mono.out 233 x /nix/store/2ks0wgl55pxfil5yxdz93si65k945b14-mono-4.0.4.1/bin/lc
<clever> sphalerite: then when this box retries, the server says the connection is already dead
<clever> sphalerite: randomly, the other machine gets a reply for a connection it wasnt expecting, and tells the server to go away
<clever> sphalerite: the network failures feel like an IP address collision to me
<clever> sphalerite: that is a strange error
<clever> and what interface is that IP on?
<clever> rosa_: what IP does "ifconfig" say you have?
<clever> rosa_: did you set networkmanager to manual ip or automatic ip?
<clever> rosa_: how did you enable networing?, dhcp or static ip?
<clever> rosa_: what about nix-env -iA nixos.firefox ?
<clever> it also mentions the bootloader secrets
<clever> it explains the hostkeys
<clever> hyper_ch: read the descriptions on https://nixos.org/nixos/options.html#boot.initrd.network.ssh.host
<clever> or the key was handled differently
<clever> that was probably tested with sandboxes disabled
<clever> which wiki did you read?
<clever> and nix will know its a dependency
<clever> that will copy the private key into /nix/store and make it world-readable
<clever> hyper_ch: the problem is that the nix builds happen in a sandbox, and lack access to any files on the host
<clever> Mic92: nix sandboxes
<clever> hyper_ch: add [ and ] around it
<clever> hyper_ch: you need to put that whole string inside a list
<clever> as the error says
<clever> hyper_ch: authorizedKeys must be a list of strings
<clever> retry is better in that case
<clever> rosa_: try the same command again
<clever> rosa_: OS error code 104: Connection reset by peer
<clever> rosa_: ?
<clever> rosa_: why do you want to find the gcc headers?
<clever> rosa_: are you using nix-shell?
<clever> rosa_: nix can also use hardlinks to handle dedup
<clever> rosa_: symlinks as far as the eye can see!
<clever> infinisil: yeah
<clever> nope
<clever> ldlework: runCommand "name" { buildInputs = []; } "script";
<clever> my kexec script just runs that via kexec
<clever> rosa_: and all you need to add, is a way to boot that, and then it can run without the boot media
<clever> rosa_: this build of nixos, contains just a kernel, initrd, and the kernel cmdline
<clever> rosa_: both the kexec and netboot images run 100% from ram
<clever> grahamc: where the config.nix comes from
<clever> grahamc: at a glance it all looks correct
<clever> grahamc: gist updated
<clever> gchristensen: ive got output for 2 machines
<clever> gchristensen: lol, i already have you added as a remote!
<clever> [clever@amd-nixos:~/apps/nixpkgs]$ git checkout grahamc/nix-help
<clever> so it has to first follow the redirect, then read both things from it
<clever> and it wants to atomicly download 2 things from the same directory
<clever> it does funny things like this, because the directory on the server is a symlink
<clever> it uses curl to query the redirect, the nix-prefetch-url to download, fun
<clever> oh wait...
<clever> kkini: its downloading it with just bare curl
<clever> kkini: ah, thats where it downloads the actual channel
<clever> kkini: did you run it as root or a normal user?
<clever> kkini: nix-channel calls curl without any sandboxing, so the normal env vars that curl obeys will work
<clever> which one did nix-channel come from?
<clever> kkini: which version of nix are you using?
<clever> yeah
<clever> kkini: one passes it to curl, the other tells nix to let it into the sandbox
<clever> /home/clever/apps/nixpkgs/pkgs/build-support/fetchurl/default.nix: "NIX_CURL_FLAGS"
<clever> /home/clever/apps/nixpkgs/pkgs/build-support/fetchurl/builder.sh: $NIX_CURL_FLAGS"

2017-10-14

<clever> nixpkgs.config in configuration.nix
<clever> hyper_ch: read the man page for it
<clever> you want to test things with nix-build first
<clever> thats how you apply package overrides
<clever> its mostly a puzzle of finding the right list of patches
<clever> yeah
<clever> thats not how you fork things!!
<clever> its a heap of patches, lol
<clever> rtorrent-ps contains no actual code
<clever> hyper_ch: the above nix expression fails, for different reasons
<clever> have you tried what i said yet?
<clever> why wont it work?
<clever> try building that expression
<clever> rtorrent.overrideDerivation (drv: { src = pkgs.fetchFromGitHub { owner = "pyroscope"; repo = "rtorrent-ps"; sha256 = "fixme"; rev = "fixme"; }; })
<clever> what happens if you just change the src to rtorrent-ps and see what nix does with it?
<clever> how much do they differ?
<clever> its in the nixpkgs manual
<clever> hyper_ch: why cant you just build rtorrent.overrideDerivation (drv: { src = ....; }); ?
<clever> hyper_ch: what do you want to change about rtorrent?
<clever> hyper_ch: and force push just changes the remote branch
<clever> hyper_ch: a hard reset just changes the local branch to point to any given commit in the repo
<clever> yeah
<clever> eqyiel[m]: not sure then
<clever> eqyiel[m]: what if you do that with nix-shell --pure?
<clever> builder for ‘/nix/store/d2kl6ic7ydi9llfq6ggcq35yq8drpn0d-libelf-0.8.13-armv7l-unknown-linux-gnueabi.drv’ failed with exit code 1
<clever> and then check what genericBuild does
<clever> you need to re-run nix-shell against the .drv that actually failed
<clever> eqyiel[m]: it looks like the .drv file you pointed to didnt load
<clever> eqyiel[m]: is $CC set?
<clever> ah
<clever> the last user i saw having trouble with this, had the wrong value in $SHELL because they didnt fully relog

2017-10-13

<clever> but that has %'s
<clever> it defaults to the entry after the last / in the url
<clever> hyper_ch: name = "something.deb";
<clever> hyper_ch: add a name to the fetchurl
<clever> tilpner: this function will take a list of binaries to copy from a list of packages, and automatically grab all deps, and patchelf it back together
<clever> tilpner: you need to also copy the dynamic libraires it depends on, and re-patchelf it, look at how nixos handles its initrd
<clever> tilpner: patch it to use ${iptables}/bin/iptables
<clever> steveeJ: yeah, so you need to bring runCommand into scope first, by adding it somewhere between lines 8-14
<clever> ij: keep running nix-store --delete on them, or just nix-collect-garbage to get rid of all garbage
<clever> eqyiel[m]: run nix-shell against that .drv file, and then run genericBuild in a tmp directory
<clever> steveeJ: then you just need to add runCommand to line 8-14
<clever> no idea, ive never tried using asserts like that in nix
<clever> ij: run nix-store --delete on the problem file
<clever> steveeJ: nothing is bringing it into scope
<clever> so you have to refer to it somehow, usually by adding runCommand to the args between lines 8 and 14
<clever> steveeJ: runCommand is just an attribute within pkgs, not a global variable
<clever> runCommand isnt even used in that file
<clever> steveeJ: line 24 also doesnt match up right
<clever> 24 # For ghdl (the vhdl language provider to gcc) we need zlib in the wrapper.
<clever> 25 assert cc.langVhdl or false -> zlib != null;
<clever> that is rather strange
<clever> steveeJ: what does --show-trace say?

2017-10-12

<clever> ryantm: thats also an option
<clever> Lisanna: that just tells nix to look for nixpkgs in $NIX_PATH
<clever> ah
<clever> Lisanna: make a root default.nix, that imports nixpkgs, and then loads everything with callPackage
<clever> Lisanna: in this case, its better to not make the mid level files directly loadable
<clever> ryantm: basicaly, if define a "machine" called defaults in your nixops deployments, that config is applied to every machine in the deployment
<clever> ryantm: ah, you might want to use the defaults for nixops instead
<clever> Lisanna: depends, on how that child package is loaded
<clever> ryantm: what expression/command are you using?
<clever> ryantm: another option is to create an extra file, that has many things under its imports, or to use imports directly, how are you loading eval-config?
<clever> Lisanna: yeah
<clever> it runs automake and autoconf, with the right args to make it work under nixpkgs
<clever> it doesnt directly run autogen.sh
<clever> autoreconfHook
<clever> tilpner: add the autoreconfhook to the inputs
<clever> Lisanna: only if they have callPackage as an argument to the default.nix
<clever> Lisanna: line 155 defines a new callPackage, that will search within the new set, made by merging 3 others
<clever> yeah, most of the interesting stuff is in that area
<clever> Lisanna: its on line 6204
<clever> /home/clever/apps/nixpkgs/pkgs/top-level/all-packages.nix:6204: callPackage = newScope self;
<clever> Lisanna: not 197
<clever> Lisanna: here
<clever> /home/clever/apps/nixpkgs/pkgs/top-level/all-packages.nix: callPackage = newScope self;
<clever> Lisanna: any you add with packageOverrides is added to pkgs, and will work with callPackage
<clever> Lisanna: pkgs.callPackage will then use pkgs.stdenv
<clever> Lisanna: pkgs.callPackage will only be able to use other attributes of pkgs
<clever> so there are many rpath's at play
<clever> Lisanna: it uses the rpath of the .so that depends on pthread, not the elf at the root
<clever> asdfoiawe: ah, then you would want to either buildEnv it against the python, or just symlink the python binary in postInstall
<clever> asdfoiawe: nix will replace that with an absolute path
<clever> asdfoiawe: just use #!/usr/bin/env python and allow the fixupPhase to run (it should be on by default)
<clever> ipfs cant handle the .narinfo half of the equation
<clever> infinisil: but the .nar is addressed by a hash of its contents
<clever> infinisil: the main issue i can see is that the .narinfo files are addressed by a hash of the build instructions
<clever> curl https://cache.nixos.org/nar/1mxwah80k6735kx92vhr5by4icqn30dls96ph1cj6zzg1ffgcjhi.nar.xz | unxz | nix-store --restore 6gzd48piwzik92wg471j9f1dp4jfybjh-ghc-8.0.2-man
<clever> so given the above url
<clever> gchristensen: and this is how you both generate, and unpack a nar
<clever> 2017-02-22 22:23:23< clever> $ nix-store --dump a | nix-store --restore b
<clever> elvishjerricco: with chroots thrown in to try and isolate it maybe
<clever> elvishjerricco: impurities and imperative operations everywhere!!
<clever> elvishjerricco: and then just nix-build '<nixpkgs/nixos>' -I nixos-config=./configuration.nix -A system.build.isoImage
<clever> elvishjerricco: create a custom configuration.nix that contains { ... }: { imports = [ <nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-graphical-kde.nix> ]; }
<clever> yeah, patchelf has to be ran on it
<clever> the problem isnt that its 32bit
<clever> asdfoiawe: did you download that binary from a website and just unpack the tar?
<clever> lol
<clever> gandreani: looks like a bug
<clever> gandreani: i just tab-complete under nix-repl '<nixpkgs>'
<clever> gandreani: nope, change the wrapper script for chromium, to clear LD_PRELOAD before running the binary
<clever> gandreani: and when chromium is ran as a child of teamspeak, it inherits the LD_PRELOAD, which breaks chrome
<clever> gandreani: teamspeak wants to read files in /usr, and nixpkgs used LD_PRELOAD to activate libredirect to fix that
<clever> gchristensen: i move things to nix-env at that point
<clever> lol
<clever> so my / partition is 3.5gig
<clever> the main limitation of the above method, is that you are stuck keeping whatever partition layout the machine had to begin with
<clever> then you just need to delete all the arch related files
<clever> gandreani: then it boots nixos, on the arch rootfs
<clever> gandreani: and if you run the right script, it will just overwrite the bootloader and grub.conf
<clever> gandreani: you can run nix on any linux distro, and nix-build can technicaly build a copy of nixos within /nix/store/
<clever> i converted that eeepc from arch to nixos in under an hour, without any install media
<clever> gandreani: just ssh into another machine that already runs irssi
<clever> gandreani: not sure if xorg would even fit right now, lol
<clever> gandreani: currently, its just a spare monitor for irc, and occasional resue ssh for when xorg dies
<clever> gandreani: the SSD is only 4gig, and i currently cant deploy anything because there isnt enough room to copy the build over
<clever> gandreani: when using targetEnv = "none"; you just install nixos normally, and then give nixops the requiered info to keep the machine booting in the future, and ssh access
<clever> Myrl-saki: another is to just make a dummy git commit after unpackPhase
<clever> Myrl-saki: one method i use, is to cp -r the entire source to a -orig version when i unpack, then diff -ru the orig and modified
<clever> gandreani: here is a simple nixops file i made to update my netbook: https://github.com/cleverca22/nixos-configs/blob/master/deployment.nix
<clever> gandreani: nixops is also pretty powerful: https://nixos.org/nixops/manual/
<clever> gandreani: https://nixos.org/nixos/options.html#systemd.services is also handy
<clever> gandreani: if you want a service that remains running and should restart upon exit, delete lines 21&22
<clever> thats for one-shot services, that just run a command and quit
<clever> powerManagement.powertop.enable = true;, done!
<clever> gandreani: lol, while trying to find an example, i found its already done
<clever> gandreani: thats best put into a systemd unit
<clever> weird
<clever> that is strange
<clever> sphalerite: what about ls -lh /dev/zd*
<clever> ah
<clever> sphalerite: have you looked in /dev/rpool/ ?
<clever> fearlessKim[m]: multi-user nix on high siera can kill the entire machine
<clever> fearlessKim[m]: the same one they previously told nixos to stop talking about
<clever> fearlessKim[m]: if you turn the above off and edit the store, you can seriously break many things, so its best to avoid it whenever possible
<clever> anderslundstedt: 32bit userlands then barf if they try to readdir() an xfs directory where an inode is over 32 bits long
<clever> anderslundstedt: and xfs will spread the inodes over the entire disk, and use an inode near the data, which can easily result in it skipping inode slots, and going over the 32bit border
<clever> kkini: i did "df -i -t zfs" and i see 5 different numbers for used and total, and a single number (repeated 5 times) for free
<clever> kkini: zfs is wonky, because used + free != size
<clever> ison111: every attribute on the derivation becomes an environment variable during the build
<clever> kkini: also, try "df -i"
<clever> kkini: though optimize is an optional thing, purely to de-dup the store
<clever> kkini: every single file, recursively, in the entire store, gets hardlinked under /nix/store/.links/, so the problem is already 20 times worse then you thought
<clever> kkini: there isnt much point in trying to limit the number of files within the /nix/store/ listing, because of how --optimize works

2017-10-11

<clever> ij: if you intentionaly avoid installing ruby with nix-env and systemPackages, then that script will fail at runtime
<clever> tilpner: yeah
<clever> tilpner: if you properly declare the hash of the output (see sphalerite's link), nix will allow networking
<clever> tilpner: network is disabled during the build
<clever> gchristensen: neat, hadnt seen that extension to irc
<clever> isaac__: du -h --max=0 $(nix-store -qR result) | sort -h
<clever> isaac__: but i'm too busy at this instant to walk you thru that
<clever> isaac__: ive also battled this and defeated the ghc beast :P, i added split outputs to haskellPackages to make things shrink massively
<clever> isaac__: dang, why-depends doesnt seem to have hit a channel yet
<clever> isaac__: try building it against nixpkgs-unstable or nixos-unstable, and see what that does to your closure size
<clever> and the .so depends on libraries within ghc, which brings in all of ghc
<clever> as an example, if a haskell library depends on a normal text file under its share folder, it brings in the .so file by accident
<clever> there are multiple layers to the problem
<clever> isaac__: the ghc closure size thing has been fixed in a recent master, how old of a nixpkgs are you using?
<clever> so the \ has to be escaped as well!
<clever> but \+ is how you escape things in bash
<clever> so the + has to be escaped
<clever> the reason for that, is that nix-env expects regex
<clever> or atari\\+\\+
<clever> or atari
<clever> try maybe doing atari\+\+
<clever> ebzzry: the name is atari++, so ataripp wont work
<clever> ebzzry: what commands have you tried?
<clever> maybe look at how other guile things are built within nixpkgs
<clever> something similar to --prefix from autoconf
<clever> that would be within the guile module docs
<clever> you need to ensure it installs itself to $out, not to guile
<clever> that happens with some language frameworks
<clever> so it needs to be patched to mkdir in the right spot
<clever> ison111: you can never modify the inputs to your derivation, only $out can be modified
<clever> fearlessKim[m]: anything of note in dmesg?
<clever> fearlessKim[m]: what filesystem is /nix/store on?
<clever> ison111: you may also need to add pkgconfig to the inputs, if thats required
<clever> ison111: add autoreconfHook to the buildInputs, and nix will handle all of that automatically

2017-10-10

<clever> the name of the root (a itself) isnt serialized, but if its a directory, the names of the children are in the stream
<clever> and you could use that as a replacement for tar
<clever> together, that just copies a -> b
<clever> tilpner: the first one will just serialize a as a NAR, the second will unserialize
<clever> 2017-02-22 22:23:23< clever> $ nix-store --dump a | nix-store --restore b
<clever> tilpner: aha, it will serialize the entire path into a NAR, then just check that for the hashes
<clever> and the answer to the previous question, of how it scans
<clever> ah
<clever> tilpner: what file is that path present inside?
<clever> tilpner: do you have a .nix file that can reproduce the problem?
<clever> tilpner: all files are always scanned in full
<clever> tester123: src = ./.;
<clever> cmakeFlags
<clever> so you must inspect .git to find the rev
<clever> copumpkin: objects in a directory within git, can have a type of file, directory, or commit, it stores a commit hash + dirname directly into the directory
<clever> copumpkin: i recently looked into submodules and discovered that the rev for a submodule isnt present in the filesystem state
<clever> woffs: you man want to instead add zfs.zfs_arc_max=12345 to the kernel params

2017-10-09

<clever> gchristensen: for example, zfs root
<clever> gchristensen: i can also see it being handy for non-standard partitioning/filesystems on existing platforms, like aws
<clever> heh
<clever> gchristensen: have you heard my idea about adding my kexec trick to nixops?
<clever> tilpner: and unlike activation, it wont run again on boot
<clever> extraSystemBuilderCmds runs at nix-build time, when creating the nixos build
<clever> boxofrox: it will import the directory containing this nix file, into /nix/store/ (in my case, a snapshot of /etc/nixos/nixcfg) and then expand to that storepath
<clever> tilpner: this puts a snapshot of all of my nixos config into every build
<clever> ln -sv ${./.} $out/nixcfg
<clever> system.extraSystemBuilderCmds = ''
<clever> yeah
<clever> it wont find it
<clever> gchristensen: ah, but nixos-config is entirely mia in the search path
<clever> nixpkgs=/run/current-system/nixpkgs
<clever> $ echo $NIX_PATH
<clever> yikes, the nixops AMI has a configuration.nix file!
<clever> heh
<clever> gchristensen: this will fetch a specific version of nixpkgs (specified in a json file), and use that for the eval, and also embed that nixpkgs into the build and use it at runtime
<clever> /nix/store/wi7qr5ynv2d5m2ip9hkag05vf439hv8h-nixos-18.03pre114421.799435b7ca/nixos
<clever> [root@amd-nixos:~]# nix-repl '<nixpkgs>'
<clever> nix-repl> path
<clever> gchristensen: what about using pkgs.path after importing nixpkgs?
<clever> gchristensen: i think its legacy stuff, back from when nixos and nixpkgs had different repos
<clever> which works via this entry in the path
<clever> x:/nix/var/nix/profiles/per-user/root/channels
<clever> which would be <nixos>, the channel name
<clever> you want one directory up
<clever> gchristensen: <nixpkgs> returns the nixpkgs directory of the nixos channel