2020-08-02

<clever> there is also a shell script...
<clever> bootstrap/pack is the contents of the tar, bootstrap/on-server is the tar+busybox
<clever> [root@amd-nixos:~]# nix-build '<nixpkgs/pkgs/stdenv/linux/make-bootstrap-tools.nix>' -o bootstrap -A build
<clever> christianbundy: i see 28 binaries and 91 symlinks to play with argv[0]
<clever> that sounds kind of high...
<clever> ack, its a set, need the right -A flag
<clever> christianbundy: this will then build the bootstrap tar locally, so you can see what it contains
<clever> [root@amd-nixos:~]# nix-build '<nixpkgs/pkgs/stdenv/linux/make-bootstrap-tools.nix>' -o bootstrap
<clever> christianbundy: this expr is then used to create a new bootstrap-tools tar, to re-make the seed for future versions
<clever> christianbundy: and nix will reuse anything that hasnt been changed
<clever> christianbundy: each phase mocks out fewer ones, until everything has been rebuilt from source, as defined in nixpkgs
<clever> christianbundy: then when the code in lines 183-214 builds any attribute (other then binutils/libc/perl), it will use those mocked versions, while building the real gcc/coreutils and so on
<clever> christianbundy: lines 142-180 then create a dummy pkgs tree, with libc, gcc, binutils, coreutils, and gnugrep mocked out, to use the bootstrap-tools
<clever> christianbundy: this nix expr will return a 32bit busybox, but a tar containing the 64bit->64bit gcc
<clever> christianbundy: everything starts with a naked static busybox binary, and a tar containing gcc+libc and some very basic utils (cp and stuff)
<clever> ogkloo: does eth0 have ip ip? is it up or down? does `tcpdump -i eth0 -n` show packets going in both directions? does `ifconfig` show non-zero counters for both directions?
<clever> lsusb? `ip link` ?
<clever> ogkloo: got a usb keyboard to login with?
<clever> ogkloo: does the hdmi at least show something?

2020-08-01

