2017-12-15

<clever> and it already runs bash by default with no args
<clever> mitchty: can you just recreate the problem, then screenshot the entire terminal?
<clever> mitchty: that config.nix is fine, its not to blame
<clever> mitchty: are you sure thats the directory you ran nix-shell in when it failed?, try running it there without emacs
<clever> mitchty: and the error doesnt exist in that run
<clever> one just has a higher priority over the other
<clever> both paths have the exact same effect
<clever> mitchty: what is the content of this file?
<clever> evaluating file ‘/Users/mitch/.nixpkgs/config.nix’
<clever> mitchty: the output from instantiate
<clever> plakband: you can also use nix and haskell together on OSX if you want to
<clever> ok, try `nix-instantiate -v default.nix` into a log file, and gist the entire thing, as a file, not a comment
<clever> mitchty: what is the content of your config.nix file?
<clever> you somehow refers to the 2048 game, which is linux only
<clever> Package ‘2048-in-terminal-2015-01-15’ in /Users/mitch/src/github.com/NixOS/nixpkgs/pkgs/games/2048-in-terminal/default.nix:25 is not supported on ‘x86_64-darwin’, refusing to evaluate.
<clever> run "gist -p default.nix" and then it will upload the entire file for you
<clever> your file doesnt have that
<clever> line 1 of that file brings everything into scope
<clever> as well as everything in the buildInputs
<clever> that should fail because both stdenv and buildEnv are not in scope
<clever> and the gist includes the exact contents of default.nix?
<clever> that should fail with a very different error
<clever> does a shell.nix file also exist in that directory?
<clever> what directory did you run that in?
<clever> what args did it give to nix-build?
<clever> mitchty: what command did you run to build that file?
<clever> math*
<clever> __Sander__: yep, the path result matches Double in javascript
<clever> __Sander__: nodejs doesnt handle large numbers sanely
<clever> 0
<clever> > 18446744073709551616 - 18446744073709552000
<clever> 18446744073709552000
<clever> > 4294967296 * 4294967296
<clever> Double gives the same result as nodejs
<clever> cransom, sphalerite: both `Word` and `Int` types fail to 0 silently, i was informed that they would throw exceptions...
<clever> testing...
<clever> i just had an idea, one minute
<clever> ah, yeah, your going to run out of storage first
<clever> sphalerite: is the nix limit 32bit or 64bit?
<clever> then look under the sw/bin/ of each
<clever> radvendii: ls -ld /nix/var/nix/profiles/system*
<clever> they already have dmg, which is just a disk image
<clever> and if you try to run the directory, it runs a certain special executable inside it
<clever> so natively, its just a directory, but every single GUI claims its a file, and moves the whole thing as 1 unit
<clever> apple did similar things, by treating a .app directory as if it was a file
<clever> so you could mmap executable code directly into the application
<clever> its also possible to flag certain files as not compressed
<clever> (but is limited to http like things)
<clever> bgamari: there is also nix-prefetch-url '<nixpkgs>' -A hello.src, which just evaluates the .src.url and then runs normal prefetch-url on it
<clever> bgamari: that will run the fixed-output derivation for fetching the source, then hash its result, and rename the result in /nix/store/ to match the actual hash, so the data isnt lost
<clever> bgamari: nix-build -A hello.src --hash
<clever> prefetch-url only works against urls
<clever> bgamari: something better/more powerful
<clever> bgamari: yeah, there is a special mode, let me find it

2017-12-14

<clever> ive wanted to switch it to the c one, which still has the same api
<clever> it was perl, but nixUnstable de-perl'd nix
<clever> nix-env and nix-channel need a buildEnv to manage the nixpkgs download
<clever> its always been in nix
<clever> Lisanna: there are 2 copies of buildEnv and they have begun to diverge some
<clever> Lisanna: buildEnv has also been rewitten in c, in nix
<clever> symphorien: i believe the limit is 256 characters, including the "privmsg #nixos :" prefix and the "\n" suffix
<clever> srhb: missing a '

