2018-03-07

<clever> ottidmes: kexec --console-vga may help, or you need to stop X first
<clever> ottidmes: the newly booting kernel expects the GPU to be in text mode, and the video driver is confused
<clever> ottidmes: was X running?
<clever> rawtaz: just because something is downloaded into the store doesnt mean it gets added to $PATH
<clever> mt_caret_: so you could just use libstore and libexpr directly

2018-03-06

<clever> yeah, lol, but its out of whack again :P
<clever> hyper_ch2: as long as i dont drop the dhcp lease, and dont go offline for over an hour, it doesnt expire, so i could keep it for years
<clever> anyways, its getting pretty "late" here, i should get to bed before i pass out
<clever> LnL: ah, ive had problems in the past where zfs would deadlock, every core stuck in a spinlock waiting for more ram, and no cores able to release ram
<clever> thats over a year worth of upgrades being applied to an active machine, without it going offline or loosing its public ip
<clever> and i was able to upgrade the router from nixos to nixops, without loosing my internet, then upgrade it from 16.03 to 17.09, without going offline
<clever> hyper_ch2: i have 5 machines in my house that run 24/7
<clever> the panic output is rather unreadable if the machine is frozen and cant wake up the gpu
<clever> hyper_ch2: some are very special purpose, this line for example disables dpms on a headless machine, so if it ever has a kernel panic and locks up, the gpu remains on and can render the panic
<clever> they just pile up and never go away :P
<clever> hyper_ch2: all the random tweaks you make to an os, that would normally have been lost after a reinstall
<clever> 2018-03-06 11:05:05 < clever> LnL: i forget what it does now, but thanks to nix, years worth of hacks just pile up, lol
<clever> hyper_ch2: when combined with datadog, you get https://imgur.com/a/venfE
<clever> hyper_ch2: also, ive been writing this util to monitor zfs better: https://github.com/cleverca22/arcstats
<clever> hyper_ch2: was refering to how you dont loose years worth of hacks on nixos
<clever> hyper_ch2: `arcstat.py -v` will also give a description of every column
<clever> is that a good thing or a bad thing? lol
<clever> LnL: nothing gets lost, even if the hardware fails!
<clever> LnL: i forget what it does now, but thanks to nix, years worth of hacks just pile up, lol
<clever> hyper_ch2: c is the goal for how big the arc should be, respecting zfs_arc_max, arcsz is how big it currently is
<clever> hyper_ch2: arcstat.py -f time,read,dmis,dhit,dh%,mrug,mru,mfu,mfug,mread,c,ph%,pm%,mm%,miss,hits,mhit,mh%,mmis,hit%,eskip,arcsz 10
<clever> also
<clever> hyper_ch2: i think it defaults to half your ram
<clever> hyper_ch2: boot.kernelParams = [ "zfs.zio_taskq_batch_pct=50" ]; for ex
<clever> mfiano: nix-instantiate --find-file nixos-config says what?
<clever> mfiano: what is in configuration.nix?
<clever> zfs.zfs_arc_max=1234 on the kernel cmd line to set it at bootup
<clever> echo any number to adjust it
<clever> hyper_ch2: this file is the max number of bytes the arc can use
<clever> /sys/module/zfs/parameters/zfs_arc_max
<clever> mfiano: i dont see 20 listed in any of the configs
<clever> hyper_ch2: though i also have 64gig of swap and i havent played with my overcommit settings, so the kernel is more willing to give me ram i dont yet have
<clever> hyper_ch2: i think the issue, is that qemu tries to allocate a huge amount all at once, more then what the kernel has free normally
<clever> hyper_ch2: there is a min-free thing somewhere in /proc
<clever> hyper_ch2: btrfs just didnt perform that well, and it falsely read-only'd the machine after a write timeout because of how bad the perf was
<clever> devsteff: ~/.config/nixpkgs/config.nix, { packageOverrides = pkgs: { ... }; }
<clever> mfiano: can you gist all involved files?
<clever> mfiano: are you using mkForce in either file?
<clever> gchristensen: lol
<clever> yeah
<clever> nixer101: though they also block old versions from working, so it doenst really help much
<clever> nixer101: yeah, thats also anoying, and they should stop doing that
<clever> nixer101: but i think it had a redesign since then, it looked different when i was fixing the nix package once
<clever> nixer101: in the past, i remember looking at how teamviewer worked, and it was just an exe file with wine bundled along-side it, and a special wine library to give linux screen-capture support to an exe file inside wine
<clever> dont remember the details
<clever> all with btrfs
<clever> mfiano: and the machine falsely detected write failures, and went into a panic mode, remounting the rootfs read-only
<clever> mfiano: then it took another hour just to GC those .drv files
<clever> mfiano: a hydra based job took over an hour to generate just the .drv files
<clever> mfiano: i think i just set the +C flag it says to set, but i dont use btrfs anymore
<clever> nixer101: you need to use callPackage if you want to mix things together
<clever> nixer101: it figures it all out, within the nixpkgs the package came from
<clever> nixer101: how is nix going to know which programs to use from the 2nd set, and which library to not use from the 2nd set?
<clever> nixer101: use callPackage to load the package you want
<clever> mfiano: nix-store --version
<clever> mfiano: it can also happen if you just unset NIX_REMOTE somehow
<clever> which broke the 1.11 nix libraries
<clever> mfiano: nix 2.0 auto-detects that, so nixos stopped setting NIX_REMOTE
<clever> mfiano: nix-repl is linked against nix1.11, and you need to `export NIX_REMOTE=daemon` for it to work
<clever> just the number of entries in that directory
<clever> i thought it was due to the sheer size of /nix/store itself
<clever> avn_: i happen to keep /nix on its own dataset, so i can disable snapshots there
<clever> avn_: that will depend on if the store is in its own zfs dataset or not
<clever> nixer101: i use zfs for everything here, and it also supports compression
<clever> mfiano: i dont reinstall that often, so its not an issue
<clever> yeah, without the answer to what you asked, you have to update the nix file and rebuild every other machine
<clever> mfiano: this pre-configures known-hosts system wide
<clever> ottidmes: nix-serve still works with 2.0
<clever> thats a result of the split-output changes
<clever> and yeah, its in .out
<clever> Phillemann: ah, its libFLAC, not libflac
<clever> libFLAC.la libFLAC++.la libFLAC.so libFLAC++.so libFLAC++.so.6 libFLAC++.so.6.3.0 libFLAC.so.8 libFLAC.so.8.3.0
<clever> [clever@amd-nixos:~/apps/syncplay]$ ls /nix/store/f8f2jhfkn3jj3skdvs29zr8x9ilk21h9-flac-1.3.2/lib/
<clever> Phillemann: thats the out output, rather then the default one
<clever> Phillemann: ah, flac doesnt contain a libflac.so
<clever> ij: yeah, that will only work once, and it wont notice changes to the dir
<clever> Phillemann: you want flac.lib
<clever> ij: you want builtins.fetchgit ./.
<clever> ij: so nix will only run that command once
<clever> ij: the hash is based on the hash of its inputs (git), and the script in the quotes
<clever> mfiano: you can use the ssh config to set it to use a different key for a certain host, and then use an un-encrypted one for that
<clever> mfiano: but you can try export SSH_AUTH_SOCK=/run/user/1000/ssh in the script to fix it
<clever> mfiano: there may be an ssh client difference that makes it not find the agent automatically
<clever> mfiano: does ssh ask for a passphrase for the ssh key?
<clever> mfiano: and what about the key, is it encrypted?
<clever> mfiano: echo $SSH_AUTH_SOCK in the bash script on all machines, and in shells, and see if they diff or match up
<clever> mfiano: the value of $SSH_AUTH_SOCK likely doesnt match up, so it cant use your agent
<clever> mfiano: are the keys encrypted?, the backup script is probably not connecting to the agent
<clever> mfiano: and are you using an ssh agent?, is ~/.ssh/id_rsa encrypted?
<clever> mfiano: ah, and if you run it normally with -v, what does it print?, can you pastebin that?
<clever> mfiano: and what is the exact error?
<clever> mfiano: try manually running ssh as the same user the backup runs as
<clever> triangles42: what was printed above that?
<clever> mfiano: what error?, and have you read things like `man systemd.service` ?
<clever> mfiano: mostly
<clever> though you can also delete them, and just set the uid setting in configuration.nix
<clever> if /etc/passwd/shadow are left intact, nix will just keep them
<clever> the directories are also 777
<clever> drwxrwxrwt 8 root root 8 Jun 18 2016 /nix/var/nix/profiles/per-user
<clever> drwxrwxrwt 6 root root 6 Apr 24 2016 /nix/var/nix/gcroots/per-user
<clever> those directories are owned by the user they are named after
<clever> drwxr-xr-x 3 clever users 18 Mar 1 10:07 /nix/var/nix/profiles/per-user/clever
<clever> drwxr-xr-x 2 clever users 2 Oct 11 2015 /nix/var/nix/gcroots/per-user/clever
<clever> pareidolia: /nix/var/nix/gcroots/per-user/foo and /nix/var/nix/profiles/per-user/foo is the only parts that are not owned by root
<clever> pareidolia: and you can just chown -R the whole thing over for the most part
<clever> risci: nix doesnt really deal with things changing on their own, you have to either manualy update the file with `git pull`, or update the rev and sha256 of the result and use fetchFromGitHub
<clever> the man page may also help correct any typos i made
<clever> mpickering: you can double-check the pkg-config invocation if you run nix-shell against the failing .drv file
<clever> mpickering: in the preBuild for the problem package, set CFLAGS="$CFLAGS $(pkg-config --cflags libspatialindex)" i think
<clever> also, most of my machines are in the house, so you already have physical access by that point
<clever> youll have better luck just finding my house and breaking in
<clever> good luck guessing my 2048bit key :P
<clever> mfiano: it has to be enabled for nixops to work, i prefer just turning password login off
<clever> when cross-compiling, nativeBuildInputs will be built for the host arch, and buildInputs for the target arch
<clever> nativeBuildInputs is best for build-only tools
<clever> its trying to solve the same problem nix solves, but it breaks all nix builds in the process :P
<clever> ive also been anoyed at how all of the gnome/glib stuff puts its headers in include/glib-1.0 and such
<clever> mpickering: how are you building it when it fails?
<clever> mpickering: check to see what happeks if you just put pkgconfig into the buildInputs of your thing
<clever> mpickering: pkg-config should spit out the right -I flag you need to add to CFLAGS, and the build system for your package may automatically use that if you add pkgconfig to the buildInputs
<clever> mpickering: yeah
<clever> mpickering: does the package have a pkg-config file?
<clever> mfiano: the source behind types.lines
<clever> just use the imports list to refer to filea and fileb
<clever> nix will automatically concat each of the strings, and seperate them with \n's
<clever> mfiano: thats the type code for sessionCommands
<clever> mfiano: thats what types.lines does
<clever> but i dont see how that is actually causing the issue
<clever> about all i can say, is that i always put /nix on its own partition, not /nix/store
<clever> yeah, cant find anything fishy anywhere
<clever> what about the configuration.nix section for mounting /nix/store at bootup?
<clever> mfiano: what about `findmnt --noheadings --output OPTIONS /nix/store` ?
<clever> yeah, that should be working...
<clever> what is the output of `cat /proc/cmdline` ?
<clever> still using grub?
<clever> rootfs on an sd card?
<clever> mfiano: is that a raspberry pi?
<clever> mfiano: what is the output of `mount` on the system with 1 mount?
<clever> mfiano: can you gist the contents of /run/current-system/init from both the 1 and 2 system?
<clever> mfiano: can you double-check to confirm that?
<clever> mfiano: 2 is normal, and id recomend you make sure its always 2, remove readOnlyStore from your configuration.nix
<clever> mfiano: https://nixos.org/nixos/options.html#nix.readonlystore
<clever> you must have turned that safety off on that system
<clever> mfiano: that double-mount is a safety to stop you from doing such things
<clever> mfiano: if you run "sudo touch /nix/store/test" on the system with only 1 mount, what happens?
<clever> mfiano: do both of them have a dedicated /nix/store partition, or a /nix partition?
<clever> mfiano: what cant you figure out?
<clever> it no longer calls stack
<clever> or it could builtins.fetchurl a revision from github
<clever> it could return an entirely custom set of packages via: with import <nixpkgs> {}; { foo = callPackage ./foo.nix; }
<clever> how it gets nixpkgs, and if its even using nixpkgs, is up to you
<clever> in the example .nix-defexpr/test/foo/default.nix above, and any custom ones you make, you just need to ensure the default.nix returns a set of packages
<clever> and ~/.nix-channels is just a text file, that contains the URL's nix-channel will download
<clever> and ~/.nix-defexpr/channels/ is just a symlink to that profile
<clever> nix-channel treats each channel as a seperate package that can be installed within that profile
<clever> and this one lists all "packages" installed in the current generation
<clever> nix-env -p /nix/var/nix/profiles/per-user/root/channels -q
<clever> this tells nix-env to use a different profile, and to list the generations
<clever> nix-env -p /nix/var/nix/profiles/per-user/root/channels --list-generations
<clever> nix-channel will call nix-env behind the scenes, to "install" an unpacked .tar.gz into the profile
<clever> its a nix-env profile
<clever> channels_root is root's
<clever> channels is for the current user
<clever> so channels/nixos/default.nix creates a nixos channel
<clever> any other path elements are silently ignored, so test/channels/channels_root act a bit like namespaces
<clever> nix will recursively search for either a <name>/default.nix or a <name>.nix, and then create a <name> channel
<clever> cbarrett: this generates a foo channel, so i can nix-env -iA foo.hello
<clever> [clever@amd-nixos:~]$ cat .nix-defexpr/test/foo/default.nix
<clever> import /home/clever/apps/nixpkgs
<clever> cbarrett: i already figured that out
<clever> not that i know of
<clever> ive been a bit weary of enabling nix-serve in combination with some secrets in my store
<clever> dont know then, but i should probably play with that on my own machines
<clever> also, which version of nix is the other end using?
<clever> which is why my --help trick didnt work
<clever> it will entirely ignore the command that the ssh client asks for
<clever> yeah
<clever> and it lacks --write, so i think you are also limited to read-only store access
<clever> ottidmes: the config forces it to always run nix-store --serve, so you can never change the params or gain a shell
<clever> ottidmes: ah, its in the sshd config, one sec
<clever> ottidmes: look at the end of the ssh key
<clever> ottidmes: even with the --help?, ah, check the /etc/ssh/authorized_keys.d on the server
<clever> jbetz: and the trust actually allows "unsafe" haskell to run in restricted contexts when you said no unsafe stuff
<clever> no, it depends on 2 packages, lambdabot, and lambdabot-trusted
<clever> jbetz: check the cabal file for lambdabot, does it have a seperate -trusted thing you have to enable?
<clever> gammarray: but it just works when using the xfce gui
<clever> gammarray: yeah, and several variants
<clever> jbetz: if you check ghc-pkg list, is lambdabot-trusted available?
<clever> jbetz: i dont think that has to do with nix, thats the trust system within ghc for restricted io modes
<clever> abathur: not really
<clever> ottidmes: what happens if you `ssh nix-ssh@server nix-store --help` ?
<clever> jbetz: and have you tried cabal2nix?
<clever> jbetz: what is the actual error?
<clever> jbetz: ah, thats the haskell mkDerivation, that one should also work
<clever> jbetz: are you using ghcWithPackages?
<clever> the power button actually registers as a key over HID, and will turn off the headset if held
<clever> in total, it has 5 buttons, 2 switches, and a 1 axis wheel
<clever> the buttons are also not fully labeled
<clever> interesting!, it claims to have a 2 axis "wheel" but only 1 axis exists
<clever> for example, the G930 has Button labels: "Button 0" "Button 1" "Button 2" "Button Wheel Up" "Button Wheel Down" "Button Horiz Wheel Left" "Button Horiz Wheel Right" "Button 3" "Button 4" "Button 5" "Button 6" "Button 7" "Button 8" "Button 9"
<clever> `xinput list --long` shows a lot more
<clever> both machines also have 2 power buttons, and the laptop also has a sleep button
<clever> ↳ AT Translated Set 2 keyboard id=11 [slave keyboard (3)]
<clever> ↳ Video Bus id=7 [slave keyboard (3)]
<clever> ⎜ ↳ SynPS/2 Synaptics TouchPad id=12 [slave pointer (2)]
<clever> if i switch over to the laptop...
<clever> rest is fairly standard things
<clever> ↳ Logitech Logitech G930 Headset id=8 [slave keyboard (3)]
<clever> ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
<clever> ↳ Eee PC WMI hotkeys id=11 [slave keyboard (3)]
<clever> odd
<clever> Acou_Bass: and how did you list those?
<clever> Acou_Bass: is an android device plugged in?
<clever> joepie91: i'm guessing its because some cameras have a button on them, but this one doesnt appear to have any
<clever> gammarray: it has done similar with my resolution and monitor layotu before
<clever> gammarray: i have a feeling xfce may have been turning it back on, every time i logged in, no mater what i set system wide
<clever> Mar 05 20:03:37 system76 kernel: input: Chicony USB 2.0 Camera as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/input/input34
<clever> X also thinks its a keyboard, lol
<clever> Mar 05 20:03:37 system76 X[2659]: (II) XINPUT: Adding extended input device "Chicony USB 2.0 Camera" (type: KEYBOARD, id 10)
<clever> fn + f10 fully unplugs the webcam in the display
<clever> Mar 05 20:03:35 system76 X[2659]: (II) config/udev: removing device Chicony USB 2.0 Camera
<clever> applications->settings->mouse&touchpad, simple! lol
<clever> gammarray: *doh*, i never thought to look in the xfce settings, that does work
<clever> f1&f4 are clearly marked on the keyboard
<clever> fn+f4 will also cycle thru the keyboard backlight levels