<clever> there is a default priority for when you dont set one, mkDefault/mkForce then just set things to be lower/higher then that main default
<clever> Henson: yep
<clever> Henson: so if you set it 3 times, to [1], mkForce [2], and mkForce [3], you will get [2 3] out at the end
<clever> Henson: if you use mkForce, then it will still merge, but it will only merge the values you used mkForce on
<clever> exarkun: and 8-11, will respect virtualisation.virtualbox.host.package if you want to change the versions
<clever> exarkun: line 13-15 will grab the kernel virtualbox from your chosen kernel, and use .override to force it to use the virtualbox from line 8
<clever> exarkun: line 90 puts the right version into systemPackages, and line 89 puts the kernel modules into extraModulePackages
<clever> then click "declared in"
<clever> exarkun: https://nixos.org/nixos/options.html#virtualisation.virtualbox.host.enable
<clever> yeah
<clever> since the binary updates, but the kernel changes are delayed
<clever> you may also need to reboot if you changed nixpkgs
<clever> the enable flag in the nixos module installs the correct version for you
<clever> exarkun: you must also never put virtualbox into systemPackages
<clever> you must use the VirtualBox binary from the host
<clever> the vbox client and kernel module are non-compatible versions
<clever> thats your problem
<clever> exarkun: with virtualbox in the inputs?
<clever> exarkun: are you in a nix-shell?
<clever> taika: you can do that in the overlay, foo = (import /path/to/unstable {}).foo;
<clever> taika: read the nixos module for it, and then use an overlay to change that attr of pkgs
<clever> lorri may not run the shellHook
<clever> evanjs: are you actually running nix-shell on the right derivation?
<clever> evanjs: set -x
<clever> LouisDK: i'm not that familiar with hdhomerun hw
<clever> exarkun: what does `type VirtualBox` return?
<clever> ogkloo: the official raspbian image should fit on 8gig just fine
<clever> ogkloo: i'm thinking try the official raspbian image, to confirm the hardware is all good, then we can try to debug the nixos builds more
<clever> ack!
<clever> > The Raspberry Pi 3 Family is only supported as AArch64. Use as armv7 is community supported
<clever> ogkloo: try one of the 32bit images?
<clever> ogkloo: ^
<clever> okif /var is missing, then it likely didnt get very far in booting, which model of pi? what image did you flash to it?
<clever> ogkloo: try mounting the rootfs on the sd card, do you see anything new under var/log/journal/ ?
<clever> ogkloo: no other pi's either?
<clever> ogkloo: do you have a serial adapter for the pi?
<clever> ogkloo: ssh can still work, so try to grab a lsmod and see whats going on
<clever> ogkloo: you need the right kernel modules loaded for linux to take over the video after booting
<clever> evanjs: i have even used buitins.exec, its pure evil :P
<clever> with unpatched binaries
<clever> you may need to repeat these steps on another distro, and see how the output differs
<clever> balsoft: that looks like garbage data, that might be where the problem is
<clever> balsoft: we know its at 0x15e3510
<clever> balsoft: try using the addr in the previous paste
<clever> balsoft: try to disassemble that one next, and pastebin the whole body
<clever> balsoft: this util from gcc can un-mangle the symbol
<clever> [nix-shell:~]# c++filt _ZN8immersed17av_log_set_level_E
<clever> immersed::av_log_set_level_
<clever> balsoft: it tried to call a c++ function, log_set_level
<clever> exarkun: ^^
<clever> balsoft: the disassembly should have an arrow in it, what is the opcodes around the arrow?
<clever> balsoft: is the kernel module loaded? (check lsmod), how was virtualbox enabled and installed?
<clever> balsoft: got a pastebin with an error?
<clever> balsoft: not sure then
<clever> infinisil: has that text gotten more corrupted since i last saw it? :D
<clever> ,exec evanjs
<clever> balsoft: what about `d WebRTCFFmpegEncoder::WebRTCFFmpegEncoder()`?
<clever> balsoft: with the `d` command
<clever> balsoft: you may need `d WebRTCFFmpegEncoder::WebRTCFFmpegEncoder()`
<clever> balsoft: try `frame 1` then `d` to disassemble the function, what does it show?
<clever> balsoft: and the app then has to list them, and upload, when its functioning normally
<clever> balsoft: i think on its own, breakpad just allows coredumping with metadata about when/how, and listing those coredumps
<clever> whats the backtrace upon failure?
<clever> ah
<clever> balsoft: but it may be failing too bad to phone home, and might be failing within breakpad's own coredump generation
<clever> balsoft: if your seeing breakpad, then it must have reached main() i think, and setup the breakpad exception handlers
<clever> you did read that, right? :P
<clever> balsoft: its likely in the EULA you agreed to when downloading the app
<clever> balsoft: if breakpad is setup correctly (by the original creator of the app), it should have already sent the core file back to them
<clever> which is googles library for collecting coredumps and shipping them home automatically
<clever> balsoft: what files is it shipping?
<clever> balsoft: the filename looks like chromium/electron to me
<clever> balsoft: dont have source for what?
<clever> balsoft: i think the working dir needs to be within the source, so that relative path exists

2020-07-31

