2017-04-27

<clever> requireFile is a special "fetcher" that will just print a url and fail
<clever> hodapp: you could treat it the same as JRE

2017-04-26

<clever> maurer: some options i had turned on for either powertop or latencytop: https://gist.github.com/cleverca22/4ad4b0a1fcccf9e67b4cc4fb19b71a41
<clever> hodapp: LD_DEBUG=libs i think
<clever> and failures
<clever> hodapp: oh, i think ld.so can trace things its loading
<clever> hodapp: both of those are qt based and blob-only
<clever> hodapp: you need to set an env variable to tell it where to find qt plugins, check the skype or teamspeak clients in nixpkgs
<clever> mellowmaroon: it also happens with xfce, so its not a gnome problem
<clever> mellowmaroon: that happens sometimes on my systems, i just ignore it
<clever> MichaelRaskin, hl: you could also packageOverride nano to null
<clever> has anyone here use M.2 NVME drives before?
<clever> bennofs: and this will actualy parse a nar: https://github.com/taktoa/narfuse/blob/master/Main.hs
<clever> !m Dezgeg
<clever> and it can garbage collect them
<clever> if you install it like that, nix wont know the dependencies are in use
<clever> dcz: you cant install programs from a nix-shell, you need to use nix-build to install things
<clever> try just removing the outputs= from the derivation and see if that helps
<clever> and reading the other pastebin closer, the problem is the mariadb that rsyslog depends on
<clever> b: the nix file you linked be doesnt use multiple outputs, you either have un-commited changes, or something weird is going on
<clever> a: simplest thing is to just not use multiple outputs, just set outputs = [ "out" ]; and put everything in $out
<clever> and its now stuck in an imposible situation
<clever> so $dev must be valid to unpack $bin, and $bin must be valid to unpack $dev
<clever> nix requires that all dependencies exist before something can be unpacked to /nix/store
<clever> vaibhavsagar: and $bin/nix-support/propagated-native-build-inputs has $dev directly in it
<clever> vaibhavsagar: $dev/bin/mysql_config has bindir=$bin/bin
<clever> vaibhavsagar: and theres the cycle
<clever> $dev depends on $bin
<clever> $bin depends on $dev and $out
<clever> $dev depends on $out
<clever> vaibhavsagar: ok, so $out doesnt appear to depend on anything, which is a little weird
<clever> so it must be something special with the user config
<clever> i would expect hydra to filter problems like this out of the channel
<clever> system-path -> gnucash -> giant mess of perl
<clever> cannot build derivation ‘/nix/store/rmg9l876ff4fz5zbfwr3ss13nmikirrk-gnucash-2.4.15.drv’: 1 dependencies couldn't be built
<clever> its in the backtrace
<clever> hyper_ch: i think its a dep of gnucash, so just remove that from your systemPackages
<clever> ah
<clever> hyper_ch: what error?
<clever> just somebody trying to compile c by running nix-shell on it
<clever> yeah
<clever> but no \n in the pastes, so i didnt think of it
<clever> a mix of typing and pasting hashes
<clever> hyper_ch: oops, i usualy only use one when pasting multiple lines, dont think about it when i'm typing each
<clever> vaibhavsagar: oops, and -r on all 3
<clever> vaibhavsagar: #3 egrep 1x01ridywrbcgr419q2fzk3pr63mjhzv|wv8bg5mmm1r78fyjmlw8v2b57fvz6wvf' /nix/store/llqvjcz1bg7242sgycs75i18pdq5b6cx-mariadb-client-10.1.21-bin
<clever> vaibhavsagar: #2 egrep 'llqvjcz1bg7242sgycs75i18pdq5b6cx|wv8bg5mmm1r78fyjmlw8v2b57fvz6wvf' /nix/store/1x01ridywrbcgr419q2fzk3pr63mjhzv-mariadb-client-10.1.21-dev
<clever> vaibhavsagar: now do #1 egrep 'llqvjcz1bg7242sgycs75i18pdq5b6cx|1x01ridywrbcgr419q2fzk3pr63mjhzv' /nix/store/wv8bg5mmm1r78fyjmlw8v2b57fvz6wvf-mariadb-client-10.1.21
<clever> $out /nix/store/wv8bg5mmm1r78fyjmlw8v2b57fvz6wvf-mariadb-client-10.1.21
<clever> $bin /nix/store/llqvjcz1bg7242sgycs75i18pdq5b6cx-mariadb-client-10.1.21-bin
<clever> $dev /nix/store/1x01ridywrbcgr419q2fzk3pr63mjhzv-mariadb-client-10.1.21-dev
<clever> can you pastebin more of the error?
<clever> the nix file you linked only has 1 output on my end
<clever> this derivation produced the following outputs: out -> /nix/store/pfn4rvckp6rfx2mywjyfd3a8bm01bca5-mariadb-10.1.21
<clever> vaibhavsagar: can you push those changes to a branch in nixsap?
<clever> vaibhavsagar: is that the same $out your build is trying to make?
<clever> lrwxrwxrwx 1 clever users 59 Apr 26 00:10 result -> /nix/store/pfn4rvckp6rfx2mywjyfd3a8bm01bca5-mariadb-10.1.21
<clever> vaibhavsagar: the build passed again
<clever> nix_niave: its "nix-shell -p gcc" then "gcc -o hello2 hello2.c
<clever> nix_niave: it just works when i compile it
<clever> i need the url for the paste
<clever> nix_niave: can you try pasting the whole file into a pastebin?
<clever> int main (int argc, char **argv) {
<clever> nix_niave: main needs arguments, and a return value
<clever> nix_niave: https://pastebin.com/
<clever> nix_niave: can you pastebin the contents of hello2.c?
<clever> nix_niave: "nix-shell -p gcc" then try to compile it
<clever> nix_niave: you need to be in a nix-shell for the compiler to work right
<clever> nix_niave: are you using nix-shell?
<clever> so i can isolate the build from my env
<clever> vaibhavsagar: if you pass a config param to nixpkgs, it will use that, rather then loading config.nix
<clever> [clever@amd-nixos:~/apps/nixsap/modules/pkgs/mariadb]$ nix-build -E 'with import /home/clever/apps/nixpkgs { config = {}; }; callPackage ./. {}'
<clever> oh, and i should remove my config.nix
<clever> vaibhavsagar: build has resumed on that revision
<clever> [clever@amd-nixos:~/apps/nixsap/modules/pkgs/mariadb]$ nix-build -E 'with import /home/clever/apps/nixpkgs {}; callPackage ./. {}'
<clever> vaibhavsagar: i usualy only bisect nixpkgs when i find something that actualy breaks, and can narrow down a testcase
<clever> vaibhavsagar: what revision of nixpkgs are you using?
<clever> vaibhavsagar: the build passed without errors on this end
<clever> turnandrun: on ubuntu its simpler, just -I ssh-auth-sock=$SSH_AUTH_SOCK -I ssh-config-file=/tmp/ssh-config
<clever> this allows fetchGitPrivate to use your ssh agent
<clever> turnandrun: fetchgit cant access your ssh keys
<clever> ah those are still $out
<clever> stripping (with flags -S) in /nix/store/j3nn8yznfr1qfnyfm7wdz5yywlpw3bac-mariadb-10.1.21/lib /nix/store/j3nn8yznfr1qfnyfm7wdz5yywlpw3bac-mariadb-10.1.21/bin
<clever> its still finishing up
<clever> vaibhavsagar: ok, so $out is /nix/store/j3nn8yznfr1qfnyfm7wdz5yywlpw3bac-mariadb-10.1.21 on my machine
<clever> vaibhavsagar: 100%
<clever> yep, up to 83 now
<clever> oh, and theres a random 72%
<clever> vaibhavsagar: its stopped giving progress %'s and appears to now be compiling stuff without cmake
<clever> Infinisil: then you can grep that for xsession, which will return 1 entry
<clever> Infinisil: thats why i said to use -qR earlier, "nix-store -qR /run/current-system" will show the subset of the store that the current nixos uses
<clever> Infinisil: GC wont save you,the rollback will keep old copies for easy-undo
<clever> but thats not in the fstab, so it refuses to tab-complete a directory that exists locally
<clever> i also often do things like mount nas:/nas /na<tab>
<clever> then cd just tells you, "x is not a directory" and you instantly know what is wrong
<clever> i prefer it in the dumb mode, where it can complete files on cd
<clever> i mean the smarter tab completion stuff
<clever> it can do dumb things like that and often just gets in the way
<clever> i usualy turn tab completion off
<clever> Infinisil: and then in the slim.cfg you will find the session script under login_cmd
<clever> login_cmd exec /nix/store/hi4j75r312lsjhpdln9p8blyixs59hbs-bash-4.4-p12/bin/bash /nix/store/34gi6pjx7bnhyb4g2qpyiyrc0n1557py-xsession "%session"
<clever> [clever@amd-nixos:~]$ grep login_cmd /nix/store/nymy00p3574y1bmwq8xm4bhpdh0a2pkh-slim.cfg
<clever> Environment="SLIM_CFGFILE=/nix/store/nymy00p3574y1bmwq8xm4bhpdh0a2pkh-slim.cfg"
<clever> [clever@amd-nixos:~]$ grep SLIM_CFGFILE /etc/systemd/system/display-manager.service
<clever> Infinisil: in /etc/systemd/system/display-manager.service you will find the slim config path
<clever> Infinisil: which display manager are you using?
<clever> Infinisil: its usualy faster to find the xsession script in the displaymanager config, after nix-build has finished
<clever> ive got 8 cores and a lot of spare time
<clever> vaibhavsagar: i'm trying to reproduce the issue here, but the build is only 26% done
<clever> just saying that its not as broken as the wiki claims
<clever> Ralith: the logind stuff works fine for me on slim
<clever> that is just the path for one output, we need the paths for all the outputs to find the cycle
<clever> that failure
<clever> 2017-04-25 22:24:44 < vaibhavsagar> I'm trying to build MariaDB and it's running into a dependency cycle
<clever> and find out what the depdency graph is
<clever> vaibhavsagar: then grep each output for the other output paths
<clever> vaibhavsagar: checking the first few fields in that .drv will give you the path of each output
<clever> vaibhavsagar: when it fails, it will give a .drv path
<clever> vaibhavsagar: but it will leave the failed build in /nix/store, for you to manualy grep
<clever> vaibhavsagar: nix wont register a build as valid if it has a dependency cycle
<clever> Infinisil: thats the simplest way
<clever> Infinisil: run "nix-store -qR /run/current-system | grep xsession"
<clever> it was probably just factorio.overrideDerivation (old: { src = /home/clever/downloads/foo.tar.gz; })
<clever> yeah, its just gone
<clever> its not in my config.nix
<clever> trying to remember where i put it
<clever> Ralith: joepie91 is doing some other stuff with factorio and may know more
<clever> i just made an override that sets src=
<clever> the whole auth wall code did look pretty ugly
<clever> ah
<clever> Ralith: somebody was talking to me about mod changes recently

2017-04-25

<clever> you need to use some specialized commands to be able to modify files
<clever> it doesnt save changes by default
<clever> its far faster to test it in grub, then to edit configuration.nix, and nixos-rebuild every change
<clever> and you can test this in the grub console by just typing line 10 in directly
<clever> lines 7, 9, and 11 are useless now
<clever> from the output of blkid, i think this should work, "chainloader (hd1)+1"
<clever> the only thing search does, is find the drive automaticaly if the numbers change
<clever> but this loads the 1st sector of the whole drive: chainloader (hd1)+1
<clever> this loads the 1st sector of a partition: chainloader (hd1,msdos2)+1
<clever> it looks like windows has its own hdd, so you can probably use the MBR from that
<clever> simp__: oh, what about just chainload (hd1)+1
<clever> M$ deciding they need to change stuff that was working perfectly fine before they messed with it
<clever> why does M$ have to break everything? lol
<clever> that is odd, i dont even see a boot.ini in there
<clever> simp__: ok, now umount that, then mount sdb2 with the same cmd, and ls it
<clever> simp__: ok, try doing mount /dev/sdb1 -o ro /mnt and then ls /mnt
<clever> it needs the *
<clever> can you gist the output of "blkid /dev/sd*"
<clever> are you currently in nixos?
<clever> a lot of windows tools just hijack the MBR and break dual-booting
<clever> yeah
<clever> and look around to see what files are still there
<clever> you can also try using ntfs3g to try to mount the windows partitions under linux
<clever> and try looking in every drive and partition for a bootmgr file
<clever> simp__: double-check with tab completion to see what other files are on that partition
<clever> Infinisil: you can also use "--option build-cores 4" to override the value of that option
<clever> Infinisil: changes like nix.buildCores dont take effect until after nixos-rebuild is done, so you would need to temporarily remove/undo firefox's change
<clever> Infinisil: did you change configuration.nix's nix.buildCores in the same nixos-rebuild as firefox?
<clever> Infinisil: one min
<clever> then just guess and brute-force it until you find a solution
<clever> and you can test the chainload in that console
<clever> and it should even show you files within the FS if you put a / after it
<clever> you can open a grub console with c, and then use tab-complete on the (hd argument
<clever> it will open the ntfs filesystem and load the windows stage 2 loader
<clever> i think the reason the ntldr module in grub is special, it that it replaces the job of the mbr stub
<clever> the wiki i linked says the uuid example works on 10
<clever> if they havent made EFI required
<clever> probably
<clever> simp__: https://wiki.gentoo.org/wiki/GRUB2/Chainloading under the "windows 7 example"
<clever> simp__: there is also a new ntldr thing
<clever> to figure out which one you need
<clever> you can also just hit c at grub, and manualy type these commands in
<clever> which is pretty close to what i did, partition 1 of hdd 1
<clever> simp__: the example m0rphism showed runs chainloader directly on partition 1 of hdd 0
<clever> ive cross-compiled a kernel before when i was on gentoo and needed an rpi kernel
<clever> Sonarpulse: ah
<clever> simp__: line 12-13 tells grub to load the first 512 bytes of the windows partition and just jmp into it
<clever> simp__: https://pastebin.com/n0rJszs2 is how i did things
<clever> oops
<clever> Sonarpulse: something is acting up with my pc and cant load that link, but i have made my own system dual-boot via legacy
<clever> $CC and $CXX would be more portable
<clever> and when i switched them to clangStdenv for testing stuff, they broke
<clever> jophish, Sonarpulse: i have found some of my own packages that where poorly made, and just assumed g++ and gcc worked
<clever> but the fact its downloading, means the syntax passes
<clever> i recently did a nix-channel --update, but havent rebuilt nixos yet
<clever> obadz: this downloads something
<clever> nix-build -E '(import <nixpkgs/nixos> { configuration = { pkgs, ... }: { services.mingetty.autologinUser = "root"; virtualisation.graphics = false; environment.systemPackages = with pkgs; [ vim python36 ]; }; }).vm'
<clever> Sonarpulse: ah, i can just read the xml
<clever> obadz: dont think you need to import <nixpkgs> there, you can still do { pkgs, ... }: like normal
<clever> Sonarpulse: ah, link?
<clever> obadz: looks like kvm_main does the bulk of it, and then pmu_amd and svm handle the amd specific parts
<clever> obadz: and now i'm wondering how kvm works and what it can do! : https://github.com/torvalds/linux/blob/master/arch/x86/kvm/Makefile#L20-L21
<clever> Sonarpulse: what exactly has been redone in the cross-compile stuff?, how will it work without .nativeDrv and .crossDrv?
<clever> on nixos, its 666
<clever> Access: (0666/crw-rw-rw-) Uid: ( 0/ root) Gid: ( 0/ root)
<clever> obadz: what permissions are on /dev/kvm ?
<clever> NickHu: awk is in gawk, echo/kill are in coreutils
<clever> NickHu: yeah
<clever> Infinisil: the router is also running a hydra: http://hydra.earthtools.ca/
<clever> Infinisil: i have one of these acting as a router: http://www.supermicro.com/products/motherboard/Xeon800/E7520/X6DH8-XG2.cfm
<clever> yeah
<clever> then i can git clone all of nixcfg between machines
<clever> Infinisil: and then configuration.nix purely has whats needed to boot, and imports [ ./nixcfg/laptop.nix ];
<clever> Infinisil: i have a core.nix for stuff on every machine, then i have a router.nix, nas.nix, and laptop.nix, all of those have imports = [ ./core.nix ];
<clever> Infinisil: ah, i have things in the other direction
<clever> that never gets overwritten
<clever> Infinisil: you can also just put everything into configuration.nix
<clever> Infinisil: the only special thing about hardware-configuration.nix, is that nixos-generate-config will overwrite it
<clever> Infinisil: you can put config into either one
<clever> Infinisil: the 2 files are pretty much identical
<clever> and confusingly, nixpkgs will rename your buildInputs to nativeBuildInputs when the cross config is missing
<clever> and the buildInputs go into NIX_CROSS_LDFLAGS
<clever> the nativeBuildInputs have to go into NIX_LDFLAGS
<clever> jophish: you need the ability to compile host tools that are used in code generation
<clever> jophish: so everything had to be staticly linked
<clever> jophish: i also dont know why, but i could never get dynamic linking to work in the windows cross-compiles
<clever> jophish: that sounds likely
<clever> Infinisil: maxJobs controls the number of derivations in parallel, not the make level
<clever> i would expect the modern extension stuff to not allow executition of code like that
<clever> and in the event the ffi doesnt support your os, it can just execute a script (bash or bat)
<clever> InitiateSystemShutdownEx = lib.declare("InitiateSystemShutdownExW",ctypes.winapi_abi,ctypes.unsigned_long,
<clever> var lib = ctypes.open("Advapi32.dll");
<clever> its even using ctypes to ffi into the shutdown syscalls, so it can automate a long task, then turn the pc off
<clever> and it makes use of sqlite client-side to cache and log data
<clever> MichaelRaskin: and a few full blown xul based windows
<clever> MichaelRaskin: JSM modules, overlay js, custom sandbox's, greasemonkey level per-page sandboxes, and in-page js
<clever> MichaelRaskin: it currently has ~5 different eval contexts
<clever> MichaelRaskin: my extension dates back to 2008, and i'm surprised it still works so well
<clever> jophish: but that probably doesnt explain things
<clever> NickHu: you can manualy run sqlite3 on an older programs.sqlite from a past channel
<clever> Infinisil: i already run nixos-unstable, and it was firefox-52 before the update
<clever> MichaelRaskin: and it seems to just work, with zero changes
<clever> its already in nixos-unstable, so i just need a channel update and this
<clever> [clever@amd-nixos:~]$ nix-shell -p firefox --pure
<clever> helps you cheat a bit in an online game
<clever> i need to test my firefox extension on version 53, and put out an update
<clever> yeah
<clever> which reminds me, i need to update to 53
<clever> only things built by mozilla can use the firefox name
<clever> Infinisil: for legal reasons, copies of firefox cant use the "firefox" name, so when the build-script messes up, it doesnt taint the brand-name
<clever> Infinisil: the reason its split between the wrapper and firefox, is to avoid a recompile when changing plugin stuff
<clever> Infinisil: enableOfficialBranding is a compile-time thing
<clever> ah, your missing a {} at the end
<clever> it does eval on my end
<clever> «derivation /nix/store/y3v0rm2dzznkd31v3m9d5w9hkmwy2xd2-firefox-52.0.2.drv»
<clever> nix-repl> pkgs.wrapFirefox (firefox-unwrapped.override { enableOfficialBranding = true; }) {}
<clever> Infinisil: maybe you wrapped too much?
<clever> which will pass the new firefox directly to wrapFirefox to re-wrap it, then store it in the normal firefox attr
<clever> Infinisil: i think you can do firefox = pkgs.wrapFirefox (firefox-unwrapped.override { enableOfficialBranding = true; }) {};
<clever> 13788 firefox = wrapFirefox firefox-unwrapped { };
<clever> and adds an env variable saying where to find plugins
<clever> and firefox, is a bash script that wraps it
<clever> because firefox-unwrapped is the raw derivation with only firefox
<clever> and then you wont get any plugins
<clever> you want to apply the override to firefox-unwrapped or firefox-esr-unwrapped
<clever> pkgs/top-level/all-packages.nix- }) firefox-unwrapped firefox-esr-unwrapped;
<clever> pkgs/top-level/all-packages.nix: inherit (callPackages ../applications/networking/browsers/firefox {
<clever> the issue is how firefox plugins are loaded
<clever> benley: it is an override flag
<clever> nix-shell -p john to play with it
<clever> so it will depend on how good a password it is
<clever> then a program like john the ripper can be used to brute-force the password
<clever> alphor: but when you start using users.users.foo.initialPasswordHash in nixos, the hash is visible under /nix/store/, so you loose the protection shadow gave
<clever> alphor: so a non-root user can map user<->uid in /etc/passwd but not get your hashes
<clever> alphor: yeah, the point of shadow is to hide the hashes in /etc/shadow where only root can read them
<clever> alphor: and some of the security of the hash relies on the salt being randomized
<clever> alphor: passwd will generate a random salt
<clever> alphor: youll loose the benefit of shadow, but an attacker still has to brute-force the hash
<clever> alphor: or if you trust the password hashing, you can set an initialPasswordHash on a user
<clever> alphor: you can still configure users declaratively, and just set the password manualy afterwards
<clever> alphor: yeah, every user can see every file in the store, and any config/passwords that might be there
<clever> kk
<clever> copumpkin: ah, i did think it was odd to see that commit on that repo
<clever> jophish: no idea then, i would expect those to work the same
<clever> the pkgs. isnt required on either
<clever> jophish: what about just -A hello ?
<clever> jophish: one sets crossSystem, the other sets crossPlatform
<clever> bdimcheff: firefox is just a large xulrunner based app
<clever> bdimcheff: and xulrunner is pretty much the exact same thing, built on mozilla's JS engine
<clever> copumpkin: right hand was a little too slow, i sometimes desync the hands when typing too fast
<clever> maikklein: and here is a triangle example i did on the raspberry pi, with direct register access: https://www.youtube.com/watch?v=V6ogpgieJrQ
<clever> 3 brings callPackage back, and uses up 2 files
<clever> 2 is a modified form of 2, storing it in an attrset
<clever> 1 is the simplest, just skip the need for callPackage entirely
<clever> maikklein: close, let me fork and make a few examples
<clever> maikklein: i have done that triangle example, with custom drivers
<clever> maikklein: i also have some experience attacking 3d rendering from an unusual direction
<clever> maikklein: nix-shell -E 'with import <nixpkgs> {}; callPackage ./default.nix {}'
<clever> maikklein: that is right, the file has to be loaded with callPackage
<clever> removing stale link from ‘/nix/var/nix/gcroots/auto/26kqyvvf6h9chi30fachc8hkx8553a54’ to ‘/home/clever/srk/result’
<clever> but i also dont want to loose the entire cache
<clever> and you need to do a gc pass to make it clean up stuff in auto