2019-10-07

<clever> ,pr
<clever> its also checked on that issue
<clever> oh, i didnt check the release 19.09 branch, but if hydra is saying its passing, then its fixed
<clever> then it will find out who fixed it!
<clever> claim the passing one is bad, and the failing one is good!
<clever> or you can just use bisect the wrong way around, lol
<clever> if you click the last failing, and the first passing, youll have a narrow range of revs
<clever> evils: https://hydra.nixos.org/job/nixos/release-19.09/nixpkgs.bees.x86_64-linux this says it was fixed 3 builds ago
<clever> somebody beat you to it?
<clever> evils: but if i switch to master, it works!
<clever> evils: yep, i can reproduce the failure on this end
<clever> ImportError: No module named pkg_resources
<clever> [clever@amd-nixos:~/apps/nixpkgs-master]$ nix-build pkgs/top-level/release.nix -A bees.x86_64-linux
<clever> evils: yeah, the nixpkgs rev is on that tab
<clever> evils: can you link the failing build on hydra?
<clever> evils: if you checkout the same rev hydra used, and leave it un-modified, can you reproduce the failure?
<clever> evils: cached success or cached failure?
<clever> evils: and the name of the job itself, is an attr of release.nix, so `nix-build path/to/release.nix -A something`
<clever> evils: if you read the configuration tab in the hydra jobset, it will name a release.nix file
<clever> mishac: find its name (or full storepath), and just nix-env -e it
<clever> nh2_: 19.09 hasnt finished stabalizing yet
<clever> or it could parse as <expr> / <expr>, plain division
<clever> as-in, treating PATH as a function, and then running it on a 2nd path, /overlay.nix
<clever> jlv: that could parse as either <expr> /overlay.nix
<clever> 's after every + operation
<clever> nix will strip any redundant /
<clever> jlv: also, beware, ./. + "/" == ./.
<clever> ah, if its a path in a variable,then you need to add to it with + like that
<clever> ehh, bot wont let me show it, but try that in `nix repl`
<clever> > builtins.typeOf "${./.}"
<clever> > builtins.typeOf ./.
<clever> jlv: paths can also turn into strings just by using them in certain ways
<clever> jlv: the fetch functions are also part of pkgs., not lib., so youll find them in all-packages.nix
<clever> jlv: they return a set, which can also be treated as a string
<clever> jlv: fetchFromGitHub, and all of the other fetch functions, are just derivations
<clever> jlv: mostly, i just read the definitions in lib.nix
<clever> yep
<clever> oscarvarto: i prefer using gist, since it had edit, fork, and nix support
<clever> mishac: yay
<clever> iqubic: dont know
<clever> mishac: once installed, it should be listed in `nix-env -q` and be merged within ~/.nix-profile
<clever> iqubic: 2019-10-06 21:25:22 < clever> oscarvarto: some ipv6 tests, and ova images are failing to build, so nixos-unstable hasnt updated
<clever> mishac: just use the same path it was at on the other machine
<clever> mishac: try removign that
<clever> mishac: what is the exact output from `ssh debian@192.168.7.2 nix-store --version` ?
<clever> mishac: i think you have an echo in your .bashrc still, its printing something about an hmac hash?
<clever> > (5207041058928806221).toString(16)
<clever> 'HC AHSH\u0000'
<clever> > Buffer("4843204148534800","hex").toString("ascii")
<clever> '4843204148534800'
<clever> jlv: in this case, it needs to know what the value of the overlays is, to know the value of fetchFromGitHub
<clever> jlv: you probably want to use (import <nixpkgs> {}).fetchFromGitHub
<clever> jlv: where exactly are you using it?
<clever> mishac: chown debian -R /nix
<clever> mishac: ah, that part, if you want a normal single-user install, then that single user must own everything in /nix/
<clever> mishac: are you getting an error somewhere?
<clever> mishac: yes
<clever> mishac: you only need +r and +x to the store, which nix gives to all
<clever> mishac: no
<clever> mishac: you must fix the PATH before that point, not after it
<clever> mishac: line 6-9 is the problem, that causes the file to return early
<clever> mishac: cat /home/debian/.bashrc ?
<clever> mishac: what does `grep debian /etc/passwd` say?
<clever> mishac: does it work now?
<clever> exactly as i gave, the nix-store must be on the same line as the ssh
<clever> mishac: is it also available in `ssh user@host nix-store --version` ?
<clever> mishac: what is the shell for that user?
<clever> mishac: what if you try .bash_profile instead?
<clever> mishac: then that .bashrc isnt fixing PATH either, is it in the home for the right user?
<clever> mishac: add an echo to `.bashrc`, does it print when you `ssh user@host nix-store --version` ?
<clever> oscarvarto: you could just do `nix-env -f https://github.com/nixos/nixpkgs/archive/master.tar.gz -iA sbt` to install it from master temporarily
<clever> nixpkgs-unstable and nixos-unstable-small test less things, so they update faster
<clever> oscarvarto: some ipv6 tests, and ova images are failing to build, so nixos-unstable hasnt updated
<clever> oscarvarto: nixos-unstable is 10 days behind, while nixos-unstable-small is 1 day behind
<clever> ,howoldis
<clever> oscarvarto: this shows, that the change is currently in nixos-unstable-small and nixpkgs-unstable
<clever> oscarvarto: then switch over to the nixpkgs-channels repo, https://github.com/NixOS/nixpkgs-channels/commit/fbd3e7b9e5d09c94d1ff44105770139e209ac538
<clever> oscarvarto: nixos-unstable and nixpkgs-unstable both follow master, so there isnt much difference between them
<clever> freeman42x: you must use `package miso`, not `package app`
<clever> freeman42x: so you must tell cabal to set it on miso, not app
<clever> freeman42x: the jsaddle flag is on the miso package
<clever> freeman42x: app doesnt have a jsaddle flag
<clever> freeman42x: i see why now, you told cabal to set the jsaddle flag, on app
<clever> you either need to let nixpkgs do things for you, or use cabal 2
<clever> or let something like nixpkgs do it for you
<clever> freeman42x: that requires you to build every single dependency seperately and by hand
<clever> freeman42x: how else is hie building miso for you?
<clever> freeman42x: looks good at a glance
<clever> and that something else, is what chooses those flags
<clever> either stack, nix, or cabal.project
<clever> freeman42x: something else must `cabal build` and `cabal install` those things
<clever> freeman42x: the .cabal file cant control the building of other packages, it can only refer to things already built
<clever> freeman42x: yes
<clever> astrall33: and if your just doing NIX_PATH=/path/to/dir, and dir then contains nixpkgs, nix search doesnt understand it
<clever> astrall33: i'm guessing that `nix search` will look for a key=value pair in NIX_PATH
<clever> astrall33: ahh
<clever> freeman42x: this is how you turn flags in a cabal package on/off

