2019-05-15

<clever> error: attribute 'gmp' missing, at /nix/store/sf0phgki1bddmglmglsxd27p5lv164y3-source/pkgs/development/compilers/ghc/8.6.4.nix:158:28
<clever> nix-repl> x86_64-pc-mingw32-ghc864.x86_64-linux
<clever> ive also had plans to replace the nixpkgs release-lib, since it doesnt really fit with our needs
<clever> looking...

2019-05-14

<clever> so a dedicated option exists for path, that knows how to merge
<clever> the issue, is that systemd.nix adds some default things to PATH, so the normal Environment.PATH cant be set, since the whole Enrivonment key lacks merge rules
<clever> samrose: https://nixos.org/nixos/options.html#systemd.services.%3Cname%3E.path
<clever> samrose: yes
<clever> and instantly use it
<clever> if you change the fetchurl to use the right hash, it will then discover the artifact it previously downloaded
<clever> but its not the path your fetchurl was giving
<clever> that means it will keep whatever the artifact is, and the path its at will match its hash
<clever> maybe
<clever> pie__: basically, if a fixed output derivation has the wrong hash, it renames the $out to match its hash
<clever> pie__: there is a prefetch flag that will do that
<clever> infinisil: i think it 200'd, then began downloading, then died mid-download
<clever> infinisil: sounds like the tcp connection failed mid way, and that EOF'd xz, which threw its own error
<clever> all 3 have the root and nix store on zfs
<clever> Baughn: the nas is zfs on 3 mechanical drives
<clever> Baughn: the desktop and laptop are zfs on nvme with no redundancy
<clever> Baughn: i have 3 machines that are pure zfs
<clever> lejonet: have you changed your boot.kernelPackages?
<clever> lejonet: the 64bit kernel has 32bit support enabled by default
<clever> sb0: sudo rm /root/.cache/nix/binary-cache-v6.sqlite*
<clever> yorick: <nixos-unstable> isnt quoted, so thats shell redirection
<clever> yorick: -I wont accept search paths
<clever> nix show-config | grep allow
<clever> yorick: fetchTarball requires it to be in the allowed-uris option in nix.conf
<clever> yorick: ifd is allowed, but the inputs are still bound to the normal sandbox rules
<clever> yorick: hydra is always in restricted mode
<clever> Taneb: you can -e 'trace=!select' to hide that
<clever> Taneb: thats normal, its waiting up to 1 second for events on fd 5
<clever> and they are doing -qa, which nix-build doesnt support
<clever> jomik: that is why restricted eval was on
<clever> --option restrict-eval true
<clever> just use plain nix-build
<clever> that will ruin your disk usage
<clever> jomik: and you shouldnt be using nix-env when doing testing or ci type things
<clever> jomik: why is restricted mode enabled?
<clever> jomik: -I cant take search paths like <foo>
<clever> ah, i was thinking about how aws's hypervisor handles things, but packet is baremetal
<clever> Taneb: find the pid's for nix-serve, and run `strace -p pid1 -p pid2 ...` and then see what happens when you curl it
<clever> Taneb: what does `top` look like?
<clever> yorick: what IP does that domain have?
<clever> yorick: there may be seperate code to enforce your mac having the ip you should have
<clever> rauno: source ip
<clever> sphalerite: careful, it might umount everything, just to spite you!
<clever> and either ack or nak depending on if you find it
<clever> basically, you need to write the size of the firmware to a special /sys entry, then the blob itself, and do it in response to a hotplug event thing
<clever> so i could get wifi in my custom initrd
<clever> sphalerite: i once wrote bash scripts to deal with firmware loading
<clever> > udev
<clever> i would use udev, but systemd ate it :P
<clever> sphalerite: devtmpfs is a special kernel fs to auto-create them
<clever> mount -t devtmpfs devtmpfs /dev
<clever> sphalerite: also, watch https://www.youtube.com/watch?v=o_AIw9bGogo
<clever> prior to nixos, i was anti-systemd
<clever> sphalerite: i think i have stockholm syndrome :P
<clever> blame systemd :P
<clever> if your changing the /boot device, you must update configuration.nix, nixos-rebuild test, mount the right one, nixos-rebuild switch
<clever> the "wrong" device is at /boot, so it umounts it for you
<clever> you can thank sytemd for this issue
<clever> sphalerite: oh right, i remember, i had this exact problem before
<clever> the command to mount it
<clever> sphalerite: what does `strace mount` report?

