2017-05-02

<clever> and nix-shell will cross-compile the deps and put them in the env
<clever> and if you have any dependencies you need, i believe you can just buildInputs = with pkgs; [ foo ]; them
<clever> fixed
<clever> oops, typo
<clever> simukis: running nix-shell on this file should give you that compiler
<clever> simukis: do you want the cross-compiler to run on nixos or something else?
<clever> simukis: so just by setting crossSystem correctly, this package can be cross-compiled
<clever> simukis: yep, it built
<clever> -r-xr-xr-x 1 root root 80K Dec 31 1969 hello.exe
<clever> simukis: i think the old method is still working
<clever> nix-repl> :b (import <nixpkgs> { crossSystem = { config = "x86_64-w64-mingw32"; arch = "x86_64"; libc = "msvcrt"; }; }).hello
<clever> i dont think platform is the right field for the new setup
<clever> error: attribute ‘kernelHeadersBaseConfig’ missing, at /nix/store/xrvp1z1b9rpa5nrnmv5hdzyfjdp9lha4-nixos-17.09pre106299.7f3b857d0d/nixos/pkgs/os-specific/linux/kernel-headers/4.4.nix:11:10
<clever> nix-repl> (import <nixpkgs> { platform = { targetPlatform = "x86_64-pc-windows-gnu"; }; }).hello
<clever> simukis: yeah, i'm not seeing a good example in the nixpkgs docs
<clever> simukis: :b
<clever> nix-repl would help more i think
<clever> d
<clever> simukis: then everything under that pkgs attribute will be cross-compile
<clever> simukis: via pkgs = import <nixpkgs> { somethinghere; }
<clever> simukis: i think what you did was load the entire nixpkgs with the targetplatform setup
<clever> Mic92: line 84 tells it that it needs zfs to boot
<clever> Mic92: ah, and line 15 isnt needed, nixos will automaticaly find the filesystem for /
<clever> Mic92: line 39-75 will get eaten the next time you generate-config!!
<clever> and nixos-generate-config should make that file for you
<clever> Mic92: yeah, i also recently noticed the dvd drive in my desktop isnt plugged in
<clever> aanderse: but you can also dd the ISO onto a usb stick
<clever> then the usb is just its own full nixos install, and its changes will persist
<clever> i prefer running nixos-install against a usb stick, over using an iso
<clever> hegemoOn: nix will only use other things made by nix
<clever> see if the nixos iso can import the existing pool and look at the data
<clever> yeah
<clever> so create a new dataset for the nixos rootfs, and nixos-install to that
<clever> aanderse: in theory, you can just set zfs to not mount the ubuntu root as /, and then start in the middle of the nixos on zfs guide
<clever> joko: i havent actualy gotten armv7l to finish building yet, keep getting distracted, but Dezgeg has a pre-built img you can try out: http://nixos-arm.dezgeg.me/installer/sd-image-armv7l-linux.img
<clever> it will -9 every process in the user it picks
<clever> and you must not put your own user into the nixbld group
<clever> hegemoOn: if you run nix tools as root, they will automaticaly drop privs down to a member of the nixbld group
<clever> hegemoOn: you need to put build users like nixbld1 into the nixbld group
<clever> joko: i just aim a hydra configured for native builds at my raspberry pi and then leave it for a week
<clever> joko: and the hashes dont match up, so the first time you try to nix-env -i, it will want to re-build everything from gcc and up
<clever> joko: some packages dont like cross-compiling, so you cant build the entire OS via cross-compile
<clever> joko: both methods of cross-compiling would have their own hashes, and it would also differ from natively building the same expression on the target platform
<clever> ah
<clever> simukis: and the new method, not sure on the formated version: https://github.com/NixOS/nixpkgs/blob/master/doc/cross-compilation.xml
<clever> simukis: this is the old way of doing cross-compiles in nixpkgs
<clever> simukis: ah, ive done a mingw with libc before, but havent tried powerpc or mips
<clever> simukis: what cpu do you need a compiler for, and does it need to have a libc or just kernel level stuff?
<clever> then you dont need to maintain your own clone of nixpkgs
<clever> you can also copy the default.nix for it into a packageOverride in config.nix
<clever> joko: nixos-rebuild will overwrite the file with a symlink at the next switch
<clever> joko: one thing i sometimes do, copy the contents of /etc/nix/nix.conf to a new file, delete the symlink, then rename the copy back to nix.conf, and edit it freely
<clever> inflames: are you on nixos or another distro?
<clever> you would need to create a dummy entry under ~/.nix-defexpr/ if you want to cease using channels
<clever> but -f '<nixpkgs>' will force it to use the search path
<clever> it uses ~/.nix-defexpr/ instead
<clever> tilpner: nix-env is one of the weird tools, it will make no attempt to use the search path by default
<clever> and a nixos system wouldnt use -iA nixpkgs.
<clever> tilpner: the nixos service for syngery is currently broken
<clever> inflames: and the server needs a config file that describes the layout of the screens
<clever> inflames: you need to run synergs on the server and "synergyc <serverip>" on the client
<clever> though you may need to tweak the bootloader
<clever> this is a generic arm image Dezgeg has made, that will probably boot on most arm boards
<clever> 2017-04-21 12:54:09< Dezgeg> clever: shouldn't the banana pi router board just boot http://nixos-arm.dezgeg.me/installer/sd-image-armv7l-linux.img out-of-the-box?
<clever> main issue is a lack of binary cache support, so it takes a week or 2 to recompile everything on channel updates
<clever> hodapp: i have ran armv6l and armv7l builds of it on my pi's
<clever> simpson: depends on if you want to use it as a nixos machine, or specialize it for just one task and leave it to run forever
<clever> simpson: i have also ran full nixos on some raspberry pi's so that is also an option
<clever> hodapp: ah, that would do it
<clever> simpson: main thing to keep in mind, is that it lacks the nix package manager, so you cant just rebuild-switch, you have to nix-build an image elsewhere, and re-flash whatever hdd its booting from
<clever> simpson: and depending on if you favor cpu time or disk space, the squashfs could be swapped out for something else
<clever> simpson: the kernel attribute may need to be updated, and u-boot added if you need it