2017-12-13

<clever> i'm using nix as a templating language for haskell
<clever> gchristensen: line 175 is not template haskell
<clever> let me find it...
<clever> gchristensen: that reminds me, i recently mixed nix and haskell in a new way
<clever> it probably will
<clever> but test was made by you and nix doesnt manage it
<clever> channels is owned by your user, but via nix-env, so you cant just edit it however you want
<clever> channels_root is a profile managed by root, so you cant just write to it
<clever> evangeline: the first level 'test' is like a namespace, and different users have different permissions to it
<clever> evangeline: any time nix-env tries to load the foo channel, it will import that nixpkgs
<clever> import /home/clever/apps/nixpkgs
<clever> [clever@amd-nixos:~]$ cat ~/.nix-defexpr/test/foo/default.nix
<clever> evangeline: i have a much simpler way to make a fake local channel
<clever> and everything between lines 13 and 38 will be installed/upgraded
<clever> dshin: with this, i can nix-env -iA nixos.newstuff
<clever> one trick ive been using recently, is to create a custom set within config.nix, and then nix-env -i that whole set
<clever> config.nix on the other hand, is just some overrides that apply to nixpkgs by default, to mutate the packages before nix-env even starts the build
<clever> dshin: every time you nix-env -i or nix-env -e, it will load the manifest.nix into ram, apply the requested mutations, then generate a profile based on the new manifest.nix
<clever> iqubic: and what will the script do?
<clever> iqubic: boot, graphic login, any shell opening, any login shell?

2017-12-12

