2018-02-28

<clever> Acou_Bass: ive also got a number of odd files like this
<clever> /home/clever/.local/share/applications/chrome-apdfllckaahabafndbhieahigkjlhalf-Default.desktop
<clever> adding files just magically adds them to the menu
<clever> Acou_Bass: i dont know much about kde, but xfce seems to automatically detect changes to at least ~/.local/share/applications
<clever> Acou_Bass: ah
<clever> Acou_Bass: read the path inside the extra firefox.desktop and maybe delete it

2018-02-27

<clever> and its now 4am, i should get to bed
<clever> ah :S
<clever> but, its not managed by nix, so vim breaks it every time vim downloads the plugin
<clever> mfiano: so just deleting the 'python' element from the command fixes it
<clever> mfiano: and nixos already wrapped wakatime.py in a bash script that does everything for you
<clever> mfiano: python, and site-packages arent global, so it fails miserably
<clever> mfiano: for example, the wakatime plugin tries to be too smart, and tries to find wakatime.py, then run python on it
<clever> mfiano: ive run into problems when i let vim install its own plugins
<clever> mfiano: nix will then put a copy of the vim_configs directory into /nix/store/, and insert its path into the resulting string
<clever> mfiano: then, to pull in the .vim directory, you would do something like source ${./vim_configs}/something, or set plugin_search_path=${./vim_configs}/plugins, inside that string from 7-24 in my vim.nix
<clever> mfiano: using these 2, i believe you can generate a custom neovim, where the contents of init.vim are inside the string from lines 7-24
<clever> 2018-02-27 03:36:20 < sphalerite_> just that to use it with neovim you do neovim.override { configure = …; } rather than vim_configurable.customize { … }
<clever> mfiano: then you use that variable in all the source statements
<clever> mfiano: what if .vimrc set a vim variable, pointing to the directory with the rest of the config?
<clever> mfiano: oh, i have an idea
<clever> ive never had to lookup the #include syntax for vim
<clever> mfiano: it cant do things like ./foo to be relative to itself?, or $BASH_SOURCE[0] or $(pwd)ish?
<clever> mfiano: that can still work, just replace ~/.vimrc with init.vim in my directions
<clever> yeah
<clever> Izorkin: yeah, i think you should go ahead and create one
<clever> and root.config loads the rest
<clever> mfiano: to start with, make it something simple like all the config in ~/.vim/ and ~/.vimrc is just 1 line to load something like ~/.vim/root.config
<clever> mfiano: if its setup to just load relative to itself, then it can still work without nix
<clever> mfiano: i can help with that step once its all in a single directory that isnt hard-coded
<clever> mfiano: if you can make them all load relative to a single directory, then the rest should be easy
<clever> Lisanna: and if the slave stops self-reporting, auto-remove!
<clever> Lisanna: i have considered setting up netboot images, that self-report their arch to hydra, then hydra auto-adds those slaves as slaves
<clever> it also allows hydra to obey a file that nix doesnt even manage, so you could have a daemon dynamically adding/removing slaves, as you auto-scale the pool on AWS
<clever> that allows hydra to have extra slaves, that nix isnt aware of, localhost might work there
<clever> Lisanna: but for hydra, it can be a : seperated list
<clever> Lisanna: for nix itself, NIX_REMOTE_SYSTEMS must point to a single file with the slaves
<clever> Lisanna: but i suspect thats only nix, and not hydra, one min
<clever> Lisanna: it will sometimes grab a lock locally, then ssh into itself, and then wait for the lock
<clever> Lisanna: ive seen nix deadlock when localhost is a build slave
<clever> yeah
<clever> as long as hydra is building it
<clever> jgt: when used correctly, ghcWithPackages can give you pre-built copies of anything on hackage
<clever> gchristensen: lol
<clever> mckeankylej: yeah, id find a usb keyboard
<clever> mckeankylej: oh wait, nvm, mixing things up
<clever> mckeankylej: is secure-boot turned off?

2018-02-26