2017-05-01

<clever> bbl
<clever> hodapp: you may also want to see what happens if you set dontPatchELF=true; in the derivation
<clever> bbl
<clever> hodapp: and check the rpath again after nix-build finishes, it may change in unexpected ways
<clever> hodapp: dang, heading out now, leave a msg in a PM if you get it working, and if not, i can look at it when i get back
<clever> hodapp: brb
<clever> hodapp: first thing i did, not yet tested: https://gist.github.com/cleverca22/3ad111fa77b17854e1fcca25bfd13544
<clever> hodapp: yeah thats working, let me edit it a bit
<clever> hodapp: would you be able to send me a copy of the .deb file?
<clever> hodapp: then it is 64bit for sure
<clever> hodapp: what does this command output: "file ./result/bin/DraftSight"
<clever> hodapp: you almost never want to use builder.sh
<clever> hodapp: is DraftSight 32 or 64bit?
<clever> hodapp: can you gist your nix expression and the error?
<clever> hodapp: you want cups.lib
<clever> hodapp: if your using stdenv.mkDerivation, gcc is already in the inputs
<clever> hodapp: i think that gcc in the inputs was to get $NIX_CC, because of recent changes to runCommand
<clever> hodapp: you need to call makeLibraryPath on a list of packages (gcc.cc has libstdc++) and then use the result in --set-rpath
<clever> hodapp: buildInputs mean absolutely nothing to patchelf
<clever> hodapp: there is also this, which both gives a patchelf example, and can also be used to generate a bash script that does patching for you
<clever> hodapp: i believe its in gcc.cc
<clever> you always want to use nix-shell for that kind of thing
<clever> steveeJ: nix builds will never look at what you "installed", so that wont help it
<clever> hodapp: you want to set the rpath, not the needed field
<clever> but if your already tracking master a lot for dev, its not an issue
<clever> i think the other methods just check a json list and dont download the changes
<clever> so the git repo will always be up to date
<clever> one side-effect of my design, is that it needs a full clone of nixpkgs, and every time it polls, it downloads new commits
<clever> bachp: ah, and the repo it opens on line 89 needs remotes pre-configured
<clever> bachp: it uses a git library to check every branch on https://github.com/NixOS/nixpkgs-channels
<clever> looks like my instance reads the nixos version directly
<clever> FILE *ver = fopen("/run/current-system/nixos-version","r");
<clever> and the ld.so got GC'd
<clever> [clever@amd-nixos:~/apps/nix-tracker]$ ./nix-tracker
<clever> bash: ./nix-tracker: No such file or directory
<clever> found it, year old, not even in git
<clever> -rw-r--r-- 1 clever users 3.5K Feb 29 2016 main.cpp
<clever> which reminds me, i started something that did that over git, where did i leave it, lol
<clever> bachp: either check the revisions on https://github.com/NixOS/nixpkgs-channels or http://howoldis.herokuapp.com/
<clever> kykim: some of the release.nix files take a supportedSystems array as an argument
<clever> i believe everything goes via <nixpkgs>
<clever> so without a nixpkgs in the path, it is unable to even open configuration.nix
<clever> its the <nixpkgs/nixos> file that does the actual loading of configuration.nix
<clever> the nix.nixPath stuff doesnt take effect until after nixos-rebuild works
<clever> and did you manualy specify -I nixpkgs= for that first rebuild?
<clever> tilpner: does /etc/nixos/nixpkgs/nixos/ exist?
<clever> tilpner: and there is a configuration.nix option, nix.nixPath to affect the default $NIX_PATH
<clever> tilpner: you can do the same thing in $NIX_PATH
<clever> hodapp: and line 21 of the same file
<clever> you need to find the definition of rWrapper
<clever> and because wrapProgram is only ran once, you dont have to deal with nested wrappers
<clever> hodapp: ah, i think rWrapper is a shell function that calls wrapProgram and inserts extra args
<clever> and the .foo-wrapped will be the previous wrapped, that calls .foo-wrapped
<clever> while wrapProgram just renames output -> .foo-wrapped and then uses the -wrapped as the real-prog
<clever> makeWrapper takes an output name, and a real-prog name
<clever> need to manualy name things with i thnik raw makeWrapper calls
<clever> hodapp: you cant, one will overwrite the other, and then recursively call itself
<clever> simony: simplest thing i can think of is to clone nixpkgs, checkout the revision of the channel, and then just edit it
<clever> simony: does the version# in there help any?
<clever> tilpner: that pesky word-wrap!
<clever> simony: the hash of the iso you download has to match the hash that the nixpkgs expression expects
<clever> simony: you need to download that iso manualy and run nix-store --add-fixed sha256 on the file
<clever> /etc/ssh/authorized_keys.d/root
<clever> tilpner: can you just gist the entire file?
<clever> tilpner: what are the first 10 chracters of the public key?
<clever> so the file you deleted should have also made it work, if it had the right pubkey
<clever> it will search all 3 locations and accept a key in any of them
<clever> tilpner: the last like is from sshd_config
<clever> AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2 /etc/ssh/authorized_keys.d/%u
<clever> $ ls /etc/ssh/authorized_keys.d/
<clever> builder clever root
<clever> and what does ssh -vvvvv root@host say?
<clever> what does the journal say when it rejects a login?
<clever> hmmm, what does the journal and ssh -vvvv say?
<clever> tilpner: services.openssh.permitRootLogin = "yes";
<clever> tilpner: root login is disabled by default

