2018-05-10

<clever> the only time it wont exist is when your inside a sandboxed build
<clever> cheater: nixos always has this symlink
<clever> lrwxrwxrwx 1 root root 66 May 1 07:26 /usr/bin/env -> /nix/store/qrxs7sabhqcr3j9ai0j0cp58zfnny0jz-coreutils-8.29/bin/env
<clever> qenuh: nope
<clever> qenuh: try using cleanSource and see if it makes a difference
<clever> and if its unpatched, env just searched PATH for you
<clever> cheater: nix will then patch it with an absolute path in the fixup phase
<clever> cheater: i always use #!/usr/bin/env bash
<clever> callCabal2nix "name" (lib.cleanSource ./haskell) {}
<clever> qenuh: run lib.cleanSource over the source dir before you pass it to callCabal2nix
<clever> nix will just keep going on that new profile
<clever> (and it wont exist, thats normal)
<clever> if you delete that, and replace it with a symlink pointing to newprofile
<clever> normal ^^
<clever> lrwxrwxrwx 1 clever users 45 Oct 29 2017 .nix-profile -> /nix/var/nix/profiles/per-user/clever/profile
<clever> if you intentionally symlink it to a different profile in the same area, it would probably work
<clever> and nix.sh will repair the symlink, and restore evrything
<clever> infinisil: .nix-profile points to a place in /nix/var/nix/profiles/
<clever> infinisil: the solution, is to add a special #define at compile time, which makes glibc use readdir64 rather then readdir, but it also changes the size of some typedefs, which might break software
<clever> infinisil: and xfs inodes easily go over 4 billion on a 2tb disk
<clever> infinisil: that error happens if you have a 32bit nfs client talking to a 64bit nfs server, and your inode numbers dont fit inside 32bits
<clever> infinisil: it silently treats the directory as empty
<clever> infinisil: 80% of nixpkgs already fails to build if you get EOVERFLOW from readdir()
<clever> or "${python}/bin/python"
<clever> cheater: wrap it with " and "
<clever> mattyu: nix2 has a bug when dealing with dead symlinks in your nix profile
<clever> infinisil: its possible that your causing infinite recursion?
<clever> maybe its stackage i'm thinking of, not hackage
<clever> different versions of cabal2nix?
<clever> what ones dont you see?
<clever> 1.89mb
<clever> i think it was mostly just a side-effect of some recent changes, using stack as a library
<clever> with the versions pinned to what you specified
<clever> but with the latest version, it has every single package from hackage
<clever> with the old stack2nix, it only contained the closure of your project, so it was relatively small
<clever> yep
<clever> infinisil: we always commit it, because it cant be generated in a pure manner, so hydra requires it
<clever> the above url is about 20mb for nixpkgs i think
<clever> infinisil: if your not getting history, dont even bother with git
<clever> also, if you do a shallow clone then deepen it, that makes the load on github worse then if you just did a full clone :P
<clever> rename the input directory, it cant start witha .
<clever> day|flip: pkgs.stdenv
<clever> day|flip: its also a lot more readable like this: https://gist.github.com/cleverca22/5db384beaaed0aae12be0bd125681c32
<clever> and un-quote it
<clever> day|flip: your missing a src=
<clever> day|flip: can you gist your current nix expression?
<clever> day|flip: sourceRoot must be a relative path, and it must refer to whatever unpacking the source created

2018-05-09