2019-10-06

<clever> astrall33: what did it?
<clever> freeman42x: that doesnt enable jsaddle in miso, that creates a new jsaddle flag for app, that does absolutely nothing
<clever> freeman42x: reference miso, and turn on the jsaddle cabal flag
<clever> freeman42x: and that is a flag in the cabal file
<clever> freeman42x: this line says that miso-jsaddle, is just miso.cabal, but compiled with -fjsaddle passed to it
<clever> freeman42x: so you can either force change the version of something, or add missing things
<clever> freeman42x: cabal.project lets you point cabal towards any package, in hackage or not
<clever> (even when in docker fake root)
<clever> the biggest problem i ran into, is that postgresql refuses to even start, if its ran as "root"
<clever> notgne2: its basically an example of how to make linux boot directly into a single haskell binary, with no OS above it
<clever> notgne2: this is a single haskell binary, and some nix code to compile it (with muslc), jam it into an initrd (at /init), and then run it with qemu+linux
<clever> notgne2: have you seen not-os or haskell-init before?
<clever> freeman42x: have you read the cabal docs on cabal.project?
<clever> freeman42x: then you need to do it in cabal.project, like this: https://github.com/input-output-hk/cardano-explorer/blob/master/cabal.project#L54-L63
<clever> joebobjoe: i prefer doing everything in a declarative manner
<clever> joebobjoe: i dont think there is a replacement for nix-env
<clever> freeman42x: are you using stack or cabal?
<clever> freeman42x: for a non-nix solution, you have to add it to either stack.yaml or cabal.project, as a normal pinned version thing
<clever> freeman42x: if its not in hackage, then you must load it with callCabal2nix
<clever> i started learning both at the same time, but finished the basics of nix first
<clever> fuzen: ive been a fan of haskell and servant lately
<clever> ive been sticking to nginx lately, and has nice config in nixos
<clever> astrall33: what exactly do you want done?
<clever> astrall33: but depending on what you want done, things can be simpler
<clever> astrall33: this creates a single container, that spins up postgresql, prometheus, nginx, grafana, oauth2_proxy, and a few other things
<clever> astrall33: ive done that recently, but getting the nixos services to run in docker is tricky
<clever> fuzen: zfs will (by default) use no more then 50% of the ram, and it will dynamically use much less (as low as ~5mb) if it detects things wanting more
<clever> fuzen: and zfs will then prompt on bootup
<clever> fuzen: i think https://nixos.org/nixos/options.html#zfs.requ is the only config flag you need
<clever> sondr3: for most of my stuff, i just host it out of my router or nas, lol
<clever> sondr3: you can also use kexec to force nixos onto any hardware, so you could just reinstall over your existing server
<clever> sondr3: packet.net has support to install nixos on dedicated hardware
<clever> sondr3: aws allows anybody to make disk images public, so there are pre-made images with nixos you can select from
<clever> fuzen: id say just ditch lvm, and use zfs to span multiple disks, you can do zfs on luks, or zfs native crypti
<clever> fuzen: that will be difficult to support...
<clever> fuzen: ah, there is no boot.luks, so all luks devices get opened in the initrd
<clever> fuzen: for /home, it normally gets mounted by systemd, after / is mounted, so the keyFile paths can be relative to /, and you can use the boot.luks, rather then boot.initrd.luks
<clever> fuzen: if you set preLVM, then the initrd will open the luks device before it tries to search for LVM devices
<clever> evils: they are both bash, but they are versions 4.2 and 4.4
<clever> needs more investigation!
<clever> evils: odd, tab-complete over ssh to gentoo beeps, but tab-complete on nixos doesnt...
<clever> evils: the difference is just wether it loads before or after mounting /
<clever> evils: another anoying thing, the beep is coming out of the motherboard, not the headset, so its not wireless-y
<clever> evils: ok, maybe i dont want beep working, {^_^} just went off, lol
<clever> oscarvarto: programs.java.package says what java package to use
<clever> interesting, `tput bel` beeps, but tab doesnt
<clever> after that, i think its up to the X server, to map that event to the hardware
<clever> i got that when i loaded it
<clever> [529204.880242] input: PC Speaker as /devices/platform/pcspkr/input/input32
<clever> evils: anything in dmesg?
<clever> The set of kernel modules to be loaded in the second stage of the boot process. Note that modules that are needed to mount the root file system should be added to boot.initrd.availableKernelModules or boot.initrd.kernelModules.
<clever> boot.kernelModules
<clever> evils: holy crap, that works, and actually comes from the motherboard speaker!
<clever> if i had headphones on, and hit tab at the wrong time, i practically leaped out of my chair
<clever> but its better then it was before, the older machines have an ear-splitting bel noise, with no volume adjustment
<clever> evils: thats been bothering me for years, bel character just doesnt work
<clever> i dont bother with locking on the desktop, i literally sleep beside it :P
<clever> synergy is also messing with things
<clever> not sure why, but forcing it off breaks the sleep sometimes, and then it never goes off by itself
<clever> i tend to be doing the reverse, `xset dpms force off` to turn the screen off at night
<clever> evils: ah, then run xscreensaver-config or something, and adjust cfg
<clever> evils: if you run `xset q`, you can see the current config, and other xset flags can change it
<clever> kindaro: and the glibc used by it may not even be compatible
<clever> kindaro: not easily, the compilers nix generates, are configured to never look in places like /usr/lib/
<clever> kindaro: your probably going to have better luck if your testing it in nixos, even if it was inside a vm
<clever> kindaro: opengl stuff doesnt always work outside of nixos, due to complications of how opengl itself works
<clever> infinisil: ahh
<clever> ,nixgl kindaro
<clever> infinisil: why is an a after a z? lol
<clever> ,2
<clever> infinisil: at least sort things!!!
<clever> ,1
<clever> ,
<clever> kindaro: are you on nixos?
<clever> kindaro: does /run/opengl-driver exist? which nixpkgs rev are you on?
<clever> kindaro: i can clearly see it opening gpu specific files, so that half of things is working
<clever> openat(AT_FDCWD, "/run/opengl-driver/lib/dri/radeonsi_dri.so", O_RDONLY|O_CLOEXEC) = 5
<clever> openat(AT_FDCWD, "/run/opengl-driver/lib/libGL.so.1", O_RDONLY|O_CLOEXEC) = 3
<clever> [clever@amd-nixos:~/apps/kindaro]$ strace -f -e openat ./result/bin/thing 2>&1 | grep opengl | grep -v ENOENT
<clever> kindaro: thats what i get when i run it, anything i should check?
<clever> [clever@amd-nixos:~/apps/kindaro]$ ./result/bin/thing
<clever> X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 1 (X_CreateWindow)
<clever> *looks*
<clever> kindaro: can you pastebin the haskell code your trying to build?
<clever> kindaro: you need a lot of dynamic libraries, to deal with driver stuff
<clever> kindaro: i dont think opengl stuff is really going to work in a static binary
<clever> ,locate pinentry-gnome3
<clever> peanutbutter144: you likely need to install it first
<clever> peanutbutter144: then gnupg wont find it either
<clever> peanutbutter144: does `which pinentry-gnome3` find it?
<clever> then create it with ln
<clever> ls -lh should show exactly what i gave above
<clever> mishac: you need to symlink to default
<clever> mishac: ln will create it
<clever> mishac: you should just symlink .nix-profile to the dir
<clever> mishac: what are the contents?
<clever> mishac: yeah, after you nix-env -i /nix/store/something-nix
<clever> mishac: make-system-tarball.nix auto-generates a hydra-build-products file, so if you build it on hydra, you get a link to the tar, right on hyra
<clever> and then for a given arch, the maintainers select which ones actually help (or even work)
<clever> with llvm, you have 100's of seperate optimize functions
<clever> astrall33: but ive heard that llvm's optimizer is very flexible, and could likely do this more easily...
<clever> astrall33: yeah, you could just make it a optimization pass in gcc, to make all switch blocks do this
<clever> its got more function prolog to deal with, but the relative calls could still be predicted the same way
<clever> hmmmm, but maybe the existing AST nodes and virtual eval functions, already form the exact same kind of structure this guy was forcing?....
<clever> nix isnt a bytecode, so you cant just blindly apply this to it!
<clever> astrall33: now i'm stuck trying to figure out how to use this in nix, lol
<clever> otherwise, its identical code
<clever> the code that was shared at the top of a switch-case block, just got cut&pasted into the `break;` at the end of each case block
<clever> this is more of a loop unrolling thing, then a major redesign
<clever> astrall33: you should still of course validate all input :P
<clever> so if A is followed by B 100% of the time, the branch prediction can get it right
<clever> astrall33: so the cpu can predict, based on what the previous opcode was
<clever> astrall33: but with goto*, you have one jmp, at the end of each opcode
<clever> astrall33: without goto*, the entire switch/case share a single jmp in assembly, so the cpu has to predict based on how often a single opcode occurs in the emulated language
<clever> astrall33: and the cpu will predict where a given jmp will go, based on where it has gone before
<clever> astrall33: the trick, is that you have index relative jumps, via jump tables
<clever> mishac: then create a group, nixbld, and add all users to it
<clever> mishac: create an array of users, nixbld1, nixbld2 .... up to some number of your choosing
<clever> so you need goto label to be able to force the compiler to generate the fast code
<clever> but the compiler doesnt generate such assembly
<clever> and its more a matter of the assembly is easy to write to be even faster
<clever> astrall33: in the example he found, switch/case blocks, that involve bytecode interpreting, is the major benefit
<clever> label:
<clever> goto* label;
<clever> void *foo = &&label;
<clever> and then goto that pointer
<clever> astrall33: basically, you can put a label into a pointer
<clever> astrall33: the guy doing the talk on it, may have been threaned by the c++ commitee, to stop talking about it :P
<clever> astrall33: it can give you as much as a 40% speed boost in some cases
<clever> astrall33: i recently saw a video about the power of the new goto* in c/c++
<clever> which can leave some root powers in your process, even if you think they are gone
<clever> simpson: but there are certain conditions that make a thread not possible to interupt
<clever> simpson: glibc emulates setuid being process wide, by interupting every thread, to run setuid in each of them!!
<clever> simpson: so you could drop root in a thread, then execute untrusted code, which screws with another threads stack, to regain root
<clever> simpson: one fun (and security related) thing i learned, is that setuid (the syscall) only impacts the current thread
<clever> kindaro: just grab the entire default.nix file i linked, throw your code into hello_world.hs, and then `nix-build -A hello_world`
<clever> kindaro: did you try something similar to the haskell-init code?
<clever> kindaro: muslc is an alternative to glibc, that is more designed for static use
<clever> kindaro: and i stripped b down to the bare minimum here https://github.com/cleverca22/nix-tests/blob/master/haskell-init/default.nix#L3-L13
<clever> kindaro: b: https://github.com/nh2/static-haskell-nix does exactly what you want
<clever> kindaro: a: pkgsCross.musl64 will provide everything static without you having to do anything
<clever> kindaro: that 2nd one will use a static muslc, (and static everything), rather then static glibc
<clever> kindaro: nix-shell -E 'with import <nixpkgs> {}; pkgsCross.musl64.stdenv.mkDerivation { name = "name"; buildInputs = []; }'
<clever> kindaro: either `nix-shell -p glibc.static` or ....
<clever> astrall33: ah, i missed a meta
<clever> > haskellPackages.aeson.meta.description
<clever> kindaro: but you may want the muslc cross-compiler, which needs -E instead
<clever> kindaro: nix-shell -p dynamically generates a stdenv.mkDerivation, and shoves all arguments into the buildInputs
<clever> > haskellPackages.aeson.description
<clever> so you dont really need to search
<clever> astrall33: also, nixpkgs has every single package on hackage, and with the same names
<clever> astrall33: i just tab-complete haskellPackages. under `nix repl '<nixpkgs>'`
<clever> astrall33: next, id think you should check the source for `nix search` to see what its doing
<clever> error: no results for the given search term(s)!
<clever> trace: warning: Public updates for Oracle Java SE 8 released after January 2019 will not be available for business, commercial or production use without a commercial license. See https://java.com/en/download/release_notice.jsp for more information.
<clever> outa ideas then
<clever> `nix search -u firefox` ?
<clever> try `nix search -u` again?
<clever> that should be working...
<clever> is this on nixos, or another distro?
<clever> thatll do it!
<clever> astrall33: what about echo $NIX_PATH
<clever> ah, so that part is working
<clever> astrall33: did you do mkdir on that path?
<clever> astrall33: it should be a symlink to this
<clever> ]$ ls -lh ~/.nix-defexpr/channels
<clever> lrwxrwxrwx 1 clever users 46 Jun 6 2018 /home/clever/.nix-defexpr/channels -> /nix/var/nix/profiles/per-user/clever/channels
<clever> omnipotententity: root has its own channels, sudo nix-channel --list
<clever> astrall33: nix-channel --update
<clever> astrall33: nix-channel --list?
<clever> bbl
<clever> mishac: or you can setup build users, if you do want to use nix as root
<clever> mishac: that error will go away if you run nix without root, and give that user +w to /nix/store
<clever> and put ~/.nix-profile/bin/ into PATH
<clever> then throw a symlink like this into one (or more) of your users
<clever> lrwxrwxrwx 1 clever clever 29 Oct 8 2015 .nix-profile -> /nix/var/nix/profiles/default
<clever> clever@c2d ~ $ ls -lh .nix-profile
<clever> and then nix-env is in the bin dir of that profile
<clever> mishac: you should now have a profile under /nix/var/nix/profiles/
<clever> mishac: you must use the actual path to the nix derivation, that nix-env itself is in
<clever> and then fetchpatch that, and shove into patches
<clever> tilpner: you can also just slap a .patch onto the end of any github commit, to turn it into a patch
<clever> tilpner: this is another option
<clever> /home/clever/apps/nixpkgs/pkgs/development/compilers/ocaml/4.08.nix: hardeningDisable = [ "strictoverflow" ];
<clever> tilpner: you can also disable hardening flags
<clever> storeContents = [ { object = (import <nixpkgs> {}).pkgsCross.armv7l-hf-multiplatform.nix; symlink = "/nix-built"; } ];