<clever> that only functions if you set it to relaxed
<clever> KarlJoad: there is a special attr you can add to a derivation, to request the sandbox to be off
<clever> srhb: and i think it even reaches to <nix/fetchurl.nix>
<clever> srhb: its hidden in the util function for downloading, so it even affects builtins.fetchTarball
<clever> srhb: there is even `nix-env -f channels:nixos-unstable` to generate that url automatically
<clever> ,pr dminuoso
<clever> yeah, since you where already declarative, you could re-create everything with 1 command
<clever> it often gets corrupt if you have an improper shutdown
<clever> so when you do `nix-env -i`, it knows what you had before
<clever> manifest.nix is how nix-env tracks imperative package management
<clever> `nix-env --list-generations` should show that
<clever> and if the target is missing, it will create an empty generation to start with, and begin again at 1
<clever> ~/.nix-profile says which profile to use
<clever> yep
<clever> you can gc after its fixed
<clever> if you gc'd, you would loose the home-manager binary
<clever> and then you would be even more stuck
<clever> you need to look in `ls -l /nix/store/*/bin/home-manager` to find the old home-manager binary
<clever> no need to gc, just home-manager switch
<clever> ah, should be fine then
<clever> `rm /nix/var/nix/profiles/per-user/little-dude/profile /nix/var/nix/profiles/per-user/little-dude/profile-32-link` will fix the problem, but remove everything you have installed in nix-env
<clever> it should only be 1 line
<clever> without a / at the end
<clever> ls -l ~/.nix-profile
<clever> is there only one generation?
<clever> little-dude: nix-env --list-generations ?
<clever> id say thats a bug that should be filed on nixpkgs
<clever> i think that option changes how grub works, and breaks extraConfig
<clever> mog: try removing line 4
<clever> mog: that doesnt sound right, which bootloader is enabled?
<clever> what did `nixos-rebuild switch` output?
<clever> no
<clever> mog: what does `ls -ltrh /boot/grub/grub.cfg` report?
<clever> mog: how did you confirm nothing was changed?
<clever> mog: nixos-rebuild always regenerates it at the end
<clever> because most firewalls include an allow-all rule for lo
<clever> any time your dealing with 127.0.0.1, it bypasses the firewall, usually
<clever> correct
<clever> QEMU_NET_OPTS="hostfwd=tcp::7777-:34782" ./result/bin/run-testvm-vm
<clever> the , is automatic
<clever> oh wait
<clever> QEMU_NET_OPTS=",hostfwd=tcp::7777-:34782" ./result/bin/run-testvm-vm
<clever> you used QEMU_OPTS to add a 2nd network card, and thats confusing things
<clever> yeah, you want to use $QEMU_NET_OPTS to insert flags into the existing -netdev
<clever> 373 "-netdev user,id=user.0\${QEMU_NET_OPTS:+,$QEMU_NET_OPTS}"
<clever> `ps aux | grep qemu`, i think you gave it 2 nics
<clever> eth0 and eth1 is fishy
<clever> id try a packet sniff then, from inside the guest, `tcpdump -i eth0` and see if you can detect the ssh attempt
<clever> dont believe it matters
<clever> ttys1: and does `ip addr` show an ip assigned to the guest?
<clever> this is what ive used in the past, to do similar
<clever> "-net" "user,hostfwd=tcp:127.0.0.2:2222-:22" "-net" "nic"
<clever> next, id check the guest side, `netstat -anp | grep 34782` inside the vm
<clever> yep, that part looks fine
<clever> does it say what its connecting to?
<clever> what about `ssh -v 127.0.0.1 -p 7777` ?
<clever> if you `ssh -v 127.0.0.1:7777` what does it say near the end?
<clever> its listening on any ip, so 127 and the local should work equally
<clever> ttys1: what does `netstat -anp | grep 7777` report?
<clever> ttys1: are you trying to ssh into 127.0.0.1?

2020-07-30

<clever> ,escape''
<clever> lejonet: the '' on line 97 marks the end of a nix string
<clever> nij: it should be listing search paths at some point
<clever> nij: with the other stuff, `gcc -v hello.c -o hello`
<clever> nij: run `gcc -v` and youll see what its doing
<clever> for everything in the buildInputs, plus glibc
<clever> nij: the stdenv sets up -I flags for you
<clever> disasm: ive done the same before with toxvpn
<clever> default was null, mkForce it back!
<clever> one second
<clever> disasm: there is an mkForce in the installer image, to stop sshd from starting on boot, because there is no pw setup

2020-07-29