2019-05-13

<clever> its much more of a black box then the other things ive investigated to ridiculus details, lol
<clever> possibly, i dont fully know the internal workings of bluetoothctl and bluetooth itself
<clever> sphalerite: commented on your gist with mine
<clever> 2 of them
<clever> UUID: Headset AG (00001112-0000-1000-8000-00805f9b34fb)
<clever> my laptop includes the headset profile
<clever> UUID: Headset (00001108-0000-1000-8000-00805f9b34fb)
<clever> sphalerite: run `bluetoothctl` and then `show`
<clever> so if the hardware lacks the ability to be ab HFP client, then you can never use a bluetooth headset in HFP
<clever> sphalerite: bluetooth is still a bit of a mystery to me, from what ive seen, the dongle in the computer needs to support every profile you want to use
<clever> sphalerite: journal?
<clever> sphalerite: weird, are you using pulse full?
<clever> sphalerite: the laptop can connect, claiming to be a headset, and then it routes all audio into pulse!
<clever> sphalerite: ive also noticed fun things a laptop can do to bluetooth on phones
<clever> sphalerite: i ran blueman-manager, connected it as a hands free device, and it instantly appeared in pavucontrol, in the HSP/PFP profile, and is an input device
<clever> sphalerite: let me fetch some of my BT devices and see what happens
<clever> info*
<clever> __monty__: more into in #haskell.nix
<clever> __monty__: you would either need to somehow force the version of Cabal earlier in the overlay setup (causing ghc to rebuild), or use angerman's haskell.nix stuff to allow overriding anything that was builtin with the old system
<clever> sphalerite: thats strange
<clever> __monty__: any attempt to force it will lead to eratic failures, due to 2 Cabals being present
<clever> __monty__: Cabal cant be overridden, because its one of the builtin packages
<clever> sphalerite: nothing on the input devices tab for both modes?
<clever> sphalerite: but the HSP/HFP should have a mic
<clever> sphalerite: there are seperate profiles for music (stereo, but no mic) and phone usage (mono, both directions), the profile also changes the samplerates for the playback channel
<clever> sphalerite: check the profiles on the configuration tab
<clever> samrose: looks like i never put that eclipse plugin on github, its likely in one of my backups of backups of backups, lol
<clever> __monty__: call .override on each thing you want to affect
<clever> yeah, ive only used it for java based projects
<clever> i even wrote my own custom eclipse plugin to fetch backtraces from my server, display them in the editor, and let me click on any stack frame to jump to that line in the code
<clever> samrose: i found the android ui editor in eclipse to be good 90% of the time
<clever> so: journalctl --root=/mnt/ -u nixos-upgrade
<clever> Takes a directory path as an argument. If specified, journalctl will operate on journal directories and catalog file hierarchy underneath the specified directory instead of the root directory (e.g. --update-catalog will create
<clever> --root=ROOT
<clever> bsima1_: one second
<clever> ah
<clever> angerman: you will need at least the hash of the hackage index at that given time, and that hackage index would need to contain the hashes of the cabal files and source tars
<clever> angerman: this will recursively fetch repos, parse the DEPS file in the root of each, and generate an attrset of fixed-output derivations, then generate a runCommand that copies them all into one dir
<clever> angerman: so, i then began rewritting all of gclient, in haskell
<clever> but gclient has post-fetch hooks, and it will download a second (unpatched) copy of gclient, which then fails due to a lack of /bin/
<clever> that runs gclient, and fetches ~30gig of electron+chromium source, lol
<clever> angerman: knowing all of that, then lets you make crazy things like https://github.com/input-output-hk/gclient2nix/blob/master/default.nix#L33-L49
<clever> nix-hash, without --flat, gives you the recursive hash
<clever> outputHashMode = "recursive" means you are giving the hash of the nar archive of $out (it can be a file, dir, or symlink)
<clever> outputHashMode = "flat" means that you are giving the raw hash for the $out file
<clever> outputHashAlgo is usually sha256, but something like yarn2nix can just copy the hash&algo from yarn.lock, and not even fetch things when translating
<clever> angerman: then it is a fixed-output derivation, and gains network access
<clever> angerman: basically, if a derivation has the following attributes: outputHash, outputHashAlgo, outputHashMode
<clever> you can also use a custom fetch function
<clever> fetchzip will use recursive hashing, so $out can be a dir, and you can just rm the unpredictable bits
<clever> although, fetchurl uses flat hashing, so $out must be a single file
<clever> i have even seen a fixed output derivation that will abuse hash collisions, to get 2 different values from the same hash
<clever> angerman: all nix cares about, is the hash at the end, so as long as you can reproduce that hash, the build will "pass"
<clever> 0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i
<clever> [clever@system76:~]$ nix-hash --flat --base32 --type sha256 /nix/store/3x7dwzq014bblazs7kq20p9hyzz0qh8g-hello-2.10.tar.gz
<clever> "0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i"
<clever> nix-repl> hello.src.outputHash
<clever> it doesnt care how you meet that goal
<clever> fixed-output derivations purely care about the hash of $out when the build is done
<clever> then it should just work
<clever> then it will be imposible to reproduce the build in the future, and a copy of the artifact should be archived somewhere
<clever> angerman: in general, you prefetch it from something else, and then bake the hash into the nix code
<clever> try -vvvv with something that can fail
<clever> nix-build '<nixpkgs>' -A hello -vvvvv
<clever> nix-store --version ?
<clever> what does `echo $NIX_REMOTE` say?
<clever> is nix-daemon running?
<clever> nixos or other?
<clever> MasseR: what happens if you try callHackage?
<clever> you may also need callHackageDirect which has a slightly different api
<clever> so it should work
<clever> callHackage just combines callCabal2nix and hackage2nix
<clever> > (haskellPackages.callHackage "scalpel-core" "0.7.0" {}).isHaskellLibrary
<clever> which will then run cabal2nix over that
<clever> you want callHackage
<clever> not a haskell package
<clever> oh, i think hackage2nix just returns the cabal file
<clever> > haskellPackages.lens.isHaskellLibrary
<clever> > (haskellPackages.hackage2nix "scalpel-core" "0.7.0").isHaskellLibrary
<clever> its checking to see if it has an isHaskellLibrary attribute
<clever> i think
<clever> > haskellPackages.hackage2nix "scalpel-core" "0.7.0"
<clever> MasseR: what is the type of haskellPackages.hackage2nix "scalpel-core" "0.7.0" ?
<clever> that results in it ignoring functions and other things
<clever> MasseR: ghcWithPackages will run a filter over its list, to only get haskell packages
<clever> kozova1: did you restart pulseaudio?
<clever> in configuration.nix
<clever> add hardware.pulseaudio.extraConfig = "load-module module-udev-detect tsched=0";
<clever> the .include comes from line 34 of the nix file i linked
<clever> and this config option lets you insert extra lines into it
<clever> kozova1: https://nixos.org/nixos/options.html#hardware.pulseaudio.extraconfig
<clever> kozova1: it is generated over here
<clever> kozova1: why cant that fix be done on nixos?
<clever> just beware of the io that must not be named!
<clever> flip on safe haskell and the compiler wont let you unsafePerformIO!
<clever> would it even care what type a Char is? its just generating AST's
<clever> i'm more thinking about things like makeLenses, its a pure function and doesnt really care about IO or platform
<clever> but that still has IO in the TH splice?
<clever> ah
<clever> ignoring #ifdef mess's, could you take that AST, and then rebuild the closure of a given splice, for x86-linux?
<clever> oh, i just remembered, there was some talk before about the compiler leaving the entire parsed AST in the .hi files?
<clever> then you could compile the TH for a different platform
<clever> this is why i can see value in the TH code having its own set of imports, that are clearly isolated from the target deps
<clever> and all the import statements are covered by the .dll files the deps provide
<clever> though thats likely very small
<clever> what about the blob of TH code that it compiled and now has to run?
<clever> moving large chunks of data to the child proc via shared memory
<clever> only thing i can see you gaining from winelib, would be shm
<clever> yeah, if its already working with network, you could keep it like that for now
<clever> yeah, you would probably want to make it optional, so you can skip the network if wine and an FD is available
<clever> the first 80% of that page, is more about taking "windows" source, linking against wine, and creating a "native linux" binary
<clever> angerman: i think this is the section we want
<clever> teamviewer has gotten worse, you must now run a daemon as root, for the client to even start
<clever> its just the "windows" frontend, with a special winelib to handle x11 screen capture
<clever> teamviewer is one program that i have seen doing that before
<clever> angerman: you can also write a custom wine library, that will claim to be a normal .dll file, but is implemented entirely on the linux side
<clever> you may also be able to just GetProcAddress() any glibc function
<clever> from a ".exe" file
<clever> and if you can convince the compiler, you can just staticly link in some linux muslc, and call the linux open() or read() and bypass wine
<clever> angerman: you can query the addresses of internal wine symbols, and easily detect wine
<clever>  Assigned(GetProcAddress(hnd, 'wine_get_version')) or Assigned(GetProcAddress(hnd, 'wine_nt_to_unix_file_name'));
<clever> hnd := LoadLibrary('ntdll.dll');
<clever> one sec
<clever> also of note, wine doesnt do anything to block the linux api
<clever> ahh
<clever> angerman: i'm curious as to why stdin/stdout of `wine iserve.exe` didnt work?
<clever> > versionAtLeast "5.1.1" "5.1"
<clever> then you want that attrpath
<clever> > linuxPackages_latest.kernel.version
<clever> ar1a: what did you set it to?
<clever> ar1a: did you set boot.kernelPackages ?
<clever> ar1a: what does `ls -l /run/{current,booted}-system/kernel` return?
<clever> > linux.version
<clever> and if you want nixpkgs loaded, nix repl '<nixpkgs>'
<clever> ar1a: `nix repl`

2019-05-12

<clever> tryingtoupgrade: nix-env --profile /nix/var/nix/profiles/system --list-generations

2019-05-11

<clever> how will he ever leave without knowing how to leave!
<clever> putting it all in one central place makes the failures worse
<clever> thats why i prefer self-hosting when doing anything with that featureset

2019-05-10

<clever> it will treat `bar` as a file, but its a directory
<clever> to make it fail rather then copy to the wrong place
<clever> iqubic: if you `cp foo bar` and `bar` already exists as a directory, it wont copy to `bar/foo`
<clever> iqubic: `man cp`

2019-05-09

<clever> power of 2!
<clever> just copy the original configuration.nix to /etc/nixos/ and run nixos-rebuild switch
<clever> running nixos-rebuild switch with the original configuration.nix is identical to just wiping and installing again
<clever> that will be basically identical to a reinstall
<clever> you could just copy that config to /etc/nixos and run nixos-rebuild switch
<clever> looks normal, 1 sound card present
<clever> zeta: try opening pavucontrol, and then mess with xmonad and pactl again
<clever> zeta: what does `pactl list` report?
<clever> zeta: how exactly is pactl not working?
<clever> you would need to either find or remake your configuration.nix, and thats also how you just fix it
<clever> zeta: reinstalling wont fix anything
<clever> or avahi

2019-05-08

<clever> that lets you manually run the evaluator and see what it will discover
<clever> you dont need to configure hydra, just nix-build '<nixpkgs>' -A hydra
<clever> hydra-eval-jobs release.nix -I .
<clever> manveru: you may also want to experiment with hydra-eval-jobs
<clever> manveru: you could also use mapAttrs to go over a set of derivations, and extract the .passthru things yourself
<clever> manveru: i believe it will ignore them
<clever> nix-repl> :b pkgsCross.armv7l-hf-multiplatform.xapian
<clever> catern: i guess since the cross-compiled libs are always x86->arm cross-compile (changing that changes the $out hash), you could just put native x86 binaries into its bin/ folder
<clever> catern: and then you have the mess of getting the x86 version of the binary to know where to even find the arm libs
<clever> camsbury: nix-serve doesnt support upload, so all uploads would bypass it and use the ssh:// protocol
<clever> QT for example, has both a qmake binary (acts like cmake), and the libs, and you need to mix arches, and teach qmake where to find the target libs
<clever> i'm still not sure how cross-compiling is meant to work for things like that

2019-05-07

<clever> tank/nix 98G 92G 6.3G 94% /nix
<clever> Filesystem Size Used Avail Use% Mounted on
<clever> [root@system76:~]# df -h /nix/
<clever> OmnipotentEntity: yep
<clever> OmnipotentEntity: out is a bash level variable, not a nix level variable
<clever> looks like they used 1000 when calling it "500gig"
<clever> Disk /dev/nvme0n1: 465.8 GiB, 500107862016 bytes, 976773168 sectors
<clever> ottidmes: my main dev laptop has a `465.8G` nvme (as seen by lsblk) and it runs nixos, and has some vbox VM's for ubuntu and windows 7
<clever> `foo = compiler: pkgs.${compiler}` is also lazy, but when you `foo "doesnotexist"` your eval'ing it, and see the failure
<clever> i think the problem is that `foo = pkgs.does.not.exist` is lazy, and will fail when you try to eval foo later
<clever> `foo "ghc844"` also works for me
<clever> fresheyeball: can you double-check that?
<clever> fresheyeball: yet the 1st form doesnt work for me
<clever> error: attribute 'ghc843' missing, at (string):1:1
<clever> nix-repl> pkgs.haskell.packages.ghc843.extend
<clever> i would expect that to work

2019-05-06

<clever> gchristensen: you could bake the init= into the initrd itself, with a bit of unsafe discard context
<clever> gchristensen: the current netboot image also generates an ipxe script that handles it for us, but .... hmmm
<clever> ,libraries eraserhd
<clever> Ralith: there is also the xorg half of things, i'm not sure how to update it
<clever> that driver came from within the linux source, so you would have to apply an override to linux itself to update it
<clever> Ralith: now run realpath on that
<clever> Ralith: what does modinfo say about it, where is the file located?
<clever> Ralith: thats the only way to use a gpu
<clever> Ralith: which kernel driver are you using?
<clever> Ralith: not sure, try without and see what breaks?
<clever> Ralith: hardware.openGL.package doesnt change the kernel side any
<clever> yes

2019-05-05

<clever> lopsided98: i belive the stdenv runs substituteAll over it
<clever> lopsided98: the thing with setupHook = ./foo; will get @out@ replaced by $out's value, when its copied into $out/nix-support/
<clever> ah, there it is
<clever> > cmake.setupHook
<clever> check the cmake source
<clever> > cmake.meta.position
<clever> and it will be copied to the right spot for you
<clever> i think mkDerivation also accepts a setupHook = ./hook.sh;
<clever> i think its a buildEnv of drivers and something else
<clever> Ralith: if you only put your override into hardware.opengl.package, you can avoid the mass-rebuild it would otherwise cause
<clever> Ralith: ive set that option before to use a variant of libGL with debug symbols
<clever> its an internal thing, so the docs omit it
<clever> ambro718: yeah, it will try to copy the libs into the initrd, and if it cant copy just the libs, it will just copy the entire closure
<clever> mog: du -h --max=1 /nix/store/ | sort -h
<clever> eeeh, without the e on pie, lol
<clever> maurer: many years ago, i made a program that used shm to share some cache structures between many procs, and the pie structures where fun to work with
<clever> but few apps actually use it properly
<clever> then restore it later
<clever> i also like how you can serialize the state of an app and terminate it
<clever> MichaelRaskin: i liked that you need a special gid to use network, but modern android doesnt even bother asking for net perms when installing
<clever> setuid binaries become an issue though
<clever> and chroot can be done without root, by just pulling off a mitm attack on the fs channel
<clever> then it returns handles to you
<clever> and you ask it to open files over an rpc
<clever> what if the filesystem was just an open handle you get passed as fd#4 ?
<clever> something ive thought of, is that you can pass open file handles over a unix socket
<clever> pie_: nix-store --optimize, will also hardlink all dups between things
<clever> it would be best if you can build from a read-only $src, but a lot of things dont play nicely with that