<clever> bbl
<clever> jtojnar: thats strange
<clever> Izorkin: strange
<clever> jtojnar: and `git diff` and `git diff --staged` both return no changes?
<clever> Izorkin: that makes little sense, weird
<clever> sphalerite_: what about with --option repeat 5?
<clever> sphalerite_: then nix just rebuilds every derivation several times
<clever> sphalerite_: which can also go into nix.conf
<clever> sanscoeur: there is a --option build-repeat i think
<clever> sanscoeur: and its baked into the binaries, so you have to recompile everything
<clever> sanscoeur: a large chunk of the scripts have /nix/store hard-coded into them
<clever> sanscoeu_: even with a single-user install, it has to be at /nix
<clever> Izorkin: rm logfiles.* to clean up the old logs, `strace -ff -o logfiles -s 3000 nix-daemon` to launch it with debug, then `nixos-rebuild build` to fail it again, and ctrl+c the strace&upload
<clever> Izorkin: then the problem is somewhere inside nix-daemon
<clever> mfiano: but if nothing demands you use it, you can just not set the option
<clever> mfiano: some services expect a per-host unique id, zfs is one of them
<clever> Izorkin: systemctl stop nix-daemon.socket ; systemctl stop nix-daemon.service, then try nixos-rebuild build
<clever> Izorkin: ls -l /proc/10203/exe
<clever> elvishjerricco: it configures hydra to use the s3:// driver for the nix store, nix-cache is the bucket name, and the rest is config for the s3 driver
<clever> Izorkin: ps aux | grep nix-daemon
<clever> elvishjerricco: i think so
<clever> elvishjerricco: 39 makes it download things from https://cache.nixos.org when it needs them
<clever> elvishjerricco: 38, not sure exactly
<clever> elvishjerricco: line 37 configures uploading everything to S3, rather then keeping it in /nix/store
<clever> Izorkin: ok, strange, all 3 hits are reading it from elsewhere, there is no "cause", digging more...
<clever> Izorkin: pid 10250 looks like the key
<clever> Izorkin: with this, i can see that 3 processes are involved in the error: grep -r --color 'unable to start build process'
<clever> mfiano: as an example, take router_deployment.nix, if i just copy&paste lines 7-14, give each a unique name (line 7) and unique ip (line 12), and run `nixops deploy`, it will upgrade all 10 machines to have the exact same config
<clever> mfiano: nixops helps with that kind of thing
<clever> Izorkin: reading the logs...
<clever> but you could also just symlink it into /etc/nixos/configuration.nix to get the same effect
<clever> mfiano: that router.nix is the configuration.nix
<clever> mfiano: i did recently publish my router config: https://github.com/cleverca22/nixos-configs/blob/master/router.nix#L14-L21
<clever> Izorkin: you can also just manually upload all of the logfiles.* files to gist iwth a normal browser
<clever> Izorkin: now run nix-env -iA nixos.gist && gist -p logfiles.*
<clever> Izorkin: oh right, the && doesnt work right in this case, oops
<clever> Izorkin: and beware that the logs will contain every string in your configuration.nix, which might have passwords?
<clever> Izorkin: can you run strace -ff -o logfiles -s 300 nixos-rebuild build && nix-env -iA nixos.gist && gist -p logfiles.* ?
<clever> mfiano: what sphalerite_ said
<clever> mfiano: you disabled the key part that makes it work
<clever> mfiano: complains about what?
<clever> mfiano: my example didnt have the ''
<clever> mfiano: why does that say ''${ ?
<clever> Izorkin: looks completely normal
<clever> mfiano: can you gist your configuration.nix?
<clever> mfiano: and confirm whatits doing and the file it refers to
<clever> mfiano: double-check the generated xsession file in nix-store -qR /run/current-system | grep xsession
<clever> mfiano: pkgs.xorg
<clever> without impacting other related projects in the same eval
<clever> catern: so if you set the right -I flag, you can override a nixpkgs 2 layers deep
<clever> catern: each project has its own fetch-nixpkgs.nix, with the rev&hash, but they also have unique things like <cardano_pkgs>
<clever> catern: oh, i think i have something like what you want
<clever> elvishjerricco: and to keep nix from deleting those rollbacks
<clever> mfiano: displayManager.sessionCommands = "${xorg.xrdb}/bin/xrdb -merge ${writeText "resources" "Xcursor.size: 20"}";
<clever> mfiano: i think the only option is to set displayManager.sessionCommands to call xrdb -merge against a file nix has made
<clever> infinisil: and this fix has been upstreamed now
<clever> infinisil: yeah, this is left-over from a fix i wrote a year ago
<clever> mfiano: then put chromeFix into systemPackages instead
<clever> mfiano: yeah, you can use packageOverrides = pkgs: { chromeFix = pkgs.callPackage ./chrome-fix.nix {}; };
<clever> mfiano: and now the var is only set when launching chrome, and nothing else has to care
<clever> mfiano: you would then install this bash script, instead of the real chromium, and just change the vars on line 10
<clever> mfiano: this generates a bash script, that will set LD_PRELOAD to "" to fix an old bug i had
<clever> mfiano: oh, one min
<clever> elvishjerricco: the bin/switch-to-configuration {switch/test/boot} half does the same as switch/test/boot with nixos-rebuild
<clever> elvishjerricco: the nix-env half of the command gives you the option for rollbacks and keeps things from being garbage collected
<clever> the main path that nixos-rebuild build outputs, not the file under it
<clever> elvishjerricco: that would go into $the_path from shlevy's example
<clever> elvishjerricco: thats the one you want
<clever> Izorkin: nix-collect-garbage --max-freed 1G
<clever> prooftechnique: i think Sonarpulse or bgamari- has done x86->arm cross compiles with ghc
<clever> mfiano: ah, you could use an if statement to conditionalize setting the nvidia options
<clever> mfiano: you have several GPU's in the machine?
<clever> ottidmes: but the driver has been good enough to detect things and reset itself, so ive never noticed the issue
<clever> ottidmes: i recently hooked a monitor up to my router and dsicovered the console filled with various ethernet relayed soft-locks
<clever> ottidmes: there is a memory leak somewhere in the http daemon, and polling it once a minute breaks it after an exact amount of time passes
<clever> ottidmes: i also wrote a script to poll that ui and graph the results for the 50% of the time it was working, then discovered the router locking up every 29.5 days, like clockwork
<clever> ottidmes: and once you go over 4gig, it wraps to 0, and resumes counting
<clever> ottidmes: so when the traffic goes over 2gig, the counter just stops counting
<clever> ottidmes: the http ui renders the linux bandwidth counters (which are unsigned 32bit ints), as signed 32bit ints
<clever> ottidmes: oh, and the bugs, lol
<clever> ottidmes: and it lacks an off switch for that
<clever> ottidmes: my router blocks wifi users from ever talking to wired users
<clever> mfiano: then you want screenSection, check line 740
<clever> ottidmes: i didnt even rsync, i used nix-copy-closure to copy the exact path nix-channel had previously setup
<clever> mfiano: https://nixos.org/nixos/options.html#services.xserver.extra if it goes into a Display section
<clever> ottidmes: so nixops just uses that
<clever> ottidmes: i already have a root key in my ssh agent
<clever> ottidmes: i was then free to make more changes, and deploy them over nixops
<clever> ottidmes: and a nixops deploy did almost no changes to the router
<clever> ottidmes: then because i was paranoid, i used nix-diff to diff the derivations until they where nearly identical
<clever> ottidmes: basically, i grabbed the exact nixpkgs the router used, and the same-ish configuration.nix, and added it to a deployment file
<clever> ottidmes: i did that with my router lastnight
<clever> tazjin: now, its part of nix core, and i think it can just work as a binary cache, with the right format
<clever> tazjin: originally, it had its own option, and was more of a hack added on the side
<clever> tazjin: more about the ssh layer
<clever> tazjin: the implementation was massively changed in 2.0
<clever> tazjin: with 2.0, maybe?
<clever> thats also why i avoid ~/.stack's cached builds, nix doesnt really know about them
<clever> and its now 6am, i should get to bed
<clever> LnL: ah yeah, if you instead nix-env -f unit.nix -i, it would land in ~/.nix-profile/yourthing.service, and you gain full rollback control
<clever> and it wont update things without warning, the version can only change if you re-run nix-build
<clever> hask_bee_3: as long as the symlink nix-build created remains, nix will not delete the things it refers to
<clever> hask_bee_3: this nix expression generates a thing.service file, that is based on the template in the nix, with some nix builds inserted
<clever> hask_bee_3: one min
<clever> hask_bee_3: ahh, you mean outside of nixos, i'm not sure how well the nixos .service files would work outside of nixos, but you can always make your own with writeTextFile
<clever> hask_bee_3: this example has config and runs snmpd https://github.com/cleverca22/nixos-configs/blob/master/snmpd.nix
<clever> hask_bee_3: this example runs iscsid, and also loads a kernel module: https://github.com/cleverca22/nixos-configs/blob/master/iscsi_module.nix
<clever> hask_bee_3: https://nixos.org/nixos/options.html#systemd.services
<clever> mbrock: that happens if you use a 2.0 client with a 1.11 daemon
<clever> joko: create a custom configuration.nix, and add one of the iso files to imports (probably graphical-kde?), then set this, and nix-build the right target
<clever> joko: one minute
<clever> now thats strange....
<clever> #0 0x00007fbdaf4b86d4 in clock_gettime () from /home/clever/.local/share/Daedalus/installation/lib/libc.so.6
<clever> Program terminated with signal SIGSEGV, Segmentation fault.
<clever> possibly due to fully switching to 2.0 on both ends?
<clever> but it went away pretty fast
<clever> i think i saw some trouble with nix-build consuming 100% cpu when i was upgrading
<clever> sphalerite_: nix already does everything i need, so i just never learned stack/cabal
<clever> sphalerite_: ah, hadnt seen that option, i dont really use stack much
<clever> sophiag: the root of the project i think
<clever> sophiag: i dont think stack understands them either, so you must make a shell.nix that can supply them
<clever> sophiag: that shell wont have any non-haskell dependencies in it
<clever> i think you need to make your own shell.nix, and use stack --nix, in that case
<clever> so the auto-generated nix xpressions omit them also
<clever> sophiag: cabal doesnt really understand non-haskell dependencies
<clever> sophiag: i think you need to use overrideCabal to add librarySystemDepends = [ libpcap ];
<clever> Guanin: its inheriting the argument to the function, not the function itself
<clever> Guanin: thats identical to just locations = locations; still
<clever> sphalerite_: i dont think he was back, he has been reconnecting and pinging out for the last 8-ish hours
<clever> sphalerite_: yeah, thats a tricky one because there are several layers of binutils
<clever> ahh
<clever> sphalerite_: what is just the drv name?, maybe ive memorized it already? lol
<clever> thats a much simpler way
<clever> then it could print meta.position and every .drv
<clever> or another one of the trace family
<clever> sphalerite_: you could maybe modify stdenv.mkDerivation such that it calls lib.traceShowVal
<clever> sphalerite_: then just chase it down on the nix side
<clever> sphalerite_: look at where it is within nix-store --query --tree, and then check the .drv at each step to get hints on which parameter to mkDerivation it was in
<clever> which essentialy made the entire extension unusable
<clever> but in the case above, it got to the point that the process for one-tab crashed every time i tried to use one-tab
<clever> sophiag: the multi-process nature of chrome helps to contain those crashes
<clever> sophiag: and it ran out of file-descriptors
<clever> sophiag: and the gui had such an insane number of links, that it went nuts trying to load the same font in parallel
<clever> sophiag: turns out, chrome calls socketpair() when loading fonts
<clever> sophiag: i got to the point, that opening the gui for one-tab, killed the rendering process for it in chrome
<clever> sophiag: oh, i also found an un-expected bug in chrome, due to one-tab
<clever> sophiag: and the second chrome profile (in the same instance) has another 142
<clever> sophiag: my primary chrome profile has 885 tabs open right now
<clever> sophiag: ah, thats mostly due to my tabs, one sec
<clever> sophiag: ?
<clever> mfiano: for example, youtube already uses f for fullscreen, and things get wonky if f does 2 things
<clever> mfiano: there is also a config thing in vimum to blacklist certain domains from having the hotkeys
<clever> mfiano: f for example, puts a unique letter(combination) on every link, hit that letter to "click" it
<clever> mfiano: vimium also has a number of other hotkeys i rarely use, that basically apply tiling window-manager features to the whole browser
<clever> sophiag: my chrome eats about 32gig of ram and another 32gig of swap
<clever> lejonet: the cpu draws enough watts that 100% usage can trip the overload alarm on the UPS
<clever> lejonet: thats what the desktop has
<clever> model name : AMD FX(tm)-8350 Eight-Core Processor
<clever> yeah
<clever> lejonet: the cpu can also nearly match my desktop, yet has half the cores
<clever> lejonet: the bigger the screen, the more text you can fit
<clever> lejonet: its mainly a coding laptop
<clever> sophiag: double-checking the site, i dont even see a gpu variant offered for the kudu
<clever> sophiag: but i have cracked it open, and there is a very clear void on the motherboard where the gpu&gpu ram goes, along with a massive void where the cooler would have gone
<clever> sophiag: 32gigs of ram, i went with the variant that has no dedicated gpu, since i'm not gaming on it
<clever> sophiag: https://system76.com/laptops/kudu is what i'm currently running
<clever> sophiag: one min
<clever> the trick, is that you can now just cut power to the entire 3d GPU
<clever> and configure it, to just render 2d frames into the framebuffer of the low-power chip
<clever> and then they glued a powerfull 3d chipset on the side
<clever> basically, the screen is tied to a dumb low-power video chipset
<clever> ive heard of some weird laptop setups, that do "fun" things to save power
<clever> murderize that, it respawns, and no state is lost
<clever> the problem, is that it shoves all GUI updates into a single process, that sometimes hangs
<clever> sophiag: ps aux | grep =gpu, and kill only the gpu process, and it recovers
<clever> sophiag: sometimes, chrome appears to hang, but youtube keeps playing
<clever> sophiag: oh, i have a bug that sounds related
<clever> pjan: ''in this string, you do ''${this} and your done''
<clever> chromes built-in tab-restore is a bit dogdy, if you dont choose to restore, or you fail during restore, the restore is lost
<clever> sophiag: fourth, i use vimium to search for tabs, T in any tab pops open a search UI
<clever> sophiag: third, i use unique tabs to prevent duplicates (sadly, it only checks within a single window)
<clever> sophiag: second, i use one-tab to store tabs short-term
<clever> thats the last-ditch backup
<clever> sophiag: first, i use session buddy to save all tabs, it also semi-randomly saves its own snapshots
<clever> sophiag: i have 4 addons just to help wtih that
<clever> ah, then nix-env -u wont update it either
<clever> sophiag: that will list everything you installed with nix-env
<clever> sophiag: what about nix-env -q ?
<clever> sophiag: what if you just run chromium from a shell?
<clever> mfiano: i treat it more like a daemon
<clever> mfiano: i just never close chromium...
<clever> sophiag: but then it has to rm -rf /nix/store/trash at the end, and do the slow part it was avoiding the entire time
<clever> sophiag: so the paths are either in the store, or not, and they are never partially deleted
<clever> sophiag: nix makes the "deletions" more atomic, by instead moving the trash into /nix/store/trash with the rename() syscall
<clever> mfiano: just nix-collect-garbage without any flags
<clever> and mapped files
<clever> sophiag: it scans the open files, arguments, running binaries, and env variables
<clever> sophiag: nix is smart enough to check what files are in use
<clever> its not going to clean up any generations
<clever> mfiano: i dont think it will print anything in that mode
<clever> -p takes a path to a profile
<clever> not the system profile
<clever> that is pointing to a profile called 1 in the current directory
<clever> i dont think negative numbers work either
<clever> sophiag: they dont renumber, so you can delete in any order
<clever> so 2 files with the same hash, share a hardlink to that path, and share the contents
<clever> then it will hardlink the file to /nix/store/.links/$HASH
<clever> if you run `nix-store --optimize`, it will go thru every single file in the store, and hash it
<clever> nix also has file level dedup
<clever> things may break at INT_MAX? lol
<clever> so the number just keeps going up without limit
<clever> and it will never fill the holes in
<clever> so you will wind up with holes in the list
<clever> they dont shift when deleted
<clever> if you do another rebuild, while in that state, it will check 58, see its in use, then make 59 the new one
<clever> so if i made a rollback, system would become a symlink to system-57-link
<clever> if you do a rollback, all it does is point system to an older generation
<clever> the next one will be 59
<clever> system points to the current generation, 58 in my case
<clever> lrwxrwxrwx 1 root root 92 Feb 13 14:21 /nix/var/nix/profiles/system-58-link -> /nix/store/n8j8g3vw1y1zh8wq6ab79rcdyd4hn0c2-nixos-system-system76-18.03pre125130.3a763b91963
<clever> lrwxrwxrwx 1 root root 92 Feb 7 01:54 /nix/var/nix/profiles/system-57-link -> /nix/store/v1qw417lq5h13wzma299a60ys6w2nkmd-nixos-system-system76-18.03pre125130.3a763b91963
<clever> lrwxrwxrwx 1 root root 14 Feb 13 14:21 /nix/var/nix/profiles/system -> system-58-link
<clever> [root@system76:~]# ls -l /nix/var/nix/profiles/system{,-5?-link}
<clever> it always starts +1 above the current
<clever> ah
<clever> mfiano: i much prefer targeted deletion, since i dont loose anything i might have wanted, but sometimes you just dont have the time
<clever> sophiag: more that it lets you preview what $i is at every command
<clever> and nix-store --delete is happy to remove it
<clever> and then i --query --roots to find nothing depends on it
<clever> the du i gave above has finished, i see 5 storepaths, that are 1.9gig each
<clever> sophiag: put an echo before the nix-env
<clever> sophiag: that lacks the -p flag, so its deleting generations from the `nix-env -i` profile
<clever> sophiag: what did you delete?
<clever> that gets edge cases the above things dont get, like a result symlink from 3 years ago in a random directory, lol
<clever> then selectively remove roots/generations, and `nix-store --delete`
<clever> then, run `nix-store --query --roots /nix/store/fat-thing-1` to find out what depends on it
<clever> this one will print everything in the store, sorted by size
<clever> [root@router:/nix/store]# du --max-depth=1 -hc | sort -h
<clever> there is another i often use
<clever> if ran with root, it cleans up every profile
<clever> if ran without root, it can only clean up nix-env for the current user