<clever> yeah
<clever> mekeor: so only channels added by root are visible via the search path
<clever> mekeor: thats just the default value
<clever> mekeor: what is $NIX_PATH ?
<clever> yeah
<clever> chreekat: randomEncryption.enable would also be an option, that formats the swap partition every time, without trying to set the size
<clever> then 201 formats
<clever> line 197 tries to shrink the file, but stat wrongly claimed the original size was 0, so it never shrinks
<clever> as long as the size you specified is less then (or equal) to the block device, it will succeed
<clever> which just writes to the "tail" end of the swap device
<clever> so it thinks fallocate isnt supported, and tries to use dd
<clever> ah, stat thinks the swap device is 0 bytes, so it tries to extend the file with fallocate, which fails
<clever> then it will format it with mkswap
<clever> chreekat: if the swap (device|file) doesnt exist, it will create it, and try to use dd/fallocate/truncate to set the size
<clever> chreekat: the .size option is meant to be used on swap files
<clever> i dont think nixops can format it as swap for you, nixos would need to do that at bootup
<clever> chreekat: https://nixos.org/nixos/options.html#swapdevices.*.size this one might work
<clever> chreekat: nixos will not try to format swap devices by default, there is another option for that
<clever> bgamari: ah, a bug may need to be filed in nixpkgs or nixops
<clever> chreekat: there is a swapDevices option in nixos
<clever> it may be delayed within the aws api's
<clever> i'm not sure then
<clever> is it nixos?, what does /proc/cmdline say about the console?
<clever> so the boot messages never go to the "GPU"
<clever> a quick check shows that nixos on aws boots with `console=ttyS0`
<clever> then the kernel never started writing to the xen console
<clever> its text based, and has a lot more info
<clever> get the system log instead
<clever> yeah, the screenshot is useless
<clever> the image based screenshot just stops at "booting the kernel." for a working machine, get system log shows an actual boot log
<clever> what does the console say?
<clever> bgamari: thats normal on aws, it doesnt print to the console you can screenshot
<clever> which would just push the problem off into the future
<clever> upgrading them will keep the qt-5.9 in place, but may point it to a newer version
<clever> evangeline: try removing all of those (and optionally adding to systemPackages) then check qt-5.9 again
<clever> evangeline: smplayer
<clever> evangeline: calibre
<clever> evangeline: wpsoffice
<clever> evangeline: yubikey-personalization-gui
<clever> evangeline: qgit is one of the things to blame
<clever> oh, and why is that 3mb, lol
<clever> evangeline: i prefer gist for file storage, much simpler to download
<clever> ignore any qt things depending on other qt things
<clever> evangeline: search for a QT thing with /qt, then follow the line up/left
<clever> evangeline: nix-store -q --tree ~/.nix-profile/
<clever> you either need to remove the channel you dont want, or switch to a config.nix like i pasted above
<clever> it will also look in the channels root has
<clever> and nix will atomicly upgrade everything in that set
<clever> evangeline: using config.nix, you can create a set of packages, and then just nix-env -iA nixos.newstuff
<clever> dont think thats possible, but there is a better trick
<clever> without the -A, its not clear which channel it uses, and its much much much slower
<clever> evangeline: when you do `nix-env -iA nixos.wireshark` your telling it to use the channel called nixos
<clever> everything must be from the same nixpkgs, and nixos solves that in systemPackages
<clever> they may temporarily work in nix-env, but can break anything at the next update
<clever> due to this bug, i would advise that QT apps are only ever installed via systemPackages
<clever> and as i discovered yesterday, it can even break the entire desktop env, leaving you unable to login
<clever> if you mix different QT's within nix-env and/or systemPackages, all qt apps break
<clever> evangeline: thats also very likely to cause it
<clever> evangeline: try uninstalling wireshark, then check if qt-5.9 is still present
<clever> evangeline: i suspect the qt 5.9 is the problem, are there any QT using programs in nix-env ?
<clever> evangeline: what about: ls -ld .nix-profile/lib/qt*
<clever> evangeline: and there is no virtualbox in nix-env?
<clever> evangeline: how did you install virtualbox?
<clever> hodapp: you want to set the sourceroot like this: https://github.com/input-output-hk/cardano-sl/blob/master/pkgs/default.nix#L2777
<clever> hodapp: one sec
<clever> k0001: fetchzip just calls the normal unpackFile command that stdenv uses, it was originally meant for non-deterministic zip's, to hash the contents, rather then the zip itself
<clever> k0001: fetchzip will automatically unpack, and i think it supports both tar and zip
<clever> k0001: and what does fetchzip do?
<clever> k0001: any reason you cant use a fetch function frin nixpkgs?
<clever> k0001: is this for fetching nixpkgs itself?
<clever> Fare: i think sphalerite was doing that
<clever> you also gain the ability to spread jobs over every x86 machine in the house
<clever> so you dont even need a chroot
<clever> and thanks to nix, you can have arm and x86 glibc's instaled at the same time
<clever> so you just run an arm ELF file, and it works
<clever> it emulates things on a per-process basis
<clever> yeah
<clever> its not a full vm
<clever> and the nix on line 12 has been modified, so you can convince it to run arm binaries on a non-arm machine
<clever> this derivation lets an x86 machine run arm binaries :P
<clever> or at least, something that can run un-modified arm binaries
<clever> it will need an arm build slave to do the building for it
<clever> half of nixos broke, because of gentoo binaries and config
<clever> then i just forcibly ran the script to update the nixos bootloader!
<clever> the first one was gentoo, i installed nix with the curl script, then i used nix-build to build a copy of nixos within /nix/store/
<clever> also, neither of those machines started out in any "sane" state
<clever> yep, exactly
<clever> this manages a pair of netbooks
<clever> push based deployments, rather then pull based
<clever> Acou_Bass: for weak devices, i tend to use nixops to manage them

2017-12-11