2018-03-05

<clever> and fn+f1 entirely disables the touchpad
<clever> the laptop also has a totally unmarked hotkey, fn+1 just maxes out the cpu fan
<clever> gammarray: i tried both synaptics and libinput, neither could disable tap to click
<clever> and its hard to simply scroll down, because 2 finger drag is a 2-axis mouse "wheel"
<clever> i let go of control too fast,because the dumb firmware is checking for a double-tap
<clever> single click has a decent amount of latency, so it always messes up if i try to control+tap
<clever> you cant tripple click, because the touchpad firmware thinks your trying to so a single click&drag
<clever> tapping with 2 fingers is right click
<clever> gammarray: on my laptop (not a macbook), nothing ive done has been able to disable tap to click, and every now and then i find a new un-documented feature
<clever> Acou_Bass: ive got zfs with daily snapshots and mirroring, so i would expect things to be recoverable
<clever> mpickering: lib.optional returns a list in either case
<clever> mpickering: id also recomend just putting the override into config.nix, so you dont forget it
<clever> Sonarpulse: then it should have restarted itself
<clever> Sonarpulse: how did you install 2.0?
<clever> Sonarpulse: is the daemon also 2.0?
<clever> elvishjerricco: nix-store --dump <path> prints a nar to stdout, and nix-store --restore <path> reads a nar from stdin
<clever> Acou_Bass: not sure then, i also had problems on the last update, but X refused to even start, amdgpu cant find the card, and simple rollbacks dont help, have to boot the older kernel
<clever> mpickering: nix-env -i -E 'with import <nixpkgs> {}; foo.override { bar = true; }' i believe
<clever> elvishjerricco: do you want it to land in /nix/store or just unpack it anywhere and peek inside?
<clever> Acou_Bass: ah, journalctl -u display-manager, any errors near the end?
<clever> elvishjerricco: it has to eval every single attribute in pkgs. and check the .name of each
<clever> Acou_Bass: then check if X is running
<clever> Acou_Bass: if you do ctrl+alt+f1 can you get a text console?
<clever> :'(
<clever> wow
<clever> catern: -i has to eval all of nixpkgs, -iA hello only has to eval hello
<clever> !-A
<clever> catern: nix-env -iA nixos.hello
<clever> srhb: i remember that one, what was it...
<clever> but you now have the option to disable
<clever> it defaults to checking signatures, even when you have absolute control over the store (+w)
<clever> that even explains the weird problems ive had with `nix copy`
<clever> and is also an improvement
<clever> that would explain things
<clever> while on 1.11, a trusted client just never has checking, i think
<clever> tnks: so a trusted client, has to choose to enable/disable signature checking
<clever> untrusted are forced to false
<clever> ultimate is also something the client provided
<clever> if you are untrusted, it forces it back to false
<clever> ah, and the dontCheckSigs line 689 is checking, is what the client set
<clever> and ultimate may have other effects afterwards
<clever> tnks: ah, so the new way, it sets the ultimate flag, rather then dontCheckSigs
<clever> Lisanna: nix-instantiate --eval -E 'with import <nixpkgs>{}; "${hello}"'
<clever> tnks: back it up with src
<clever> tnks: that could probably be done with some changes to the src
<clever> ottidmes: i manually deleted a path, set that option, then nix-build'ed it, and it was signed
<clever> ottidmes: what i said above
<clever> tnks: so signatures are just always present in db.sqlite
<clever> tnks: i would keep the secret-key-files at least, since that signs everything automatically
<clever> tnks: not sure yet
<clever> tnks: the rules may have changed in 2.0
<clever> tnks: [root@system76:~]# sqlite3 -header -column /nix/var/nix/db/db.sqlite 'select path,registrationTime,narSize,sigs from ValidPaths where sigs != "" limit 10'
<clever> that reads the sha256 field, and ignores the rest
<clever> but you can still use nix, (builtins.parseJSON (builtins.readFile ./foo.json)).sha256
<clever> ah, i dont think there is a took that outputs the right json for that
<clever> Hub
<clever> srid: pkgs.fetchFromGitHub (builtins.parseJSON (builtins.readFile ./foo.json)) i think
<clever> havent confirmed if it actually does such things though
<clever> it would also be trivial to write to a tmp file with the wrong name, then use rename() to atomicly put it into place
<clever> Lisanna: i'm assuming nix will only create the narinfo after the nar is valid