2019-07-07

<clever> omnipotententity: both will have to be patchelf'd to fix it
<clever> zacts: /usr/bin/env exists when using nix-shell, so thats not a valid test
<clever> qyliss: ah!
<clever> avn: or just modify fetchurl to map "" to that
<clever> ,tofy
<clever> looks like its fine
<clever> sure
<clever> and clang will be provided automatically
<clever> zacts: just change stdenv to clangStdenv
<clever> so you can then use them in something, like buildInputs
<clever> the function arguments are needed to get the variables into scope
<clever> nope
<clever> the function arguments
<clever> that will get you clang and llvm automatically
<clever> if you want clang, then you want the clangStdenv.mkDerivation
<clever> thats not the buildInputs
<clever> zacts: is ruby in the buildInputs?
<clever> zacts: which file has #!/usr/bin/env?
<clever> risson: mkOrder only works on nixos options
<clever> '';
<clever> ./build.sh
<clever> patchShebangs .
<clever> buildPPhase = ''
<clever> zacts: patchShebangs . first
<clever> zacts: buildPhase = "./build.sh";
<clever> ,unstable siraben
<clever> Thra11: likely just a bug, it gets copied from /nix/store/ on the first boot
<clever> so every time you reboot, you have to re-configure qtcreator to find the right qmake
<clever> and there was a qmake wrapper (to support the other things in buildInputs), in /tmp/randompath/, which qtcreator needed
<clever> so you had to wipe those temp files every time you reopen the shell
<clever> laalf: it was also creating things in the current dir, and failing if they already existed
<clever> laalf: which makes nix-shell difficult to use without root
<clever> laalf: it was something like the configure hooks creating $out/share or something and adding it to a search path
<clever> laalf: last time i looked, you had to run one of the configure hools before starting qtcreator, and it was a pain to deal with
<clever> ldlework: .overrideDerivation
<clever> ah
<clever> m1cr0man: just find whatever file defines main(), build that by itself, and then chase the link errors to find out what else you need
<clever> m1cr0man: ive sometimes given up on using the upstream build framework, and just rewrote it in cmake, lol
<clever> but a lot just assume /nix/store/
<clever> in theory, proper nix derivations should use this to get the store path
<clever> > builtins.storeDir
<clever> __monty__: youll get zero support from the binary cache, so it will take a lot longer to doooo antyhing, and a lot of things will break
<clever> __monty__: its always in the form of <hash>-${name}, and name typically has -1.2.3 at the end
<clever> __monty__: it is a variable set by nix, based on the name attribute on your derivation
<clever> i would expect the usb drivers to not work under wine
<clever> yunratobe: and if you do change the source with an override, nix will automatically know it needs to be rebuilt
<clever> yunratobe: most of the time, its not nessesary, since the builds are so pure
<clever> yunratobe: why do you want to force it to use src?
<clever> switchy: yep
<clever> so -I /foo will make it look for <nixpkgs> at /foo/nixpkgs
<clever> switchy: its mostly like gcc -I
<clever> switchy: nix-shell -I nixpkgs=~/nixpkgs
<clever> arcnmx: run import on the drv
<clever> jonreeve[m]: you probably want to store the result of fetchzip in a variable in a let block `let foo = fetchzip {...}; in ..`, then create a systemd service to load the data, `script = ''do-something-with ${foo}'';`
<clever> jonreeve[m]: what are you trying to do with the files after you unpack them?
<clever> jonreeve[m]: and the poorly named fetchzip will both download and untar for you, you could replace that entire thing with just a fetchzip call
<clever> jonreeve[m]: the default unpackPhase will untar it for you, so just src src= on something and you can then use it
<clever> jonreeve[m]: 99% of the time, you dont want to change builder.sh, the default one works fine
<clever> jonreeve[m]: or change it around, with import <nixpkgs> {}; stdenv.mkDerivation { ....
<clever> jonreeve[m]: a seperate nix file, and no ; at the end
<clever> jonreeve[m]: everything inside the quotes for -E can also just be put into a nix file
<clever> ,callPackage jonreeve[m]
<clever> but nix also leaves those 2 paths in /nix/store/ (as invalid paths) so you can just grep -r both yourself
<clever> so it doesnt know which file is to blame
<clever> Ralith: nix is serializing the entire dir into a std::string containing a nar, and then basically doing a grep against that whole string
<clever> Ralith: yes, because nix doesnt know
<clever> Ralith: and a path cant exist until its deps exist, so its imposible for nix to download such a loop
<clever> Ralith: .out depends on .dev, and .dev depends on .out

2019-07-06

<clever> melling: usually, master, and maybe ask to have it backported to 1903 after its merged
<clever> not sure what nix run will do when you give it a file containing things
<clever> so $out/bin doesnt exist, $out is a file!
<clever> oh, and line 59, the installPhase for that derivation, just prints 2 strings to $out
<clever> "installPhase": "echo $nativeBuildInputs $buildInputs > $out",
<clever> ___laika: nix run will simply grab out (line 62) and put only that into $PATH
<clever> ___laika: nix-shell will basically put buildInputs and nativeBuildInputs into $PATH, and everything else from the env section becomes an env var
<clever> nix-shell is the only way to get such a development shell right now
<clever> wont work*
<clever> ___laika: definitely looks like thats meant for use with nix-shell, and work work via nix run
<clever> ___laika: what is in this directory?
<clever> "nativeBuildInputs": "/nix/store/xl6kxg1lpclahch0bj8lrb5f4xaxdpi1-ghc-shell-for-http-hs-ghc-8.6.5",
<clever> ___laika: if you `nix-instantiate shell.nix` and then `nix show-derivation thatdrv` what does it output?
<clever> ___laika: `nix run` will build the thing, and put it into PATH
<clever> ___laika: `nix-shell shell.nix` will give a shell suitable for building something, based on the inputs in shell.nix
<clever> turbo_MaCk: yep
<clever> turbo_MaCk: but i dont know much about the network layer, mostly just the local object storage
<clever> turbo_MaCk: you might be able to abuse the ability to do a partial pull, to pull only that subtree
<clever> horribly ugly!!
<clever> arcnmx: pkgs.fetchSvn!
<clever> turbo_MaCk: it would have to be a custom git client
<clever> Ralith: probably
<clever> aveltras: nope
<clever> arcnmx: the ec2 backend in nixops will auto-configure route53 to point to each machine
<clever> oddly, it works with just -p and nothing afterwards
<clever> Miyu-chan: `nix-shell -p gcc`, gcc is always available, `nix-shell -p` is enough to get it
<clever> ejpcmac: nix-store --verify --check-contents
<clever> WilliamHamilton: overrideCabal (self.haskellPackages.callHackageDirect { pkg= ver= sha256=; } {}) (old: { doCheck = false; configureFlags = old.configureFlags ++ ["..."]; })
<clever> WilliamHamilton: yeah, you should be able to run overrideCabal on the result of callHackageDirect
<clever> WilliamHamilton: the rest all looks good at a glance
<clever> WilliamHamilton: same for 45
<clever> WilliamHamilton: dont quote the path on line 31, that breaks things
<clever> alienpirate5: and now you can decide if you want to go without wine for a bit or not
<clever> alienpirate5: the error at the end already tells you that, can you pastebin the output of nixos-rebuild?
<clever> alienpirate5: what depends on qtbase?
<clever> callHackageDirect would parse the cabal file, and then get all of the deps it wants from haskellPackages
<clever> WilliamHamilton: overrideCabal on the sha256+version or src would upgrade the package, but not provide it with a new dep it needs
<clever> WilliamHamilton: depends on if the deps are changing or not
<clever> yep
<clever> and overrideCabal just changes things before they get passed to generic-builder.nix
<clever> i think, its that your haskell default.nix, is doing haskellPackages.mkDerivation, which comes from generic-builder.nix
<clever> not sure what the path between the 2 is
<clever> WilliamHamilton: everything that generic-builder.nix accepts
<clever> ___laika: there is #nix-tools on irc
<clever> dang, he left
<clever> collision between `/nix/store/qgalsdxj9d55s403vhlw0lkz8bcvy1qw-git-2.22.0/share/info/git.info' and `/nix/store/8p3nm8rjr0rhaa2mqfz0zmzayxk9cn39-git-2.22.0/share/info/git.info'
<clever> iqubic: lspci
<clever> ggpeti: youll want to set it in nix.conf
<clever> ggpeti: there is an allowed-uris in `nix show-config` that acts as a whitelist of impurities

2019-07-05

<clever> BoipiSigre: or just eval it within a `nix repl`
<clever> > <nixpkgs/nixos/modules/installer/virtualbox-demo.nix>
<clever> BoipiSigre: nix-instantiate --find-file nixpkgs/nixos/modules/installer/virtualbox-demo.nix
<clever> Taneb: is nix-daemon running as root?
<clever> Taneb: deleting /root/.cache/nix/binary-cache-v* is the simplest way to make it forget about everything and re-check the caches
<clever> Taneb: default is 30 days
<clever> Taneb: narinfo-cache-positive-ttl is how long it will cache things that it believes are in the cache
<clever> Taneb: nix show-config | grep ttl
<clever> viric: its probably a side-effect of how that uri is meant to be a destination, and auto-creates so you can copy to it
<clever> yorick: in this case, it occured immediately after running nix-shell, and that page implies its a 10min timeout
<clever> ah
<clever> FRidh: i think it passed on nix 2.2.2
<clever> FRidh: building...
<clever> gchristensen: any details on what can cause a 502 on fastly?
<clever> gchristensen: warning: unable to download 'https://cache.nixos.org/846xp224nimhgpgx6izj2llk9hjhkh8b.narinfo': HTTP error 502; retrying in 258 ms
<clever> lol
<clever> teto: i think so
<clever> the service is even doing the same pattern on line 43, to print its own debug
<clever> echo "connecting to host..." >&2
<clever> so $client->execute("cat packet_interfaces.txt >&2"); i think will go to the serial console
<clever> but stderr is linked to the normal serial console
<clever> line 46 runs sh, with stdin/out linked to the backdoor port
<clever> thats how execute talks to the guest and makes it run things
<clever> also, this backdoor service is installed into the guest, and will run whatever you give it over the serial port
<clever> or assign it to 2 vars at once
<clever> i think because its a pair of exitcode + string, you need to refer to the 2nd element
<clever> or rather, a pair of exit code and string
<clever> teto: the execute function returns the output as a string
<clever> thats how most of the modular things work
<clever> boot.initrd.supportedFilesystems is for actual booting support
<clever> boot.supportedFilesystems is what you want then
<clever> ?
<clever> supportedFilesystems gets kernelModules for you
<clever> not sure on that
<clever> rauno: its only present if you set boot.supportedFilesystems = [ "zfs" ]; (or have a fileSystems.foo.fsType = "zfs")
<clever> i would say thats a bug in nixos, and you need to also manually add gnupg to systemPackages for now
<clever> line 78 is only for systemd
<clever> ah wait, i misread a line
<clever> cxx_newb: gpg should be in PATH then
<clever> cxx_newb: what did you set agent to?
<clever> cxx_newb: if enable is set to true, it will add gnupg to systemPackages for you
<clever> that should solve it
<clever> 122 environment.pathsToLink = [ "/share/fzf" ];
<clever> only parts of share are included, based on options
<clever> modules/misc/documentation.nix: environment.pathsToLink = [ "/share/man" ];
<clever> ah, i see the problem
<clever> cxx_newb: if you nix-env -iA nixos.fzf, it will instead be in ~/.nix-profile/share/
<clever> cxx_newb: and did you add fzf to environment.systemPackages?
<clever> cxx_newb: just do `ls -l /run/current-system/sw/share/` and look
<clever> cxx_newb: /run/current-system is full of symlinks, and find wont follow them by default
<clever> cxx_newb: did you check /run/current-system/sw/share/ ?
<clever> and then its predictable where to find it
<clever> if you put fzf in your systemPackages, it will wind up in /run/current-system/sw/
<clever> technically, it runs for all users, but does nothing for most
<clever> cxx_newb: one really simple option is to just wrap it with `if [[ $USER == foo ]]; then ...
<clever> pie_: does the same drv fail? nix should cache the result...
<clever> Miyu-chan: lets also switch to #nixos-chat
<clever> Miyu-chan: i think its mostly designed around a WriterT, which i think is already a free monad?
<clever> Miyu-chan: ah
<clever> copilot-language/src/Copilot/Language/Reify.hs:reify :: Spec' a -> IO Core.Spec
<clever> it take the name and Spec, and does things....
<clever> and then later stages translate that into the target language
<clever> i think its generating an opcode in the Stream monad
<clever> Miyu-chan: so its basically just a helper, that finds the right cast function for you
<clever> instance UnsafeCast Word8 Float where unsafeCast = castIntegral
<clever> heh, you beat me
<clever> i would agree
<clever> that is weird
<clever> Miyu-chan: ive been wanting to use haskell on an AVR or MIPS thing, and copilot looks like it may work
<clever> Shados: i recently found https://copilot-language.github.io/
<clever> curl can store cookies when you do things
<clever> yeah
<clever> Miyu-chan: bash
<clever> pie_: it was setup to login on the website (http post to login form), grab cookies, then use those to download the tar
<clever> pie_: check the old derivation for factorio
<clever> you then download it yourself, and nix-store --add-fixed the thing
<clever> pie_: requireFile is a function to make a fake fixed-output drv, that always fails with directions
<clever> gave html
<clever> and now that i refreshed, the html has 1669
<clever> the html i see, has 1669 in it
<clever> 1266 came from your nix file, and your ip
<clever> requireFile may be your simplest option
<clever> like a download counter
<clever> it may be an index into a database
<clever> to stop direct linking
<clever> pie_: i think the number is unique to your IP, and maybe time based
<clever> ran the nix file, and then ran curl
<clever> it will create a logfiles.PID for every pid it follows
<clever> pie_: switch over to `strace -p PID -ff -o logfiles`
<clever> pie_: it fails when i use this
<clever> curl --location --max-redirs 20 --retry 3 --disable-epsv --cookie-jar cookies --insecure --user-agent 'curl/7.64.1 Nixpkgs/19.09' -C - --fail 'http://www.unrealsoftware.de/get.php?get=cs2d_1008_win.zip&p=1&cid=1266'; --output foo.zip
<clever> pie_: what does `pgrep nix-daemon` output?
<clever> i see this when i try the same thing
<clever> [pid 23133] execve("/nix/store/21081kk3iswq4lal8mn1w3vnr62gdi6l-curl-7.64.1-bin/bin/curl", ["curl", "--location", "--max-redirs", "20", "--retry", "3", "--disable-epsv", "--cookie-jar", "cookies", "--insecure", "--user-agent", "curl/7.64.1 Nixpkgs/19.09", "-C", "-", "--fail", "http://www.unrealsoftware.de/get"..., "--output", "/nix/store/9sniw6qd54y9qifp5a7d1"...], 0x5d3008 /* 106 vars */) = 0
<clever> pie_: can you pastebin the full output when the build fails?
<clever> use --option builders '' on the proc initiating the build
<clever> its going out to a build slave
<clever> should be fairly few false hits
<clever> what went wrong?
<clever> pie_: strace prints to stderr, you want strace ... 2>&1 | grep ...
<clever> pie_: find the pid of the nix-daemon, and just `strace -p PID -f -e execve`
<clever> gyroninja___: without quotes, it can mostly be 1-9a-zA-Z and -_
<clever> gyroninja___: . and / mostly
<clever> pie_: can you pastebin the nix expr?
<clever> pie_: is there a captive portal forcing you to login on something?
<clever> 41 #{ device = "/dev/disk/by-uuid/3fdb005c-97e7-4dfb-9a3f-71748d714ae4"; priority = 9; }
<clever> pie_: does the output path exist in /nix/store ?, nix should leave it after a failed build
<clever> pie_: broken how? pkgs or builtins?
<clever> a partition that is in use cant be deleted fully
<clever> youll need to swapoff, then re-delete and re-make the partition
<clever> iqubic: did you swapoff first?
<clever> iqubic: and then fix the reference to it in (hardware-)configuration.nix, under swapDevices
<clever> iqubic: and mkswap /dev/sdaX to re-format it
<clever> iqubic: just delete and remake it, in either fdisk or parted
<clever> and then `df -h` should show more free space
<clever> close enough, youll want to now `zpool online -e <poolname> /dev/sda2` again
<clever> iqubic: sda2 is 142 gig, it appears to have worked, does lsblk agree with it?
<clever> iqubic: and if you quit, then `fdisk -l /dev/sda` what does it say?
<clever> is there a save or write command?
<clever> iqubic: did you try `help` in side parted yet?
<clever> iqubic: `resizepart` in the `parted` command
<clever> normally, i would just use gparted
<clever> then sda6 should be safe to delete
<clever> what does zpool status -v say?
<clever> sda6 is the zfs one
<clever> /dev/sda6 294348800 500117503 205768704 98.1G Linux filesystem
<clever> /dev/sda5 253388800 277569535 24180736 11.5G Microsoft basic data
<clever> iqubic: sda5 was your shared partition between windows and linux
<clever> i think that will force it to only do 1 connection
<clever> gyroninja___: oh, what about `nix-store --option http-connections 1 -r /nix/store/p175klawkn4brx5wm03n93vg7l8l3myr-mono-5.20.1.27`
<clever> gyroninja___: that will let you fetch from 2 places at once
<clever> gyroninja___: another option is: nix-store -r /nix/store/p175klawkn4brx5wm03n93vg7l8l3myr-mono-5.20.1.27 --option substituters 'file:///path/to/dir https://cache.nixos.org'
<clever> gyroninja___: you can run `nix-store -r /nix/store/foo` to download any path from the cache
<clever> need the name-version also
<clever> yeah
<clever> gyroninja___: what storepath is it trying to download?
<clever> and hash.narinfo contains the relative path of the .nar.xz
<clever> gyroninja___: /nix/store/hash-name is at hash.narinfo
<clever> gyroninja___: if you put both the .narinfo and the .nar.xz into a folder, you can `nix copy --from file:///path/to/dir /nix/store/hash-name` to "download" it from that dir
<clever> iqubic: if its not shown in `zpool status -v`, yes
<clever> iqubic: you must resize the sda2 partition to occupy the entire disk, and then do online -e again
<clever> iqubic: thats what the online command did

2019-07-04

<clever> gyroninja___: how long did the download take?
<clever> gyroninja___: does it fail similarly if you just download the .nar.xz with `wget` ?
<clever> gyroninja___: can you screenshot the last set of packets?
<clever> iqubic: its to do with fixing a physical mirror, replacing the silver on the back of it
<clever> gyroninja___: fastly sending an rst means that the fastly server is trying to close the connection
<clever> yes
<clever> /dev/sda6 294348800 500117503 205768704 98.1G Linux filesystem
<clever> the size of your partitions
<clever> it will need to copy about 90gig of data
<clever> 2019-07-04 19:10:36 < clever> watch `zpool status` to see when its done
<clever> zpool attach latitude-tank wwn-0x5001b444a630bdbc-part6 /dev/sda2
<clever> it must be the name of the pool your wanting to modify
<clever> need the pool name too
<clever> zpool attach latitude-tank wwn-0x5001b444a630bdbc-part6 /dev/sda2
<clever> oops
<clever> iqubic: zfs uses the names from `ls -l /dev/disk/by-id/` when it boots
<clever> iqubic: thats the serial# for your drive
<clever> iqubic: so you want `zpool attach wwn-0x5001b444a630bdbc-part6 /dev/sda2`
<clever> iqubic: wwn-0x5001b444a630bdbc-part6 is the name of the device
<clever> iqubic: the order is right, but zfs is calling sda5 something else
<clever> iqubic: but zfs may have named it differently, check `zpool status -v`
<clever> iqubic: the man page says its that way around
<clever> zpool attach [-f] [-o property=value] pool device new_device
<clever> gyroninja___: you generally want to just look at the packets, you should see push packets from fastly, and ack packets going back for each one
<clever> gyroninja___: you generally want to right click the packets for this stream, and hit follow tcp stream to filter it
<clever> gyroninja___: which end last sent a packet, and where any retries present?
<clever> gyroninja___: check with wireshark to see if its actualy sending data the whole time
<clever> gyroninja___: the error 9 is because the stream to unxz ended in the middle of the file