<clever> but i havent risked my system stablity to test variations
<clever> i think it would be more user-friendly if nix just unconditionaly quoted everything
<clever> as in, systemd murdered every process and dropped me into an emergency shell :P
<clever> but when nix passes it to systemd, it borks hard
<clever> at the nix level
<clever> LnL: fileSystems."/home/clever/VirtualBox\\040VMs" = { fsType = "zfs"; device = "amd/vbox"; };
<clever> LnL: it was quoted!
<clever> but it has since booted up fine
<clever> and even when escaping it properly acording to the manpage, a rebuild switch still broke it hard
<clever> that reminds me, a naked space, and '\ ' both crashed systemd pretty hard
<clever> amd/vbox /home/clever/VirtualBox\040VMs zfs defaults 0 0
<clever> srhb: what exactly is the FS setup?
<clever> LnL: also, silly java is throwing a FileNotFoundException, with a message of no space left on device, lol
<clever> maybe next time, i'll leave /nix/var on the / dataset, and use /nix/store/ for the non-snapshot one
<clever> /nix is the only thing not covered, because the snapshots make GC useless, and it can always be rebuilt
<clever> and also for error recovery after an improper shutdown, it never does in-place edits on things like a directory listing
<clever> except /nix itself
<clever> LnL: i have snapshots on everyting
<clever> LnL: the only way out is to manualy destroy a snapshot, then GC can work
<clever> LnL: because it has to create a new version of the directory without that file
<clever> LnL: zfs is immutable, you need free space even to delete a file
<clever> so hard that i cant even garbage collect
<clever> hydra started to build ghc, and i ran out of hdd space entirely
<clever> oh, thats why my browser has been acting wonky
<clever> :D
<clever> jeaye: so you could refer to that perl script in the shellHook for the nix-shell env
<clever> jeaye: the runner script has zero involvement in systemd
<clever> jeaye: that will generate a perl script, that will handle pre/post start, start, and pre/post stop
<clever> jeaye: create a configuration.nix that fully describes the service you want to enable, then build this, nix-build -I nixos-config=./configuration.nix '<nixpkgs/nixos>' -A config.systemd.services.postgresql.runner
<clever> jeaye: there is also the service runner script, one minute
<clever> there are comments in the fetchgit source explaining it
<clever> Lisanna: its a security thing, to protect deleted branches i think
<clever> Lisanna: the root problem, is that the git protocol doesnt allow you to fetch a given sha1, you must fetch a branch
<clever> bbl
<clever> so thats also an option
<clever> cement: if he simply creates /nix and chown's it to your user, nix will install without ever needing root
<clever> Judson: and without systemd/udev, you have to configure everything yourself
<clever> Judson: it boots with sshd, but it doesnt really have much installed
<clever> Judson: its mostly as an example of how to boot something that was built with nix
<clever> sphalerite: ah, that sounds like a good use for not-os
<clever> cement: nix-shell -p stdenv
<clever> ah, didnt see that
<clever> Judson: its about 40mb for the squashfs
<clever> Judson: i have a variant of nixos that lacks systemd
<clever> sphalerite: how do vim and neovim differ?
<clever> srhb: yeah, i recently looked for that, because i wanted ghcid in a corner, while editing 3 other files
<clever> and all share the buffer
<clever> and each of them word-wraps sanely
<clever> i can open the same file 3 times in vim, in differently shaped windows
<clever> one major improvement vim has, that nothing else can do
<clever> Judson: vim also supports tabs, a lot like screen/tmux, and each tab has its own set of split buffers
<clever> Judson: have a look at the above imgur, vim can do similar things
<clever> sphalerite: https://imgur.com/a/Y5iMp
<clever> sphalerite: let me screenshot an example
<clever> verticle splits, and being able to sometimes control what a remote viewer sees
<clever> there are only 2 things tmux has that i want in screen
<clever> srhb: oops, ^^^
<clever> sphalerite: and what about moving the bottom split into its own terminal?
<clever> sphalerite: ^a5 is simpler
<clever> without having to disconnect and connect to a new session
<clever> srhb: i want to dynamically change what i see in each terminal, depending on the situation
<clever> all viewers must always see the same thing
<clever> tmux cant mux!!
<clever> i have 5 terminals open with screen, each showing a different buffer
<clever> another major difference/anoyance
<clever> screen has ^aF to force it to fit the viewer using that hotkey
<clever> tmux forcibly fits the smallest viewer, and doesnt have any bypass
<clever> and if the buffer is bigger, it has to redraw the entire screen as it pans
<clever> but if the buffer is smaller, it has to track the column, and insert control characters to sek a lot
<clever> Judson: if the sizes match up, screen/tmux can just relay the bytes directly to the terminal, and its fast
<clever> Judson: also, there is a massive cpu hit if the buffer doesnt match the screen size
<clever> but it only auto-resizes if there is only 1 terminal focused
<clever> Judson: i connect to screen from many terminals and many computers
<clever> so you can de-focus all buffers, without actually disconnecting
<clever> screen also has a - buffer, that just shows nothing
<clever> i dont use a tiling window manager, so all tiling happens within screen
<clever> sometimes i want to see 2 things at once, sometimes i want the editor to take 100%, without closing the 2nd thing
<clever> and i'm constantly re-organizing what things go in which split
<clever> for tmux, the splits are inside the buffer
<clever> for screen, the splits are at a seperate level, and each buffer can switch to any tab
<clever> or swapping the windows within splits
<clever> and tmux seems to lack some basic features like forcibly resizing the window when others are viewing
<clever> i learned screen first, and now all the keybinds are muscle memory
<clever> i havent used direnv, and i prefer screen over tmux
<clever> ah
<clever> ?
<clever> you could always download the default.nix for the package and nix-env -f default.nix -i
<clever> rather then impure linux actions
<clever> ah, i was thinking more about a generic linux build slave
<clever> and the docker image itself can be build with nix
<clever> the darwin host will copy things into the container again at the next build
<clever> you could even launch it with `docker run --rm` so the store is lost at shutdown
<clever> yeah, i would make a persistant container with sshd and nix-daemon, that just acts as a dumb build slave
<clever> crucialrhyme: it might be able to just convert the docker images
<clever> 'The Singularity software can import your Docker images without having Docker installed or being a superuser.'
<clever> so you can pipe that directly into `docker load` and not even need nix
<clever> crucialrhyme: lines 153-158 are an extra bit to make it hydra friendly, you now have a simple download image link on https://hydra.iohk.io/build/56778
<clever> manveru: in theory, you could run a nix build slave, under docker...?
<clever> crucialrhyme: this generates a docker image containing the entire closure of cardano-state (defined on lines 111-139)
<clever> crucialrhyme: nixpkgs also has docker utils, one minute
<clever> crucialrhyme: then i can work on each stage seperately, and if i find a bug in an early stage, nix will automaticaly re-run all stages in the right order
<clever> crucialrhyme: i have also been using nix for a lot of data processing tasks, i split each stage of processing into its own nix derivation, one to parse the data into a db, one to sort, filter, and print latex, another to turn the latex into a pdf
<clever> its more an issue about using qt-app-1 from 5 months ago, with qt-app-2 from yesterday
<clever> so no conflict can exist
<clever> crucialrhyme: installing them globally in configuration.nix would also fix it, because then they always come from the same nixpkgs, and the same QT version
<clever> crucialrhyme: hmmm, not sure if it would find the libs at all then
<clever> crucialrhyme: the only solution ive found is to upgrade both apps, so they are on the same QT version
<clever> crucialrhyme: QT expects to find some of its libs in a place like ~/.nix-profile/lib/ and if you install apps from 2 different qt versions, they break eachother
<clever> crucialrhyme: it is with QT based apps
<clever> hyper_ch: more for seeing if a program is even worth using and keeping long-term
<clever> manveru: even after removing it from nix-env, the rollbacks keep the package around for ages
<clever> manveru: i tend to test things with nix-shell
<clever> then all the users on the wrong channel came out of the woodwork :P
<clever> the nixos channel didnt update, because the testing caught it and blocked the channel
<clever> hyper_ch: there was also a bug a year ago in the nixpkgs channel (not the nixos channel), that corrupted the grub.conf file
<clever> if /nix/var/nix/db/db.sqlite is deleted, you basically have to start over