<clever> for the kernel itself, i think you can run nix-shell against one of the kernels, like my original example, and then run patchPhase in there to edit the copy of the source in the working directory
<clever> foldingcookie: aarch64-android-prebuilt, aarch64-multiplatform or aarch64-multiplatform-musl can be used for arm, in-place of raspberryPi
<clever> foldingcookie: what cpu are you trying to target?
<clever> foldingcookie: it applies the patches in a copy of the source
<clever> when correctly ran
<clever> foldingcookie: the nix expressions automatically patch the kernel source
<clever> foldingcookie: everything in nix works by configuring $PATH
<clever> foldingcookie: nothing will create a suitable /bin
<clever> foldingcookie: (import <nixpkgs> { crossSystem = (import <nixpkgs/lib>).systems.examples.raspberryPi; }).linuxPackages_rpi.kernel
<clever> :D
<clever> i havent ran it in a while
<clever> yeah, i would expect it to also have that
<clever> but i think the p2p bootstrap uses dns to find a stable node, and then the rest of the world
<clever> probably
<clever> anybody with knowledge of the protocol can probably iterate those, and download all of your shared files
<clever> sphalerite: second, it also publishes the hashes of every file and block you are sharing
<clever> sphalerite: first, the node generates a keypair on first startup, and posts a pubkey=$MYIP to the DHT on every startup, so you can now be tracked at all times
<clever> sphalerite: there are also some minor security issues ive noticed with the IPFS protocol
<clever> sphalerite: id use IPFS if possible
<clever> sphalerite: :D
<clever> very
<clever> judson: i dont think nixops has an option for that, youll need to manually resize it in the aws console
<clever> judson: resizing the disk?
<clever> several IP's behind a single name
<clever> round-robin
<clever> sphalerite: in theory, you could setup some RR dns for your http server?
<clever> write a bash for loop that echo's to one terminal, then paste paste paste?
<clever> cacti and other tools can graph the bytes/sec on every physical port
<clever> oh, also turn on snmp
<clever> unplug something and diff
<clever> it should also show the link status of each
<clever> yeah, thats what i was going to find the name of
<clever> let me plug my catalyst back in...
<clever> sphalerite: one sec
<clever> sphalerite: you can also type ? at any point to trigger "tab" completion
<clever> sphalerite: i think you also need to do `configure terminal`
<clever> sphalerite: what does the prompt say?
<clever> samueldr: 1.8v??, thats fairly low
<clever> samueldr: have you considered using my qemu-user stuff to build the kernel and system image?, and is that running nixos on the switch?
<clever> samueldr: nice
<clever> serentty[m]: but the boot rom and signing hasnt been fully defeated, and it can only boot unsigned code over usb, and once rebooted, the stock OS is back
<clever> serentty[m]: that hidden debug mode has already been found, short out 2 pins on the right connector, and it will run unsigned code shoved over the USB port
<clever> ok, thats a bigger network then mine :P
<clever> sphalerite: another handy thing, you can set an IP on the switch and enable telnet (and probably ssh on a newer model then mine), then get console over that
<clever> and "disable" undoes it
<clever> sphalerite: and "enable" is cisco for "sudo"
<clever> sphalerite: if its cisco, the keywords you want are: spanning-tree portfast
<clever> sphalerite: is it a cisco product?
<clever> nyanloutre[m]: i suspect nixos will still insist that you also listen on a tcp port, so just set it to some dummy value and dont open that on the firewall
<clever> nyanloutre[m]: services.nginx.virtualHosts."www.example.com".extraConfig = "listen unix:/path/to/socket;";
<clever> sphalerite: fun
<clever> nyanloutre[m]: i think if you just use the virtualhost .extraConfig, you can inject the right nginx config line for that
<clever> but if i put a dumb switch between the computer and managed switch, it works instantly
<clever> and so, the machine just never boots
<clever> and upon rebooting, it disables the link, resetting the 15 second timeout
<clever> my bios also gives up booting if it doesnt get a reply within ~10 seconds
<clever> on my switch, it doesnt forward packets until the port has been live for ~15 seconds, and it has had time to detect a cycle
<clever> its a managed-switch feature that detects if you create cycles in your network, and auto-disables a port to keep things in a tree
<clever> STP is another name for it
<clever> sphalerite: is SPAN enabled?
<clever> sphalerite: do you have a managed switch?
<clever> and half of nixos treats EOVERFLOW as an empty dir
<clever> if you have a 64bit nfs server, and inodes go over 4 billion, then a 32bit nfs client fails with EOVERFLOW when you readdir()
<clever> nfs left a bad taste in my mouth after 32bit failed so badly with inodes
<clever> and line 142 could be replaced with curl
<clever> sphalerite: check the 2 links i just pasted
<clever> sphalerite: ahh
<clever> Dezgeg: i did similar in my rpi, one min
<clever> sphalerite: that ensures the init= is always valid
<clever> sphalerite: the netboot expression in nixos auto-generates an ipxe script you can chainload
<clever> betaboon: yeah
<clever> betaboon: nix-env -iA nixpkgs.nix is all you need to do on a single-user setup
<clever> betaboon: what sphalerite said
<clever> betaboon: was nix in the storepath that foo.nix builds?
<clever> yep
<clever> still pretty much identical to what you typed
<clever> i think line 696 is when it does it to a remote system
<clever> ah, thats the local rollbacks though
<clever> sphalerite: i think nixops does something very similar
<clever> sphalerite: that sounds like it would work
<clever> the input argument
<clever> steveeJ: yeah
<clever> steveeJ: for overrides, its typically called pkgs, and you can just change the 2 super's in my example to pkgs
<clever> steveeJ: haskellPackages = super.haskellPackages.override { overrides = hsself: hssuper: { gitit = super.haskell.lib.overrideCabal hssuper.gitit (drv: { ...
<clever> Dezgeg: yeah, i was also thinking of a sleep in stage-1-init.sh
<clever> sphalerite: i think this can greatly slow down the backtrace as it panics
<clever> let me check the kernel docs...
<clever> baud rate?
<clever> sphalerite: how did you capture the console output?
<clever> sphalerite: yeah, that is a bit weird
<clever> sphalerite: id try adding boot.debug1mounts to the kernel params, and then confirm that $stage2Init exists within /mnt-root/
<clever> yorick: ah, if you blow away ~/.cache/nix/tarballs then nix will forget about all cached downloads
<clever> yorick: update the channel url, or change a channel you are hosting?
<clever> yorick: i believe the ttl is only an hour
<clever> sphalerite: the ipxe embeded script says to run boot.ipxe, which doesnt exist in your tftproot derivation, and you also have grub config mixed in
<clever> ah, *looks closer*
<clever> sphalerite: and line 46 gives it a relative path, so ipxe continues to fetch those files over http
<clever> sphalerite: my dhcp config detects that ipxe is working, and switches it over to an http based script
<clever> sphalerite: i always switch to http once ipxe is running
<clever> silver_hook: services.locate.enable = true;
<clever> silver_hook: chsh is setuid root on most systems, so it is free to edit /etc/passwd
<clever> steveeJ: change your shell
<clever> silver_hook: the backend may need to be packaged first
<clever> silver_hook: same for imagescan
<clever> silver_hook: epson2 isnt even a valid package
<clever> silver_hook: checking the source of mkSaneConfig, it looks like all valid entries in extraBackends must contain either a lib/sane or an etc/sane.d directory
<clever> Myrl-saki: and .overrideDerivation overrides it deeper, after mkDerivation has re-arranged some things, when its about to call something internal
<clever> Myrl-saki: .overrideAttrs will override the attrset passed to mkDerivation
<clever> Myrl-saki: .override can only change the arguments passed into the file, the same ones callPackage overrides
<clever> or .override as well if its already been callPackage'd
<clever> Myrl-saki: if you want to force something to switch to clang, yeah, that should just work
<clever> Myrl-saki: clangStdenv.mkDerivation ?
<clever> butchery: should be as simple as formatting the USB stick as normal, mounting it to /mnt, and then doing nixos-generate-config --root /mnt and nixos-install --root /mnt/
<clever> butchery: then you will have a custom USB that boots into that config on any machine
<clever> butchery: using a second machine (even a fully working nixos), you can run nixos-install against a usb stick, and use whatever config you want, and setup sshd and passwords
<clever> thats better
<clever> allana: its in the package called net-tools, add that to buildInputs
<clever> allana: you probably want builtins.getEnv "HOSTNAME" which reads the env var at eval-time
<clever> allana: nix sets the hostname to localhost inside builds, so even if you had the tool, it wont give the expected values
<clever> angerman: it also includes an lz4 fix
<clever> angerman: all it does is switch to cmake, g++ then fails due to args cmake gave it
<clever> teto1: oh, debug1 stops too soon, and you lack drivers
<clever> x86_64-pc-mingw32-gcc: error: unrecognized command line option '-rdynamic'
<clever> angerman: it is now running cmake on rocksdb
<clever> copying path '/nix/store/9hmhxgj4jk6jmxihgavj6gm0p759misc-cmake-3.10.2' to 'ssh://builder@amd.localnet'...
<clever> angerman: the desktop puts out a decent amount of heat, and i keep the thermostat a tad high
<clever> "2018-05-09 03:11:02 bedroom temp: 22.44c(72.39f), kitchen: 18.12c(64.62f), living room: 18.69c(65.64f), outdoor: 8.62c(47.52f), server: 22.38c(72.28f) VCC: over 4.5 volts portb: 00000000"
<clever> "/home/clever/iohk/nixpkgs/pkgs/development/libraries/rocksdb/default.nix:82"
<clever> nix-repl> pkgs-x.rocksdb.meta.position
<clever> ah
<clever> that feels linux-only
<clever> ./util/arena.h:16:10: fatal error: sys/mman.h: No such file or directory
<clever> building '/nix/store/pkqm6gph2mhrsqbsq9ya1ybnf9vbc17k-rocksdb-5.11.3-x86_64-pc-mingw32.drv' on 'ssh://builder@amd.localnet'...
<clever> a 1 line patch
<clever> lz4 now builds
<clever> etu: lol
<clever> its 3am, lol
<clever> typo
<clever> lz4 supports multiple compressions?
<clever> lz4io.c:69:14: fatal error: Windows.h: No such file or directory
<clever> i'm getting lz4 failures
<clever> nix-repl> :b pkgs-x.rocksdb
<clever> [clever@system76:~/iohk/cardano-cross]$ nix repl default-lts-2018-05-02.nix -I hackage=../hackage.nix -I stackage=../stackage.nix -I haskell=../haskell.nix -I nixpkgs=../nixpkgs
<clever> 53 } // { pkgs-x = pkgs; }
<clever> git shouldnt even be cross-compiled either
<clever> there is no reason either of them needs to run perl on the windows machine
<clever> that also needs the native version
<clever> set it to use the native perl
<clever> its likely a build-time dep, that was improperly marked
<clever> it shouldnt be needed
<clever> what depended on perl?
<clever> what args do i import <nixpkgs> with to make it cross-compile to windows?
<clever> add a -v to that cp and see what it copied
<clever> it could contain anything
<clever> cp -R perl-cross-${crossVersion}/* perl-${version}/
<clever> and only when cross-compiling
<clever> elvishjerricco: tthe postUnpack hook patches things...
<clever> and autoFormat likely wont find it if its not yet formatted with the given label
<clever> yeah
<clever> and i dont see any signs of it being used in autoFormat
<clever> jD91mZM2: it also auto-configures to mount via /dev/disk/by-label/${label}
<clever> another option is to create an attrset or buildEnv in config.nix, and then install that
<clever> !-A
<clever> that command is also a lot slower, because it checks every single package, in every channel
<clever> it will check all channels, but i dont know what the priority is
<clever> and its best if you always manage the channels as root
<clever> nixos will always use the channel called nixos
<clever> and `nix-env -iA nixos.hello` to install the stable version
<clever> krkini: if you `nix-channel --add https://nixos.org/channels/nixpkgs-unstable unstable` then you can just `nix-env -iA unstable.hello` to install the unstable version of hello
<clever> krkini: what does `sudo nix-channel --list` say?
<clever> elvishjerricco: yes
<clever> judson: resize the EBS in the AWS console, then reboot the maching, and it will resize itself automatically
<clever> judson: ec2 machines can be resized to have more space
<clever> https://howoldis.herokuapp.com/ might link that
<clever> there is a json file somewhere that tracks the head of each channel

2018-05-08

<clever> judson: how many system links exist?
<clever> judson: as root, on the remote machine, run this: ls -l /nix/var/nix/profiles/
<clever> judson: have you tried a nix-collect-garbage on the remote machine?
<clever> Guest16351: configuration.nix only has an effect when running nixos, which is already a multi-user setup
<clever> fearlessKim[m]: if you re-run nixos-generate-config, i think it will update /etc/nixos/hardware-configuration.nix to include usb drivers
<clever> fearlessKim[m]: ah, you need to add usb drivers to the initrd
<clever> then you can run fsck there, and exit the shell to resume booting
<clever> fearlessKim[m]: if you boot with boot.debug1 added to the kernel params, it will drop you into a shell in the initrd
<clever> leary`: $IN_NIX_SHELL
<clever> anything in /lost+found/ ?
<clever> whens the last time you ran an fsck?
<clever> fearlessKim[m]: which FS are you using?
<clever> fearlessKim[m]: nix doesnt allow unreadable files in the store, so that sounds like filesystem corruption
<clever> fearlessKim[m]: if you change the -q to -r and run it on your own machine, what happens?
<clever> spwx: nixos-18.03 is the name of the latest stable channel for nixos
<clever> fearlessKim[m]: that command wont build the derivation, so it can point to paths that dont exist locally
<clever> spwx: nix-channel
<clever> there is a signing bug between nix-serve and nix2.0
<clever> try turning nix-serve back on, then give me the URL and a storepath
<clever> try turning nix-serve back on, then give me the URL and a storepath
<clever> do you still have a nix-serve online and publicly accessible?
<clever> what has failed so far?
<clever> why are other paths coming up as corrupt and why are you trying to copy all?
<clever> that does sound odd
<clever> can you paste 1 or 2 as examples?
<clever> does it say which files are writable?
<clever> or the store not being mounted right and somebody went on a chmod spree
<clever> but that can be a result of unfinished builds
<clever> mightybyte: nothing in /nix/store/ should be writable
<clever> thats the default value
<clever> ive got [ "amdgpu" ] for my videoDrivers, with a radeon R7 card
<clever> though that might be tricky when its hung
<clever> blum: and also check `lsmod | grep nv`
<clever> blum: run this: `nixos-option services.xserver.videoDrivers`
<clever> blum: you can now try turning things back on, and use the generations in grub to revert those changes, then inspect the logs in journalctl
<clever> mightybyte: nix-store --query --roots will tell you why its in use
<clever> mightybyte: all i can think of is to `nix-store --delete` or `nix-store --repair-path` the corrupted element
<clever> switch wont work right
<clever> blum: and also you need to use `nixos-rebuild boot` when inside the chroot
<clever> sgillespie: nix-shell --run zsh maybe?
<clever> blum: it was renamed to a seperate tool, nixos-enter
<clever> maybe
<clever> Myrl-saki: though you could maybe use builtins.exec and friends to do abnormal things
<clever> Myrl-saki: not really
<clever> blum: the nixos-install command just runs nixos-rebuild in a chroot
<clever> try turning it off and see what effect it has
<clever> is xserver enabled in configuration.nix?
<clever> what about non-ascii characters in the password?
<clever> and you gave it a root pw when nixos-install was done?
<clever> blum: which user are you trying to login as?

2018-05-07

<clever> freusque: it has to be in nix.conf when you run the GC
<clever> sphalerite: i worked with Myrl-saki a few days ago to create a fake nix-store bash script that would use nix-user-chroot to enter a chroot, and run the real nix-store
<clever> sphalerite: i think Myrl-saki recently set that up
<clever> sphalerite: couldnt get to sleep
<clever> so the act of making a given frame you just render visible, also clears the frame, right as you make it visible, lol
<clever> clearing the whole screen
<clever> years after giving up on fixing that i found the problem, when you use the GPU function to reconfigure the framebuffer (to adjust scroll), it re-allocates the framebuffer ram
<clever> and then it scrolls up/down 1 whole screen, to flip
<clever> android implements page flipping by configuring the framebuffer to have a virtual height that is twice the screen height
<clever> ive had fun trying to debug why page flipping didnt work in the android drivers for framebuffers on the rpi before
<clever> once the variant on nixpkgs passes tests, the version that passed is pushed to nixpkgs-channels
<clever> the one on nixpkgs is ahead of nixpkgs-channels and untested
<clever> the above cmd will also show its current value
<clever> did you set it to anything? is it using the default?
<clever> there should probably be some matching lines in dmesg and/or `journalctl -t kernel -b 0`
<clever> yeah
<clever> the journal should also have events from that timestamp