2017-04-30

<clever> oh, didnt notice that
<clever> gchristensen: and criminaly out-dated gentoo systems are in close 2nd! :P
<clever> -rwxr-xr-x 1 root root 1.1M Oct 26 2014 /usr/bin/irssi
<clever> those poor souls, lol
<clever> Jookia: yeah, thats usualy blocked in most channels
<clever> joepie91: ahh
<clever> i think somebody is going thru the history books, lol
<clever> i havent seen that dcc exploit in nearly a decade
<clever> gchristensen: id usualy say to just +n the channel, but that may break NixOS_GitHub
<clever> makefu: its also a bug in some router firmwares
<clever> MichaelRaskin: and i went nuts playing with hydra features: http://hydra.earthtools.ca/build/44894/download/1/test1.png
<clever> MichaelRaskin: the menu that ipxe will display on bootup: https://github.com/cleverca22/not-os/blob/master/ipxe.nix#L7-L13
<clever> the original plan was to burn the ipxe into a rom on the hardware, so it would be nearly imposible to run un-authorized software
<clever> no rollback options
<clever> it currently gives you a choice between the os on the tftp server, or an ipxe shell
<clever> and the ipxe binary it comes with is pre-configured to only accept signed files, so you can load the os over an untrusted network
<clever> MichaelRaskin: not-os does have some ipxe scripts included
<clever> MichaelRaskin: i have done similiar, as an example embeded OS: https://github.com/cleverca22/not-os
<clever> but the isp provided router was just too garbage to keep using
<clever> i had to retire the LFS router when i upgraded to fiber, 370mbit download speed wouldnt suit a pc with only 100mbit NIC's lol
<clever> sziszi: maxing out the DSL modem brought the cpu usage up to about 60%
<clever> sziszi: and it wasnt a normal router, it was a pentium1 with 128mb of ram and 2 ethernet cards
<clever> i used to run LFS on my router
<clever> MichaelRaskin: and PR is open
<clever> yeah
<clever> i didnt notice it had left echo off until i tried to get the exit status
<clever> just stating how badly nix-repl crashed, it failed to restore terminal settings on exit
<clever> i do, but that shows how badly it crashed
<clever> so i'm now typing blind in that shell
<clever> nix-repl returned status 1, and didnt enable local-echo
<clever> MichaelRaskin: this command causes the LED display on my motherboard to display 01
<clever> $ sudo ./ioport/bin/outb 0x80 0x01
<clever> nix assertion throw during tab completion
<clever> seems i can still crash nix-repl, heh
<clever> nix-repl> ioport.meta.deserror: getting status of ‘/home/clever/apps/nixpkgs/pkgs/pkgs/os-specific/linux/ioport’: No such file or directory
<clever> description = "direct access to I/O ports from the command line"; look good for ioport?
<clever> dont know, only joined the channel recently and it sounds like a long-term trend
<clever> somebody in #ghc recently said "after seeing a bunch of questions asked here by Nix users, I've sworn off the idea of using Nix for anything ever"
<clever> ah
<clever> stdenv.lib.licenses.gpl2 looks like a good match for "This software is distibuted under the terms of the GNU GPL version 2 or above."
<clever> so that would be under pkgs/os-specific/linux
<clever> i believe its using a linux syscall to allow userland direct ioport access
<clever> iopl() is Linux-specific and should not be used in programs that are intended to be portable.
<clever> iopl - change I/O privilege level
<clever> You must compile with -O or -O2 or similar. The functions are defined as inline macros, and will not be substituted in without optimization enabled, causing unresolved references at link time.
<clever> MichaelRaskin: probably, checking the source to confirm
<clever> taktoa has been saying that i need to just get commit access
<clever> http://people.redhat.com/rjones/ioport/ now to figure out what dir this belongs in under nixpkgs
<clever> about to make another
<clever> thanks
<clever> i have a PR that has been sitting unmerged for about a week now
<clever> if you assume "something" is a python package, and its not found, nix will silently use the version from pkgs. instead
<clever> for example, with pkgs; with pkgs.pythonPackages; [ something ];
<clever> i try to avoid with statements, they can sometimes cause confusing problems
<clever> oh, didnt see the with statement
<clever> this lets you call func on foo, without exposing foo in the return value
<clever> let foo = ...; in { bar = func foo; }
<clever> Judson: and in some cases, adding random things to the attrset will break it
<clever> Judson: the things in the let block dont get added to the attribute set
<clever> so this would drop me into an env suitable for building shake
<clever> [clever@amd-nixos:~]$ nix-shell '<nixpkgs>' -A haskellPackages.shake.env
<clever> everything made with the nixpkgs haskell framework has a .env attribute on it
<clever> yep
<clever> not really
<clever> nixos-rebuild basicaly just boils down to "nix-build '<nixpkgs/nixos>' -A system"
<clever> dont know of any hooks to do that right now
<clever> so the path you queried refused to even start
<clever> the tarball is the one that failed first
<clever> builder for ‘/nix/store/p2s2900lznd33vnz63gz9slfrb8nkk4h-factorio.tar.gz.drv’ failed with exit code 1
<clever> and also, the storepath you tried to get the log for never even started
<clever> i usualy build with -j8 -Q for speed, then re-build with -j1 to get the failure
<clever> it doesnt save the log for failed builds
<clever> you can run "nix-store -l /nix/store/foo" to retrieve the log for any storepath
<clever> and it already saves the output to /nix/var/log/
<clever> i build with -Q to silence it all
<clever> dont think so
<clever> and then the backtrace shows the path from top-level to the failure
<clever> you can sorta do that by inserting an assertion into things like systemPackages
<clever> nix-repl> builtins.trace "print me" "return me"
<clever> trace: print me
<clever> "return me"
<clever> joepie91: but there is builtins.trace
<clever> nothing like that
<clever> closest thing is nix-repl
<clever> joepie91: and in here, its using a map function over the list of all systemd.services, to make unit files
<clever> which gets references on 61 of top-level
<clever> joepie91: all environment.etc stuff gets handled in this module via an activation script
<clever> joepie91: and the systemd units are via the activationScript on line 61
<clever> joepie91: this buildEnv is referenced on line 70 of top-level.nix
<clever> joepie91: and line 70 references the result of environment.systemPackages, and copies it to $out/sw
<clever> joepie91: line 112 references systemBuilder, defined at line 30

