2017-05-13

<clever> mkOverride takes a priority number, i have been curious as to how exactly it works
<clever> yeah, there is a merge function on the type definition
<clever> ah
<clever> gchristensen: until we see an answer to post #4, there isnt much we can do
<clever> arcetera: this looks important
<clever> pkgs/development/misc/avr-gcc-with-avr-libc/default.nix: description = "AVR development environment including binutils, avr-gcc and avr-libc";
<clever> arcetera: heh, i was just thinking about getting back into some avr programming
<clever> obadz: services.cron.enable will probably work
<clever> obadz: ive just been using systemd timers in configuration.nix, but that would need root
<clever> ah
<clever> and the above code cant append /Imaging/ to those -I paths
<clever> but also keep in mind, nixpkgs uses a non-standard cflags (NIX_CFLAGS_COMPILE) to inject -I's without allowing dumb makefiles the chance to overwrite it
<clever> SplitFire: it says that if the outputs are newer then the inputs
<clever> SplitFire: then run "nix-shell -p hello" and you should get patchShebangs
<clever> it must be done by a nix expression, not by hand
<clever> SplitFire: that script it sourced by setup.sh in the stdenv, so you can just "patchShebangs ." to patch every script in the current dir
<clever> SplitFire: and the fixupPhase automaticaly finds all "#!/usr/bin/env bash" in $out/bin and patches it to "#!/nix/store/hash-bash/bin/bash" for you
<clever> SplitFire: patchShebangs must be ran on a directory, and it will get every file in it for you
<clever> MichaelRaskin: i dont think the nix build sandbox has /usr/bin/env
<clever> you can just use the command in your derivation
<clever> its already in the stdenv
<clever> apostolis: yay
<clever> what shell did you try to tabcomplete in?
<clever> i belive its already in the stdenv, so you can just use it
<clever> SplitFire: and you cant just make libc depend on bash, because bash depends on libc, because libc depends on bash, because bash depends on libc, because libc depends on bash, because bash depends on libc, because libc depends on bash ....
<clever> SplitFire: the system() function in libc requires a /bin/sh
<clever> SplitFire: and the entire design of nix is to avoid things breaking like that
<clever> SplitFire: /bin is an impurity, it might contain a different binary tomorrow, and cause your perfectly working script to not work because somebody updated something else
<clever> i believe tis already in the stdenv
<clever> and it will fix them for you
<clever> for #!'s, you can just run patchShebangs on the directory
<clever> SplitFire: if its in the Makefile, you can run sed or substituteInPlace over them at the postPatch hook
<clever> SplitFire: everything should be patched to use the absolute path of bash at compile time
<clever> boot.kernelParameters will just automaticaly go to whatever bootloader your using
<clever> ah, that could be it, that would be boot.kernelParameters = [ "iommu=soft" ]; for nixos
<clever> i think its a problem with the driver upstream, see what google can find on this error
<clever> doesnt fix the issue, but it can recreate the error msg
<clever> apostolis: try just doing "rmmod ath9k ; modprobe ath9k" and then check "dmesg | tail -n20"
<clever> cant be a shortage of dma-able ram then
<clever> apostolis: how much ram in the system?
<clever> apostolis: this might be important
<clever> [ 2.976986] ath: phy0: dma_mapping_error() on RX init
<clever> not a 9k on my end though
<clever> Kernel driver in use: ath5k
<clever> 01:00.0 Ethernet controller [0200]: Qualcomm Atheros AR242x / AR542x Wireless Network Adapter (PCI-Express) [168c:001c] (rev 01)
<clever> apostolis: oh, and i just noticed, i think you have an asus eeepc, and mine also has an ath network card
<clever> [ 2.976422] ath: Country alpha2 being used: CN
<clever> apostolis: its not entirely clear, but i think the wifi card believes its in china, and the firmware isnt written for use in china?
<clever> apostolis: line 1024 of the pastebin you just linked
<clever> [ 2.977577] ath9k 0000:26:00.0: Failed to initialize device
<clever> [ 2.978172] ath9k: probe of 0000:26:00.0 failed with error -12
<clever> apostolis: some poking around in the source finds that all firmware fits the "ath9k-eeprom-%s-%s.bin" pattern
<clever> can you put that lspci output and all of dmesg into a pastebin?
<clever> that would imply the module is loaded correctly and already driving the card
<clever> apostolis: what does this output: sudo lspci -d 168c:002e -vvvvvv
<clever> apostolis: one sec
<clever> apostolis: i think so
<clever> ath9k/hw.h:#define AR9287_DEVID_PCIE 0x002e
<clever> ath9k/hw.h:#define ATHEROS_VENDOR_ID 0x168c
<clever> it will add a number at the end of each line
<clever> apostolis: what about lspci -nn?
<clever> can you gist the entire dmesg output?
<clever> apostolis: anything interesting in dmesg?
<clever> apostolis: what about "ip link"
<clever> i usualy just delete it, and embed the contents into configuration.nix
<clever> it depends on if you plan to use nixos-generate-config to rebuild it or not
<clever> apostolis: boot.kernelModules is basicaly just a list of things that get modprobe'd at bootup, so you should be able to test if "modprobe ath9k" fixes things first
<clever> i think its line 167 of setEnvironment
<clever> LnL: i believe line 33 of the last file goes into here
<clever> LnL: the global default value of PATH for shells?
<clever> ah
<clever> yeah, those ones wont have the same option
<clever> so if it somehow gets omited, the build just fails
<clever> i would have used a -DFOO=bar flag to gcc
<clever> heh
<clever> yep :)
<clever> lol
<clever> every variable under builtins.foo is also available as __foo
<clever> let __nixPath = [ { prefix="nixpkgs"; path="/foo/bar"; } ] ++ builtins.nixPath; in
<clever> that should have the same value
<clever> try builtins.nixPath for the reference
<clever> oh
<clever> heh
<clever> apostolis: i think hardware.enableAllFirmware=true; will get it
<clever> mark-willem: so it may only be accessible over ssh
<clever> mark-willem: oh, and gpu drivers often get upset by the kexec used by a crashdump kernel
<clever> maybe this: (let __nixPath = [ { prefix="nixpkgs"; path="/foo/bar"; } ] ++ __nixPath; in builtins.scopedImport { inherit __nixPath; } <nixpkgs/nixos/lib/eval-config.nix> {})
<clever> that would give identical behaviour in both cases, so if /foo/bar is missing, both of them try the next thing in the path
<clever> gchristensen: but as MichaelRaskin mentioned earlier, you can also use a let __nixPath = to mutate the search path
<clever> gchristensen: before i think
<clever> i think it will also have less ram on startup, and can manualy kdump the original kernel
<clever> so it will appear to kexec reboot upon crashing
<clever> it can re-run itself as the crash kernel, but it wont do a kdump from that
<clever> nixos has partial panic kernel support
<clever> a panic kernel may also help there
<clever> manveru: pkgs.runCommand is probably better suited, depends on what you want to do
<clever> and cut your logs off
<clever> oh yeah, but the nic may be shut off mid way thru the shutdown
<clever> mark-willem: about all i can think of is a serial console, which requires a non-usb serial port
<clever> mark-willem: id start by comparing lsmod on each system, and seeing what differs
<clever> samae: only these subdirs of a package will be symlinked under sw: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/config/system-path.nix#L102-L123
<clever> lrwxrwxrwx 4 root nixbld 65 Jan 1 1970 /nix/var/nix/profiles/system/sw/bin/bash -> /nix/store/4khqw7lhpwj0b3cxzf1j2h5911rr981x-bash-4.3-p42/bin/bash
<clever> those will wind up in the sw/bin/ sub-dir of a nixos build
<clever> this does work
<clever> [root@router:~]# nix-env -p /nix/var/nix/profiles/system --list-generations
<clever> samae: nixos doesnt use a manifest.nix file to manage the profile
<clever> i would just edit that expression directly
<clever> but the let block only effects the expression after "in", and wont transfer to other files
<clever> yep
<clever> i dont know of any other way
<clever> and in my instance, i prepend an extra entry to __nixPath
<clever> i believe it will import a given file, and alter the global scope for that file, and everything it imports
<clever> :D
<clever> that gist was more of a one-off example on one possible way to solve the problem
<clever> i was more going for a way to alter how private.nix behaves without having to edit it directly
<clever> MichaelRaskin: when the tryEval fails, it just spits out a better error, but id need to modify private.nix directly if i wanted to add support to take the config in as a string
<clever> MichaelRaskin: to eliminate a step the user has to perform before nix-build
<clever> MichaelRaskin: i wanted to generate the <ssh-config-file> with pkgs.writeText
<clever> yeah, just a testcase for it and no uses anywhere
<clever> gchristensen: ive not seen anything saying not to use it, i just saw it in the source and used it: https://github.com/NixOS/nix/blob/master/src/libexpr/primops.cc#L73
<clever> gchristensen: and scopedImport would get any <nixpkgs> the user may add down the road
<clever> gchristensen: but if the users deployment file later re-imports <nixpkgs> it wont be
<clever> gchristensen: i believe the patch in that PR changes it from using <nixpkgs> to using nixpkgs + "/nixos/eval-config.nix", so the initial pkgs it loads for nixos will be affected
<clever> MichaelRaskin: scopedImport isnt even used in nixpkgs, and the nixops case is fairly special, wanting to import many different files, each with their own view of <nixpkgs>
<clever> MichaelRaskin: not sure, would need to experiment and see
<clever> gchristensen: and scopedImport lets you inject things into the global scope of a given import
<clever> gchristensen: basicaly, every <nixpkgs> gets translated to __findFile calls on __nixPath and "nixpkgs"
<clever> would need nix to trace the path a value took to debug that
<clever> yeah, that is a tricky one
<clever> domenkozar: can you gist the traceback and the inputs that are non-standard?
<clever> but callPackages should deal with that
<clever> and if you then inherit the derivations into all-packages.nix, you loose .override entirely
<clever> the .override callPackage adds is on the attrset, not the derivations
<clever> there is also a minor issue, if you make a default.nix that returns an attrset of derivations
<clever> the bool says if it has a default or not
<clever> sphalerite: yep, and i believe that returns an attrset of a=bool; b=bool; c=bool; ....
<clever> or if posisble, moved to its own file
<clever> the file needs _file and key added to it, to help things figure out where it came from
<clever> domenkozar: ah yeah, you do, one sec
<clever> gchristensen: this code allows me to mutate the nixpath for a subset of the expressions
<clever> gchristensen: have you seen what scopedImport does?
<clever> Fare: it uses the ~/.nix-defexpr/ dir
<clever> Fare: nix-env does see $NIX_PATH, but it doesnt try to use it by default

