2018-11-14

<clever> PolarIntersect: what happens if you just leave the videoDrivers field unset?
<clever> what does lspci report?
<clever> you only have the nvidia driver enabled, and it didnt detect anything, so xorg shut off
<clever> 437 displayManager.slim.enable = true;
<clever> slim is slim
<clever> PolarIntersect: try switching to slim and see what the difference is
<clever> PolarIntersect: which display manager are you using?
<clever> that will show only 1 unit, and limit it to the current bootup
<clever> journalctl -u display-manager -b 0
<clever> the kernel supports full 2d graphics, and is taking advantage of that to give a high-res text console
<clever> thats the modesetting drivers
<clever> and those are half of what your missing
<clever> PolarIntersect: in my case, slim must run X with these args for it to work
<clever> xserver_arguments -config /nix/store/y9a7mwc8khh94fhn1csqb0r788nj4v6s-xserver.conf -xkbdir /nix/store/92if66bdzz2rcr3zjb1bibbxmrripsrn-xkeyboard-config-2.24/etc/X11/xkb -logfile /dev/null :0 vt7 -verbose 3 -nolisten tcp -terminate
<clever> [clever@amd-nixos:~]$ grep xserver_arguments /nix/store/229c1v4niq50i3qr887mmm8dmn6bcfls-slim.cfg
<clever> Environment="SLIM_CFGFILE=/nix/store/229c1v4niq50i3qr887mmm8dmn6bcfls-slim.cfg"
<clever> [clever@amd-nixos:~]$ grep SLIM_CFG /etc/systemd/system/display-manager.service
<clever> PolarIntersect: there are a lot of special paths that have to be setup for it to find anything (hence, the nv not being found)
<clever> PolarIntersect: xinit isnt supported on nixos
<clever> PolarIntersect: can you pastebin your configuration.nix?
<clever> PolarIntersect: why are the logs going to $HOME?
<clever> [ 1037.927] (EE) Please also check the log file at "/home/polar/.local/share/xorg/Xorg.0.log" for additional information.
<clever> PolarIntersect: is X being ran by systemd?, why does it lack permission to open some things?
<clever> [ 1037.927] (EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)
<clever> PolarIntersect: you can also `journalctl -u display-manager`
<clever> PolarIntersect: can you pastebin the journal logs?
<clever> PolarIntersect: videoDrivers = [ "nvidia" ] automatically installs the correct drivers
<clever> PolarIntersect: note, xorg also has its own modules, seperate from kernel modules
<clever> not sure
<clever> even a bare haskellPackages.ghc still has the boot packages
<clever> haitlah: i dont think you can, its required for ghc to work
<clever> the error is likely due to there being 2 mtl's (the bootpkg and the one from the haskellPackages set)
<clever> haitlah: but the boot packages (that are baked into the ghc derivation) lack that hash
<clever> haitlah: all packages built by nix have that extra hash on the end
<clever> and you can always switch back to 18.09 if you do have trouble
<clever> kingemp: i just run unstable on all of my machines, its surprisingly stable
<clever> and if ran without root, it will cause confusion due to 2 channels called nixos
<clever> if ran as root, that will switch the entire system to unstable
<clever> kingemp: which channel are you on?
<clever> its visible in the local nix repl
<clever> :S
<clever> > pkgs.mkl
<clever> /home/clever/apps/nixpkgs/pkgs/top-level/all-packages.nix: mkl = callPackage ../development/libraries/science/math/mkl { };
<clever> $ grep math/mkl ~/apps/nixpkgs -r
<clever> (which may be <nixpkgs>)
<clever> leotaku: and nixos-rebuild will use <nixos> in $NIX_PATH by default
<clever> leotaku: nope, they get the pkgs from config.nixpkgs.pkgs, which itself comes from the nixpkgs that nixos itself is in
<clever> NickHu: not sure on that
<clever> i believe they are all standard
<clever> exactly
<clever> and its a var (line 3) so it can target another user easily
<clever> it expects the username to be clever on the build system, and example on the target
<clever> NickHu: oh, some of those clever's should be example's
<clever> Unode: cc ^^^
<clever> put the same override into your local config.nix, to ensure nix doesnt un-patch itself, and install anything else you want
<clever> and it will just work
<clever> so now you copy /home/clever/rootfs/home/clever/nix to /home/clever/nix on a remote machine
<clever> then i use that standard nix build, to build nix, with a .override, to bake those changes into the resulting binary
<clever> and due to the chroot, its actually /home/clever/rootfs/home/clever/nix/store/
<clever> so a standard nix build, can act on /home/clever/nix/store
<clever> NickHu: NIX_CONF_DIR, NIX_LOG_DIR, NIX_STORE, NIX_STATE_DIR, all mutate where the local nix thinks things are, for its next build
<clever> NickHu: the NIX_REMOTE will tell the local nix, to chroot into /home/clever/rootfs
<clever> NickHu: found it
<clever> qyliss^work: ld.so is responsible for "interpreting" the elf, and performing dynamic linking
<clever> qyliss^work: its set to the path of ld.so
<clever> qyliss^work: elf files still have a interpreter
<clever> ive written the nix expressions already
<clever> one sec
<clever> you can build a nix with nix, that has different paths
<clever> --store works for downloading and i think building, but running itself will try to read /nix/store based paths
<clever> ah
<clever> NickHu: ah, then you mayb want a user namespace, look into nix-user-chroot
<clever> NickHu: but if you manually create a /nix and chown it to the right user, it wont ask for sudo
<clever> ottidmes: that both helps (you can verify the binary of a msg when filtering), and harms (journald now thinks your filter prog is the only thing logging)
<clever> ottidmes: also of note, unix sockets allow you to query the PID of the remote process
<clever> ottidmes: yeah, you would have to undo the symlink when turning the filter program off
<clever> ottidmes: you could probably also just overwrite the /dev/log symlink
<clever> and you must wipe the local cache
<clever> if the cache claims a given file exists, nix will hard fail when you GC that file from the cache
<clever> ive also had trouble with the positive ttl before, due to hydra GC
<clever> ive seen ttl ooptions for both postive and negative ttl
<clever> yeah, -vvvvv should mention that
<clever> ah, nvm, negative cache stored
<clever> copumpkin: have you checked the .narinfo url?
<clever> fresheyeball: the fix is definitely on nixos-unstable
<clever> fresheyeball: if you get a python3 error in the stdout of steam (run it in a terminal) then you need to update nixpkgs
<clever> fresheyeball: ive had one or 2 games in my library work
<clever> sirkha: do you have a ~/.nixpkgs/config.nix or ~/.config/nixpkgs/config.nix?
<clever> thedavidmeister: Linux system76 4.14.67 #1-NixOS SMP Fri Aug 24 11:09:23 UTC 2018 x86_64 GNU/Linux
<clever> thedavidmeister: let me see what kernel i'm on...
<clever> thedavidmeister: aha
<clever> thedavidmeister: try switching to slim for example, just temporarily
<clever> samueldr: oh, that could be it
<clever> thedavidmeister: try also commenting out the layout and libinput
<clever> the default shows messages for me
<clever> thedavidmeister: you have verbose = 0;, that would explain why all logs are missing
<clever> thedavidmeister: ssh into the laptop from another system, scp can copy files, gist can upload from the CLI
<clever> thedavidmeister: can you pastebin the entire hardware-configuration and configuration.nix files?
<clever> thedavidmeister: was there anything else in the logs that you omited?
<clever> ottidmes: run nix-store -qR on the storepath, then grep ALL of those for /dev/log
<clever> thedavidmeister: there should be a lot more in the journal then what you listed above
<clever> thedavidmeister: what display manager did you configure?
<clever> ottidmes: :D
<clever> thedavidmeister: nix-store --verify --check-contents
<clever> it should also include logs for the whole session
<clever> journalctl -u display-manager
<clever> thedavidmeister: what does it mention in the journal?
<clever> ottidmes: after xorg loaded all the drivers, and probed hardware, it unloaded modesetting, so thats definitely not in use
<clever> Oct 30 07:09:46 system76 X[4073]: (II) Unloading modesetting
<clever> i should test it out and see how it performs
<clever> thats interesting, thats an nvidia api...
<clever> Oct 30 07:09:46 system76 X[4073]: (II) intel(0): [DRI2] VDPAU driver: va_gl
<clever> Oct 30 07:09:46 system76 X[4073]: (--) intel(0): Output eDP1 using initial mode 1920x1080 on pipe 0
<clever> ottidmes: looks like it went with intel
<clever> Oct 30 07:09:46 system76 X[4073]: (**) intel(0): Found backlight control interface intel_backlight (type 'raw') for output eDP1
<clever> 00:02.0 VGA compatible controller: Intel Corporation Device 591b (rev 04)
<clever> checking to see what its using...
<clever> thedavidmeister: heh, i'm still on the default, and it works perfectly
<clever> nix-repl> config.services.xserver.videoDrivers
<clever> [ "ati" "cirrus" "intel" "vesa" "vmware" "modesetting" ]
<clever> thedavidmeister: let me check mine
<clever> nh2: ah, i had seen that before, but couldnt remember the right name to search for, but i'm nnnnnnnnnnnnnnnnot sure how to use it right now: https://github.com/NixOS/nixpkgs/blob/dd3aca2d0b9dcb4888779bfb08805d79596607c9/pkgs/top-level/stage.nix#L98-L103
<clever> thedavidmeister: ive got no issues on my system76 machine