2017-04-29

<clever> rename or move to somewhere else
<clever> Welkin: id rename them, so you have the option to undo
<clever> yeah
<clever> Welkin: this solved some Illegal Instruction issues i was having a month ago
<clever> 2017-03-13 17:09:26< LnL> echo 'pre-build-hook = ' >> /etc/nix/nix.conf on your osx machine
<clever> Welkin: one sec
<clever> not nix-build
<clever> then you need to set that env var for nix-daemon
<clever> no nix-daemon in use?
<clever> sellout-: nixos or another distro?
<clever> Jookia: with a ~1.5 year old copy of nixpkgs, it has a different error
<clever> error: attribute ‘platforms’ missing, at (string):1:49
<clever> nix-repl> pkgs.hello
<clever> nix-repl> pkgs = import <nixpkgs> { config = pkgs: { platform = pkgs.platforms.armv7l-hf-multiplatform; }; }
<clever> havent seen one
<clever> Jookia: that example should have worked with older nixpkgs i belive
<clever> Jookia: bug
<clever> 2017-03-12 15:43:07< clever> viric: i think the cause was somebody changing how nixpkgs works, and they didnt test pkgs = import <nixpkgs> { platform = pkgs.platforms.foo; }
<clever> platform = (import <nixpkgs> { config = {}; }).platforms.aarch64-multiplatform;
<clever> Jookia: one min
<clever> Jookia: the way config is handled has changed
<clever> fresheyeball: looks like it cant create something in /var/lib/plex/.skeleton
<clever> bennofs: i would just rename it, lol
<clever> bennofs: they are doubled up, but nix eats a \
<clever> fresheyeball: does it have its own log files in /var/log/ or /var/lib/plex?
<clever> journalctl -u plex
<clever> sudo systemctl status plex
<clever> did you nixos-rebuild switch?
<clever> just confirm that there is only one chnanel listed in nix-channel --list
<clever> jsgrant_: and it should work
<clever> jsgrant_: you can just add whatever channel you want under the name 'nixos' and nix-channel -update
<clever> jsgrant_: what exactly are you trying to change/do?
<clever> :)
<clever> and confirm nixos-generate-config puts the right things in hardware-configuration.nix
<clever> yep
<clever> umount
<clever> to make it readable by user 1000
<clever> you need to mount /dev/sdXY /media/stuff -o uid=1000
<clever> ntfs is weird like that
<clever> ah
<clever> oh, what filesystem is it