<clever> moet: mkDerivation = args: dontCheck (doJailBreak (super.mkDerivation args));
<clever> moet: you can use a haskell overlay to mutate the mkDerivation function that everything goes thru
<clever> Guest79686: you can use overrideCabal to append to it, like you do with overrideAttrs
<clever> but you can replace it with a chroot, if you know what $PATH should be
<clever> bqv: nixos-enter does the chroot for you
<clever> sdisavona: i also find tab-completing under `nix repl '<nixpkgs>'` to be a far faster way of searching, and you can also read other info on the package, like wireshark.meta.description or wireshark.meta.homepage
<clever> (which i hadnt seen before, thats new)
<clever> and it also has a comment saying dont use wireshark-gtk
<clever> 19725 # The GTK UI is deprecated by upstream. You probably want the QT version.
<clever> 19726 wireshark-gtk = throw "wireshark-gtk is not supported anymore. Use wireshark-qt or wireshark-cli instead.";
<clever> sdisavona: if i then open that file, and read it, i can see its the other way around, wireshark-qt is the alias
<clever> 19723 wireshark-qt = wireshark;
<clever> 19720 wireshark = callPackage ../applications/networking/sniffers/wireshark {
<clever> typo in the name
<clever> nix-repl> builtins.unsafeGetAttrPos "wireshark" pkgs
<clever> { column = 3; file = "/nix/store/fgcadzm4mmfxkap2pxav1ff6irkw7hf1-nixos-20.09pre230335.9480bae3370/nixos/pkgs/top-level/all-packages.nix"; line = 19720; }
<clever> > builtins.unsafeGetAttrPosition "wireshark" pkgs
<clever> sdisavona: yeah, they are the same package, just different names
<clever> > pkgs.wireshark == pkgs.wireshark-qt
<clever> sdisavona: wireshark is just an alias, for people that dont know about wireshark-qt and wireshark-gtk
<clever> ,-A sdisavona
<clever> sdisavona: its often faster to just assume the package name is obvious
<clever> sdisavona: `nix-env -qa` will often hide any errors it encounters, so you dont get 3000's errors about every unfree package when unfree is blocked
<clever> karantan: which process is using it all when it fails?
<clever> karantan: it can sometimes happen if you have infinite recursion in your nix file, which proess is consuming all of the ram?
<clever> terribleArtist: you want myHsPkgs = haskellPackages.extend overlay; then use myHsPkgs.lens-family and so on
<clever> terribleArtist: lines 23-26 are using the old version, without the overlay
<clever> sdisavona: what about `nix-env -iA nixpkgs.wireshark` ?
<clever> > pkgs.haskell.lib.dontCheck
<clever> cabal2nix can also be used to use a non-official fork
<clever> terribleArtist: that changes the versions for datadog and buffer-builder, and disables testcases for both
<clever> terribleArtist: callHackage
<clever> sdisavona: yeah, i just use `nix edit` to learn how things work, but still install it with normal tools like nix-env -i
<clever> sdisavona: if you enable unfree packages, you can just `nix edit nixpkgs.teamspeak_client`
<clever> sdisavona: then you want to set that somewhere like /etc/profile, and point it to a config.nix file every user can read
<clever> sdisavona: that isnt whitespace, its an underscore
<clever> sdisavona: if you want to affect one user, ~/.config/nixpkgs/config.nix
<clever> sdisavona: if $NIXPKGS_CONFIG points to a file, it has priority over ~/.config/nixpkgs/config.nix and has the same syntax as config.nix
<clever> sdisavona: $NIXPKGS_CONFIG can supply an override for the config.nix path, and you could then set NIXPKGS_CONFIG globally
<clever> sdisavona: you can do that in config.nix, the error msg tells you how to do it with config.nix
<clever> sdisavona: you only have config.nix which is a different file
<clever> sdisavona: configuration.nix only has an effect on nixos
<clever> pjt_014[m]: it changes randomly
<clever> zeta_0: i dont think you need mkShell here, i think you need to look at the logs to see what is happening
<clever> ishan24: but was it started from the right nix-shell? try killing it and starting another in the nix-shell
<clever> zeta_0: does `lorri help` show anything log related?
<clever> ishan24: `ps aux | grep clangd`
<clever> zeta_0: what happens if you run `lorri log` ?
<clever> zeta_0: have you checked the lorri logs?
<clever> ishan24: but is clangd being started from a nix-shell that has those packages?
<clever> zeta_0: that looks like it should work fine
<clever> ishan24: is the clangd running within the nix-shell? it may be in a different shell and lack those packages
<clever> pkgs.haskellPackages.yesod
<clever> put yesod into the buildInputs
<clever> terribleArtist: you should just have a ghc in $PATH then
<clever> terribleArtist: ah, the ghc= is in a let block, so it can only be referenced by nix code, line lines 14/22
<clever> terribleArtist: can you pastebin the shell.nix?
<clever> terribleArtist: and if you `echo $ghc` in the shell?
<clever> terribleArtist: how did you add it to shell.nix?

2020-07-28

<clever> MarcWeber: only `nix-shell -p library` will setup -I properly
<clever> ,libraries MarcWeber
<clever> duairc: nix-build -E 'with import <nixpkgs> {}; callPackage ./foo.nix {}'
<clever> can even be 1 line, doesnt need newlines
<clever> then youll need the unpackPhase to keep the mess contained
<clever> lordcirth: the zip file should contain a single directory with all of the src, not multiple directories
<clever> lordcirth: yep
<clever> lordcirth: if you add unzip to the buildInputs, unzip becomes automatic
<clever> lordcirth: callPackage deals with the arguments on line 1 of foundry-vtt.nix
<clever> lordcirth: you likely dont need that unpackPhase either
<clever> lordcirth: the import is just shoving the raw function from line 1 into the list
<clever> lordcirth: you want pkgs.callPackage
<clever> oops, no
<clever> lordcirth: parens
<clever> callPackage instead adds override to each attr, so it works more normally
<clever> you would need to `many = callPackage ./many.nix {}; (many.override ...).a`
<clever> but if you inherit (callPackage ./many.nix {}) a b c; you loose the override
<clever> callPackage will basically // { override = ...; } to the result
<clever> yorick: (facepalm)
<clever> yep
<clever> yorick: all of my experience is just bare firmware+linux
<clever> yorick: and i'm not familiar with how uboot interacts with everything on the pi+nixos
<clever> yorick: a pi3 cant boot without start.elf, are you maybe looking in the wrong directory?
<clever> yorick: start.elf and fixup.dat are a matched pair and must always be together, the rest is fairly flexible
<clever> yorick: sounds like the firmware in /boot/ is mixed up some
<clever> yorick: thats not right, that implies something isnt right with device-tree
<clever> yorick: poke around , is system in another dir?
<clever> yorick: and also `hexdump -C /proc/device-tree/system/linux,revision` ?
<clever> yorick: can you add `lsmod` to the gist?
<clever> revision shouldnt be 0
<clever> yorick: is the ethernet driver built into the kernel or a module in `lsmod` ?
<clever> yorick: yeah, everything looks normal, all i can guess is that the kernel/drivers arent right
<clever> yorick: ah, i want compatible, not vid/pid
<clever> yorick: they should be in /proc/device-tree/soc/usb@7e980000/usb1@1/usbether@1/
<clever> you can also use `hexdump -C` to dump any binary files
<clever> yorick: what is the vid/pid under usbether@1?, what does lsusb report?
<clever> yorick: ip6tnl0 is an unrelated interface
<clever> yorick: can you pastebin the `ip addr` ?
<clever> yorick: that doesnt sound right
<clever> yorick: is it giving a random mac on every boot? what are the contents of local-mac-address?
<clever> yorick: yeah
<clever> so you can undo the removal
<clever> even if you remove something with `nix-env -e foo`, the generations and rollbacks keep it around
<clever> nix-env requires you to uninstall it with -e and then delete generations, before it can be GC'd
<clever> nij: if you just want to test something, use nix-shell or `nix run`
<clever> nij: add things to environment.systemPackages in configuration.nix
<clever> lb5tr: nix uses the path to a filename to cache the result of parsing things, you need :r to clear that cache

2020-07-27

<clever> Graypup_: haskell.lib.justStaticExecutables

2020-07-26

<clever> [clever@system76:~]$ ls -ld /etc/ssh
<clever> drwxr-xr-x 3 root root 11 Jul 13 03:27 /etc/ssh
<clever> and for multi-line files, it matters less
<clever> editors and echo tend to add that junk at the end
<clever> so if you read a "12\n" into nix, it becomes "12"
<clever> ornxka: fileContents just deletes the trailing \n at the end of the string
<clever> fileContents = file: removeSuffix "\n" (builtins.readFile file);
<clever> ornxka: builtins.readFile ./file
<clever> they would have happened at nixos-rebuild time, if you tried to do them after installing
<clever> but most of the problems you appear to have run into, arent related to installing
<clever> the learning curve is a bit steep

2020-07-25

<clever> it doesnt depend on the mess of config from past versions
<clever> and also how each version is self contained and pure
<clever> yeah
<clever> same, ran into that on both ubuntu and gentoo
<clever> everything nix creates is read-only
<clever> and then you get into problems where you need wifi to fix the wifi
<clever> installingNIX: yeah, if nix manages the wifi config, you have to nixos-rebuild to change the wifi config
<clever> password
<clever> installingNIX: so i can add a pw, without having to nixos-rebuild, which can be a problem, when you dont have internet
<clever> installingNIX: personally, i use naked wpa_supplicant, with /etc/wpa_supplicant.conf not managed by nix