2018-11-13

<clever> nh2: i leave that enabled on most machines, and it makes it trivial to inspect an unexpected chrome segfault
<clever> nh2: if you flip this on, and `ulimit -c unlimited`, then systemd will save coredumps for everything, you can then use `coredumpctl gdb <pid>` as root to inspct how it failed
<clever> believe*
<clever> ottidmes: oh wait, not `return -ENOENT;` its `errno = ENOENT; return -1;` i belibe
<clever> ottidmes: also, double-check what the real connect returns if you give it a socket that doesnt exist
<clever> ottidmes: try just returning -ENOENT, dont remap it to another path
<clever> nh2: only compiled things would avoid the dynamic issue
<clever> nh2: oh, and ghci will likely have a lot of the same problems, because its dynamic loading
<clever> nh2: try it only for the binary that uses malloc_info, dont set the var with export
<clever> but that gives me another idea, what if you just prefix LD_LIBRARY_PATH right, or LD_PRELOAD the new glibc, for just the one binary that needs it?
<clever> sort of, you would have to manually run that after every `cabal build`
<clever> nh2: its basically just cat $in/bin/foo | sed > $out/bin/foo
<clever> nh2: it doesnt work in a shell, because it acts after the build has finished
<clever> overlays are also on 94
<clever> nh2: Ericson2314 may know more about how to override glibc
<clever> nh2: i think the boot on line 91 is where it makes the main stdenv, and line 94 is where your overrides come into play, too late
<clever> similar for overlays=
<clever> nh2: also note that if you dont specify a config=, then the ~/.nixpkgs/config.nix gets loaded, and can cause unexpected problems
<clever> nh2: you can also try { overlays = [ (self: super: { ... }) ];
<clever> nh2: and the stdenv stuff is a bit protected, let me see what has happened to it lately
<clever> and chrome should be part of the host nixos, and will ignore it
<clever> nh2: do that inside your default.nix/shell.nix, and it will only impact things using that file
<clever> let pkgs = import <nixpkgs> { config.packageOverrides = pkgs: {...}; }; in ...
<clever> nh2: when you import nixpkgs, pass the override there
<clever> nh2: yeah, thats also a hard question to answer
<clever> yeah
<clever> nh2: in c, all functions are exported by default, and you have to define it as static to not export it
<clever> nh2: also not sure what this does, so you may need to name it malloc_info also
<clever> weak_alias (__malloc_info, malloc_info)
<clever> ugly, but it should work
<clever> nh2: copy them over as well
<clever> nh2: in theor, you can just copy the entire __malloc_info function to its own file, compile it to a simple .so, and then LD_PRELOAD it
<clever> nh2: that allows you to transparently replace any function you want, and you can then optionally use `dlsym(RTLD_NEXT` to lookup the original version
<clever> nh2: if you compile a .so file, and load it with LD_PRELOAD, it will be loaded first, and have priority when symbols collide
<clever> bsima: usually master
<clever> nh2: if you import the right headers (and it has no static top-level vars in the file), the linker will just give it access to the internal state
<clever> nh2: what if you just LD_PRELOAD a .so that replaces malloc_info() ?
<clever> ahh
<clever> what exactly needs that new glibc?
<clever> nh2: you would need to create a new cross-compile target like musl64, that uses your patched glibc
<clever> nh2: but a check with nix-build reveals it still has to compile a new ghc
<clever> nh2: it will then have a host glibc and a target glibc
<clever> nh2: the cross-compile logic should handle most of that
<clever> looking at how it uses a different glibc should answer your question
<clever> nh2: that is a build of the hello world app, using 64bit musl
<clever> > pkgsCross.musl64.haskellPackages.hello
<clever> nh2: looking at the musl stuff should help
<clever> hmmm, close
<clever> overrideCC
<clever> nh2: one sec
<clever> nh2: yeah, you need to patch the gcc
<clever> nh2: you want an override
<clever> nh2: replace-dependency.nix is a pure action that jussssst sed's paths as it recursively copies things
<clever> ottidmes: with namespacing you can just mount --bind the host root to / and then mount --bind /dev/null to /dev/log
<clever> its nix, you can trivially run a custom glibc for things like that, and not have any problems!!
<clever> then PRELOAD wont be involved!!
<clever> ottidmes: a more extreme fix, patch glibc to include your connect() change, and then link against that patched one
<clever> ottidmes: or just file an upstream issue asking it to shut up :P
<clever> ottidmes: namespacing is next then? lol, chroot it and delete /dev/log!
<clever> hyperfekt: `nix show-config | grep sandbox`
<clever> check $out/nix-support/hydra-build-products
<clever> youll probably just want to read the logs, and/or the html report in $out
<clever> ah
<clever> arianvp: try `nix repl nixos/tests/blah.nix` and then `:b ...` each attr in the file
<clever> --add seems to ignore them though, so you have to chain 2 nix-store's
<clever> [clever@system76:~/iohk/node]$ nix-store -r $(nix-store --add block.js) --add-root result --indirect
<clever> indirect makes them easier to manage
<clever> arianvp: there is also --add-root and --indirect
<clever> what about the return value of orig_connect when its failing? and what strace says?
<clever> ottidmes: also, is line 13's sock_addr even len bytes long?
<clever> ottidmes: what if line 17 uses orig_addr, not addr?
<clever> or put the pid into the filename
<clever> just keep in mind that you may get several procs opening the same file at once, so try to use append mode
<clever> which you can then use for your own debug messages
<clever> but, line 55, 56, and the function on 58, manage opening a file, and writting to it
<clever> that allows me to decrypt my own traffic in wireshark
<clever> ottidmes: this code will hook some pub/private keygen routines, then log all gets to a file
<clever> you can also open your own file and write there, one sec
<clever> though that print will only work if the program hasnt messed with stdout
<clever> try adding a print to line 15, and another before the if statement like: printf("connect(\"%s\"...)\n", sa.sa_data);
<clever> and then letting the original connect fail, because /dev/null isnt a socket
<clever> ah, your overwriting the sa_data, rather then faking an error
<clever> ottidmes: can you pastebin the source of your PRELOAD?
<clever> then only you get the new vscode, and everybody else gets the normal one
<clever> vscode.override { stdenv = gccStdenv; }
<clever> ah, you could also use override then
<clever> you can either edit the default.nix to request the right one, or pkgs.callPackage ./foo { stdenv = gccStdenv; };
<clever> yeah, that should work too
<clever> hidden how?
<clever> yeah
<clever> and this forces gcc on darwin
<clever> > gccStdenv.mkDerivation
<clever> and on all, $CC points to the right one
<clever> ottidmes: oh, gcc is the default on linux, clang is the default on darwin, and clangStdenv.mkDerivation gives you clang on linux
<clever> ottidmes: gcc is part of the stdenv and in all derivations by default
<clever> :D
<clever> LD_PRELOAD=./result/lib/libfoo.so logger ....
<clever> ottidmes: there is also the logger CLI util, which i suspect also uses /dev/log, so you can try just neutering it
<clever> ottidmes: the sizeof(...) of the sockaddr your using
<clever> nh2: make a derivation that just does ls /nix/store/
<clever> stepcut: can i PM you about some haskell stuff?
<clever> stepcut: you about?
<clever> obfusk: those unquoted will behave weirdly, if you happen to have files matching them in the current dir
<clever> obfusk: nullglob disables that, and makes it return an empty list instead
<clever> obfusk: so if you 'touch foo*' and there are no matching files, it creates a file with the name 'foo*', including a literal *
<clever> and the default action for a pattern matching nothing is to just return the pattern
<clever> ? is a wildcard for matching a single character
<clever> its nullglob
<clever> oh
<clever> obfusk: shellcheck will also complain that you should "$snippet" i believe
<clever> obfusk: running `env` and `set -x` may also help

2018-11-12

<clever> obfusk: your also not using `-j 1`, so the 2 builds are interleaved and the logs are harder to read
<clever> obfusk: 90% of the time, you dont want to use builder, and your just making things harder on yourself by doing so
<clever> ottidmes: you could also check google, now that you know the keywords
<clever> yep
<clever> then you just check the protocol (is it unix, is it /dev/log) and either run the real connect, or just fail
<clever> then all attempts to connect (tcp, udp, unix) go to your function
<clever> ottidmes: yeah, make your own c library, that claims to define the connect() function
<clever> ottidmes: the systemd sandboxing stuff might also help, if you can block access to /dev/log somehow
<clever> you can then just make connect() fail with `return -ENOENT;` if its trying to open /dev/log
<clever> or just use it as an example of how to make your own LD_PRELOAD library
<clever> ottidmes: i think your next option then is to either modify libredirect to support unix sockets via connect()
<clever> ottidmes: as a quick&ugly test, what happens if you just rename /dev/log and try the app again?
<clever> ottidmes: its using the old syslog path, which is now a symlink to journald
<clever> lrwxrwxrwx 1 root root 28 Oct 30 09:08 /dev/log -> /run/systemd/journal/dev-log
<clever> ottidmes: yep, line 11 is the smoking gun, /dev/log
<clever> ottidmes: grep some context around them (grep -C5 'connect(') and throw it all into a pastebin
<clever> ottidmes: what about just connect( ?
<clever> nh2: if you take the raw `.drv` from it, and `nix-copy-closure` to another machine, and then `nix-build --check /nix/store/foo.drv`, can you make it work on one, and break on another?
<clever> ottidmes: i think so, but the `-ff` will also append to that string
<clever> nh2: what is the state of your sandbox flag?
<clever> ottidmes: ok, try doing `strace -ff -o logfiles -s 1000 <that prog>` and then search it for any `connect(0,` strings or similar
<clever> ottidmes: oh, try `lsof -p pid` and see what it claims
<clever> ottidmes: where is /dev/pid/fd/0 pointing?
<clever> nh2: ran it twice and it passed both times
<clever> Zer000: are there signs that one of them was just never used after the upgrade?
<clever> Zer000: what about last-mod times on the files in each dir?
<clever> Zer000: if you cat the script for prestart in gitlab.service, you should see some psql usernames and dbnames
<clever> mudri: could file an issue to have it added, so nixos 19.03 properly warns people
<clever> mudri: and line 38 of the diff reveals that your keymap was simply renamed to colemak
<clever> mudri: and a bisect points me to a commit titled: kbd: Rename some keymaps.
<clever> mudri: its in the `nix-build -A kbd` derivation
<clever> mudri: i can confirm that this file is present on the rev you named, and missing on master
<clever> -r--r--r-- 1 root root 1449 Dec 31 1969 result/share/keymaps/i386/colemak/en-latin9.map.gz
<clever> Zer000: if you check in /etc/systemd/system/ for the gitlab service file, does it name the postgres db to use?
<clever> double-check what your postgresql is using (ps aux should help), and if the data is in a related path
<clever> and then the new dir was empty, so the db was gone
<clever> Zer000: i had a problem with my hydra a few months ago during a similar upgrade, the postgresql datadir changed from /var/lib/something to /var/lib/something/1.2.3
<clever> Zer000: did you change the stateVersion? (or is it missing)
<clever> mudri: let me check closer...
<clever> mudri: i'm guessing that that keymap isnt in the build anymore, so its not being found
<clever> mudri: does the string en-latin9 exist anywhere in your nixos config?
<clever> Ashy: ah, then you want either `nix-shell -I nixpkgs=$HOME/apps/nixpkgs` in the dir with your shell.nix, or change line 1 to `with import /home/clever/apps/nixpkgs {};`
<clever> Ashy: nix-shell -I nixpkgs=$HOME/apps/nixpkgs -p ...
<clever> Ashy: channels are optional, if you just want to test the build, you can just run `nix-build -A hello` in the root of the clone
<clever> __monty__: good idea, i'll need to install it again under steam and see what mono does with it
<clever> space engineers for example doesnt work
<clever> yep, but it doesnt work with .net based things
<clever> i was using that feature to run a "windows only" game on nixos
<clever> in my case, the "host" was a windows box, and the client was nixos, with the above config
<clever> i forgot to comment them when opening things up
<clever> jabranham: i think 25565 and 27036 was steam
<clever> 73 allowedUDPPorts = [ 33445 27036 ];
<clever> 72 allowedTCPPorts = [ 8080 3000 25565 ];
<clever> sorta
<clever> jabranham: yes
<clever> virtualisation.virtualbox.host.headless = lib.mkForce false; lets you override it further, on just one box
<clever> it removed all gui components