2017-05-12

<clever> that allows root, and turns passwords off globally
<clever> Guest59096: i use this: openssh = { passwordAuthentication = false; permitRootLogin = "yes"; };
<clever> i disable password, but allow keypair auth
<clever> yeah
<clever> with release.nix, i dont think github is aware that ${foo} is a valid key in an attrset
<clever> inspecting the html says its the color of a , in the arguments
<clever> gchristensen: this has the same color: https://github.com/cleverca22/not-os/blob/master/configuration.nix
<clever> oh
<clever> heh, i only see 1 in nix.nix
<clever> gchristensen: ah, and the one i was looking for: https://github.com/cleverca22/not-os/blob/master/release.nix#L19
<clever> gchristensen: another glitch i found in github: https://github.com/cleverca22/not-os/blob/master/nix.nix
<clever> pie_: nice
<clever> but i supposed you could just stick that into a bash function
<clever> i usualy just nix-build -E 'with import <nixpkgs>'; callPackage ./default.nix {}'
<clever> AndreasO: in the case of images, you can usualy just ignore it
<clever> pie__: which window manager and display manager?
<clever> pie__: it might be a bug in nixos or your .bashrc files, does .bashrc or .profile exist?
<clever> BlessJah: serviceConfig = { ExecStart = "..."; Restart = "..."; };
<clever> BlessJah: serviceConfig must be an attributeset
<clever> AndreasO: and the nix-env one will have a higher priority
<clever> AndreasO: ah, it wont detect that collision, because they are in different profiles
<clever> pie__: it sounds like the root problem is a lack of $XAUTHORITY, so when $HOME changes, it can break
<clever> which is also a default, so it being unset still works, if $HOME is set right
<clever> on my end, its set to /home/clever/.Xauthority
<clever> try copying its value over
<clever> pie__: what does this show under a root shell?
<clever> pie__: echo $XAUTHORITY $DISPLAY
<clever> pie__: i do "sudo -i" all the time, and run xorg apps under that
<clever> pie__: root should be able to read your xauth file out of the old $HOME
<clever> AndreasO: and only one of those programs will be usable
<clever> AndreasO: if you try to install 2 different things that provide the same binary, nixos will build, and print a warning as it does so
<clever> AndreasO: systemPackages is set to ignore collisions, it will print a warning at build time, and i think it will use whichever package provided a given file first
<clever> AndreasO: there is a n missing, environment.systemPackages
<clever> AndreasO: what error is it giving?
<clever> and if the nixos module just ran buildEnv over a list of hooks, and then stuck the resulting path into the systemd unit, it would be able to do that
<clever> then patch it to obey the env var
<clever> if you have a systemd unit already
<clever> id make it an option within nixos, that sets up env vars when the systemd unit gets ran
<clever> heading out for a bit
<clever> ah, must still be in master then
<clever> should be testable under nix-shell, and the nix-daemon doesnt have to match
<clever> try nixUnstable
<clever> Baughn: reading the source, its just builtins.exec { program="stat"; arguments = [ "-L" "-c" "%s" file ]; }
<clever> Baughn: pretty sure there is a builtin for that now
<clever> and even if you have the source of the function, you dont have the path value took thru code
<clever> yeah, in that case, its hard to find out where the function came from
<clever> rather then at the end when you try to use the value
<clever> yeah, then it fails at the interface where the types conflict
<clever> ah
<clever> but toString forces it to not copy, so you get an absolute and impure path
<clever> if you try to just blindly treat it as a string, it will copy to the store and return a storepath
<clever> there is some weird areas, like toString ./foo.txt returns a totally different string from "${./foo.txt}"
<clever> :)
<clever> ah
<clever> BCL?
<clever> so i can manage everything else in git, and recreate it, without the new boot setup conflicting
<clever> then configuration.nix does imports = [ ./nixcfg/laptop.nix ];
<clever> i keep the boot related stuff in hardware-configuration.nix and configuration.nix
<clever> and this was in configuration.nix
<clever> boot.initrd.luks.devices = [ { name = "root"; device = "/dev/sda3"; preLVM = true; } ];
<clever> hardware-configuration.nix is also in use, but thats just the defaults from nixos-generate-config
<clever> zram may also have negative effects on hibernation
<clever> in my case, the laptop only has 3gig
<clever> depends on how much ram you have
<clever> heh
<clever> ah, nice
<clever> and something goes wrong along the way
<clever> so it has to open the luks, but not the zfs, initialize lvm, then read the hibernate state
<clever> hibernate is an edge case, (zfs+swap) on lvm on luks
<clever> and it woke up without an issue, didnt even loose the voice connection
<clever> it then went into standby, in the middle of me trying to have a voice convo
<clever> i tested suspend by mistake, the lcd panel was in the way of working on the desktop, so i closed it
<clever> suspend works on my laptop, hibernate doesnt
<clever> ive seen the messages
<clever> most important part is just networking.wireless.enable = true;
<clever> Baughn: https://gist.github.com/cleverca22/18b59d036a47bda54ec7d22113fbabe7 part of the config for my netbook and laptop
<clever> bbl
<clever> NickHu: and confirm you dont have a ~/.nixpkgs/config.nix
<clever> NickHu: can you gist the config.nix file?
<clever> it will detect the change from the override and rebuild automatically
<clever> SplitFire: nix will detect when the inputs (source or nix flags) change, and rebuild it for you
<clever> /run/current-system/sw/bin/xsane would allow it to update when you nixos-rebuild
<clever> but the symlink in $HOME cant hurt and is easy to test
<clever> yeah, some parts of the manual are wrong for nixos
<clever> │ │ │ │ │ -binary (e.g., "touch /nix/store/abawa99js846qwwjlqjdqaapsyvxljdh-xsane-0.999/bin/xsane") or delete the plugin cache
<clever> SplitFire: check the man page and see if it fixes it
<clever> SplitFire: i am seeing some stuff in "man xsane" saying you need to make a symlink in ~/.gimp-2.0/plug-ins/
<clever> SplitFire: i am seeing some gimp related symbols in the xsane build
<clever> │ │ │ +0000000000695b68 0000011300000006 R_X86_64_GLOB_DAT 0000000000000000 gimp_main + 0
<clever> sphalerite: then a serial console is about the only option, enless you can guess and disable the right driver
<clever> sphalerite: and ssh is also dead?
<clever> ah, and no kernel panic msg in text mode?
<clever> sphalerite: are you locking it up in xorg or text mode?
<clever> checking things on this end more
<clever> a quick check says d1v4kksrxkav8qc51n7zl7vs9srlli4i isnt in the binary cache, so there is a good chance its the overridden version
<clever> i think you need to strip the bin/xsane off the end
<clever> SplitFire: what command isnt working?
<clever> yeah
<clever> only one will work
<clever> probably
<clever> Isorkin: are there any errors in the journal?
<clever> yep, top left, your wifi card is using it
<clever> you may also find something that can do it over the expresscard bus
<clever> overkill, but it can be done
<clever> sphalerite: and now you have a real serial port on a laptop!
<clever> sphalerite: but i can see a way to get real serial on a laptop, one min
<clever> so if that doesnt work, yeah, hard-reset is about all thats left
<clever> the internal keyboard is probably ps2
<clever> sphalerite: but getting a real serial port on a modern machine isnt easy
<clever> sphalerite: the sysrq may work over ps2 or the serial port, even if it doesnt work over usb
<clever> so if i connect to you, you get my long-term v6 addr, and full access
<clever> and i dont have randomized v6 addresses for outgoing stuff
<clever> but in my case, i forgot to setup a v6 firewall of any kind in my router
<clever> dhess: that would be the best option
<clever> sphalerite: yeah
<clever> and you should document things on https://github.com/nixos-users/wiki/wiki so nobody has to repeat things a 3rd time
<clever> it already has patchelf logic, so you might be able to aim it at a tarball of the debian ghc
<clever> something that works enough to compile a real ghc
<clever> dhess: just replacing the entire file with a hacked together arm ghc derivation may do
<clever> then you can use that as a bootstrap to make a truely pure bootstrap
<clever> dhess: yeah, to get the initial pure-ish ghc in nixpkgs
<clever> by using nix on debian
<clever> if sandboxes are turned off, you could just run /usr/bin/ghc without any patching
<clever> the search for 2w1iigapdnnpcqsrh0ck86kga9m6qcm8 turned up nothing
<clever> then use that as a bootstrap to build a proper nixpkgs ghc bootstrap
<clever> if you have a debian arm ghc, you could patchelf it enough to make it work under nixpkgs
<clever> dhess: https://botbot.me/freenode/nixos/2017-04-24/?msg=84633240&page=6 read around the area of 9:20 in this log