2018-02-16

<clever> and which zfs datasets to actually mount
<clever> and you still have the /boot and swap uuid's
<clever> and will refuse to mount if another hostid has touched the pool
<clever> zfs needs a per-machine hostid
<clever> and my method allows you to make a 2nd machine with the same setup, but different uuid's
<clever> your going to need a new uuid anyways
<clever> if your configuration.nix is lost, so is your fs :P
<clever> ToxicFrog: second, with my idea, the only difference configuration.nix contains, is the fs UUID's
<clever> ToxicFrog: first, you need such hacks to share the configuration.nix between machines :P
<clever> ToxicFrog: 2 problems with that
<clever> ToxicFrog: i prefer to instead, keep configuration.nix outside of git, and it just has the bare minimum required to boot, and points to the real config, in git
<clever> ToxicFrog: but that will fail for nixos-install
<clever> ToxicFrog: then it becomes relative
<clever> ToxicFrog: also, you can do ./. + "/${lib.removeSuffix "\n" (builtins.readFile /etc/hostname)}/configuration.nix"
<clever> ah, nice
<clever> nhill: because nixpkgs is already loaded by the time its reading that config file
<clever> nhill: configuration.nix cant configure which nixpkgs you use
<clever> ToxicFrog: this returns an array
<clever> nix-repl> lib.splitString "\n" (builtins.readFile "/etc/hostname")
<clever> ToxicFrog: was about to sudjest that next :P
<clever> ToxicFrog: i can confirm, neither shows up in `env`
<clever> ToxicFrog: heh, weird
<clever> simpson: biggest issue i can see, is getting the clients to support jack, chromium, teamspeak, steam
<clever> goibhniu: i think bluez removed the alsa utils, and only the pulseuadio daemon has support now
<clever> simpson: id like to see better jack support in nixos
<clever> ToxicFrog: builtins.getEnv "HOSTNAME" i think
<clever> ToxicFrog: are you managing things in git?
<clever> ToxicFrog: can you gist the whole configuration.nix file?
<clever> ToxicFrog: it should be
<clever> ToxicFrog: can you gist the nix expression?
<clever> silly systemd, go away
<clever> stat: cannot stat '/media/videos/4tb/': Too many levels of symbolic links
<clever> systemd-1 on /media/videos/4tb type autofs (rw,relatime,fd=25,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
<clever> running nix-shell on the .drv that nix generates, will give you the exact shell nix was using
<clever> also, if your writing the .drv file, your doing something very wrong
<clever> heh
<clever> ?
<clever> and echo $buildInputs and friends
<clever> ToxicFrog: find the .drv file for this derivation, and run nix-shell directly on that drv, then try echo $PATH
<clever> ToxicFrog: and perl should be in that
<clever> ah yeah, *doh*
<clever> ToxicFrog: whi ${dir}/perl and not ${dir}/bin/perl?
<clever> ToxicFrog: how is it checking for perl?, read the source of the configure script and/or the config.log
<clever> test will also restore the above path into a symlink
<clever> nix will replace it with a symlink next time you `nixos-rebuild switch` or reboot
<clever> you have now copied the contents out into a regular file
<clever> drakonis: cat nix.conf > new; rm nix.conf ; mv new nix.conf
<clever> drakonis: for simple things like /etc/nix/nix.conf, its a symlink to the nix version
<clever> drakonis: depends on what you want to change, and there are ways of forcing it
<clever> and totally impure, because i could just update the squashfs with anything i had changed
<clever> or just not save my changes
<clever> drakonis: i could then tar up the tmpfs and save it back to the stick at shutdown, or re-squashfs the whole thing
<clever> drakonis: the entire system was a squashfs on a usb stick, and a custom initrd would copy that to ram, then unionfs it with a tmpfs
<clever> drakonis: ive done similar with my gentoo laptop, prior to discovering nixos
<clever> hakujin: so pkgs.path + "/nixos" is the path to the nixos dir
<clever> hakujin: pkgs.path is the path to the root of the nixpkgs
<clever> WilliamHamilton: ive found myself editing libGL before just to debug a problem
<clever> WilliamHamilton: i dont stop when errors happen, and just dive head-first into source ive never seen before :P
<clever> WilliamHamilton: then i just pointed LIBGL_DRIVERS_PATH to the place where i copied the mesa_noglu.drivers derivation
<clever> WilliamHamilton: rather then risk dealing with that, i just forced it to software mode, so it never tries to talk to the hardware/xorg
<clever> WilliamHamilton: there are several issues there, mainly, the api between the xorg half and the application half may have changed
<clever> where /run/opengl-driver will be missing
<clever> i was going down that road, because my goal is to make the program work outside of nixos
<clever> WilliamHamilton: LIBGL_ALWAYS_SOFTWARE and LIBGL_DRIVERS_PATH force it to use the software rendering driver, and to look in a specific place
<clever> WilliamHamilton: LIBGL_DEBUG helps if libGL can load, but fails to find the local drivers
<clever> and other related flags
<clever> you can google most of those var names to find docs
<clever> WilliamHamilton: and then LIBGL_ALWAYS_SOFTWARE=1 LIBGL_DRIVERS_PATH=$APPROOT/lib/dri/ let you manipulate what libGL does
<clever> WilliamHamilton: there is also LIBGL_DEBUG=verbose, which makes libGL itself report debug info
<clever> o just cuts power hard, no sync
<clever> Dezgeg: ah, b or o, that works great
<clever> ottidmes: and also find a command that can actually reboot it, reboot and shutdown are too smart, and try to ask systemd, but that isnt around yet
<clever> ottidmes: you would need to do something like (sleep $((60 * 15)); reboot ; ) & to fork it into the background, then find a way to kill that sub-shell if you change your mind
<clever> WilliamHamilton: rather, it calls dlopen() to dynamically load it, at runtime
<clever> WilliamHamilton: its not listed as something it needs
<clever> WilliamHamilton: `dynamically loaded`
<clever> WilliamHamilton: libmono-2.0.so.1 is trying to load libSDL2-2.0.so.0, so you have to put SDL into the rpath of libmono
<clever> 2478:file=libSDL2-2.0.so.0 [0]; dynamically loaded by /home/carlo/games/gnomoria/game/lib64/libmono-2.0.so.1 [0]
<clever> WilliamHamilton: export LD_DEBUG=files, then run it
<clever> WilliamHamilton: it will tell you who tried to load a given lib
<clever> WilliamHamilton: set LD_DEBUG=files and then look at the error
<clever> sphalerite_: dlopen() is weird, and `patchelf --shrink-rpath` removes needed elements sometimes
<clever> WilliamHamilton: some of them are rather simple, and just blacklist their oposite, lol
<clever> WilliamHamilton: and each module is responsible for adding its own software to the system, if they detect a magic string
<clever> WilliamHamilton: several modules in here run nix expressions against the drivers list you set
<clever> WilliamHamilton: one min
<clever> sphalerite_: the tab-completion in nix repl is weirder
<clever> i needed to compare 1.12 and 1.11 behaviour
<clever> sphalerite_: that reminds me, i was jumping between nix-repl and nix repl in the same shell just 2 days ago, lol
<clever> sphalerite_: it will also then run the bin/switch-to-configuration it just produced, with the flags test/boot/switch
<clever> sphalerite_: i think that can be shortened to nix-env -p /nix/var/nix/profiles/system --set -f '<nixpkgs/nixos>' -A config.system.build.toplevel
<clever> etu: relies on having enough ram and/or swap
<clever> etu: and optionally runs a command when its done building
<clever> etu: nixos-rebuild is just a giant wrapper around nix-env, that points it to a certain expression
<clever> etu: i dont think so
<clever> WilliamHamilton: you probably want to set the rpath with patchelf, rather then touch LD_LIBRARY_PATH
<clever> etu: the nixos repo is no longer maintained
<clever> etu: nixpkgs contains all of nixos
<clever> lrwxrwxrwx 1 root root 58 Feb 13 01:54 /run/opengl-driver -> /nix/store/7kshg3wxkw9njxck6c709kcwf9ih0dsb-opengl-drivers
<clever> WilliamHamilton: /run/opengl-driver is just a symlink into the nix store
<clever> etu: ive memorized where those scripts are...
<clever> etu: i had to switch my nix-daemon for builtins.fetchTarball to even work, and i havent had any problems so far
<clever> WilliamHamilton: is LD_LIBRARY_PATH set?
<clever> since it has to re-build the entire os in a tmpfs
<clever> sphalerite_: that tmpfs bug is also causing major slowdowns when you want to just make a 2 line change to configuration.nix
<clever> ertes-w: nix-collect-garbage will delete what it can
<clever> and libGL also trying to dlopen things
<clever> sphalerite_: the issue was mostly electron trying to dlopen() a dozen things, so ldd didnt find half the deps
<clever> sphalerite_: yesterday, i had to debug libGL, inside electron, with the whole thing patchelf'd to a nonstandard location, so i had 3 layers of debug flags to find and enable, lol
<clever> sphalerite_: LIBGL_ALWAYS_SOFTWARE=1 LIBGL_DRIVERS_PATH=$APPROOT/lib/dri/ and these force libGL to load from a different dir, and to use software rendering
<clever> sphalerite_: these crank up the debug on both ld.so and libGL
<clever> sphalerite_: LD_DEBUG=files, LIBGL_DEBUG=verbose
<clever> sphalerite_: oh, that reminds me, one min
<clever> nix-repl> builtins.typeOf builtins.import
<clever> "lambda"
<clever> ben: also look at what the nix-daemon is doing
<clever> ben: run `ps -eH x` while its hung, and find what nix-shell is doing
<clever> sphalerite_: previously, i had seen something about using a linux syscall subsystem on a sun kernel, just to dtrace linux-elf files, lol
<clever> sphalerite_: yeah, i saw the news in #nixos-dev
<clever> sphalerite_: ah, that explains why i remember it in both
<clever> ben: which run dtrace with special args to make it simpler to trace just one thing
<clever> ben: there are also simpler tools like opensnoop and execsnoop
<clever> i think it was dtrace, or maybe i'm mixing it up with sun stuff
<clever> sphalerite_: mac has dtrace, and it works very differently

2018-02-15

<clever> thblt: yep
<clever> thblt: the difference, is that -n only shows the numbers, but -nn mixes the numbers and the text from no -n
<clever> thblt: another handy thing, `lspci -nn`
<clever> xnaveira[m]: you could create a nix package that generates such a wrapper, then just nix-env -i the package
<clever> what you have, are just extensions, and they keep everything the same
<clever> that is female-female, and it swaps the rx/tx pairs
<clever> sphalerite_: you want to get a null-modem adapter
<clever> definitely not a serial console thing
<clever> sphalerite_: i believe thats an output from the PC, and its wired to the output on both PC's?
<clever> sphalerite_: thats data terminal ready and gnd, weird
<clever> just a shadow between the red and white
<clever> i dont see a black
<clever> time to crack it open then
<clever> sphalerite_: also, that connector in the middle, is it just 2 pins?
<clever> sphalerite_: crack it open!, lets see what pins its connected to
<clever> sphalerite_: photo?
<clever> i think there are another 2, for detecting the remote machine
<clever> which enables hardware flow control
<clever> sphalerite_: preferably, another 2 as well, clear-to-send, in either direction
<clever> sphalerite_: at a bare minimum, 3, rx, tx, gnd
<clever> but it needs special config to persist
<clever> i believe wpa_gui can also dynamically add a network&pass to the daemon
<clever> sphalerite_: and all the passwords came along for the ride, so it just worked, everywhere, lol
<clever> infinisil: https://imgur.com/a/xUM1V
<clever> sphalerite_: i just copied the config from a gentoo machine, it worked, so i left it as it was
<clever> infinisil: yes
<clever> sphalerite_: i think wpa_cli/wpa_gui are hard-coded to expect it there
<clever> infinisil: i just put this line into the unmanaged config file
<clever> ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
<clever> now what? :P
<clever> and you have to edit wpa_supplicant.conf to get the network up!
<clever> also, nixos-rebuild will fail if the network is down
<clever> same
<clever> mai_at_saturn: you must edit the configuration.nix values that control its generation, and nixos will keep a history of every version you have built, and you can even pick an older version from the bootloader to undo it
<clever> mai_at_saturn: /etc/sudoers is read-only, nixos doesnt allow you to change it directly
<clever> and you can also friend other pushbullet users and share to them, like FB
<clever> its sort of like facebook messenger, but each device is a seperate user
<clever> i dont think it has full file sharing, but you can share images
<clever> notification sharing is another thing i use in pushbullet
<clever> goibhniu: oops, wrong g name
<clever> genesis: ah, now that starts to get a bit more useful
<clever> etu: pushbullet does similar
<clever> neither side delt with nix
<clever> ?, i just installed the chromium extension and android app
<clever> sphalerite_: pushbullet is an app i use to share links between mobile devices and the browser, and it also has a clipboard sync feature
<clever> sphalerite_: end result, the nixos machine, that is not involved in teamviewer at all, is mirroring a clipboard on the other side of the continent :P
<clever> sphalerite_: teamviewer synced the clipboard between the win10 vm, and the guy i was helping over teamviewer
<clever> sphalerite_: virtualbox synced the clipboard between the win10 vm and the laptop
<clever> sphalerite_: synergy synced the clipboard between the laptop&desktop
<clever> sphalerite_: synergy does that for me, and i was surprised at how seamless it was being yesterday
<clever> genesis: and then you have repos like chromium that are literally a 20gig clone, i dont even want to know how many digits that needs :P
<clever> genesis: yeah, i need 7 digits to maintain a unique reference in the linux repo
<clever> for linux, its 0fcc3ab
<clever> ca548 is the smallest i can make it while still being unique
<clever> and ca5482604 on another project
<clever> genesis: and the exact same command returns 0fcc3ab23d73 in a checkout of linux
<clever> genesis: that command returns 4c4f1c4 in one of my nixos config repo's
<clever> genesis: i think the git tool itself, will analyze the entire git repo, and pick the shortest prefix that remains unique, plus one or 2 digits
<clever> so you never have to ssh-add again, it just asks for the passphrase and remembers it for a bit
<clever> and they can expire and re-lock after a timeout
<clever> the agent inside gpg, will save the keys you ssh-add long-term, and re-encrypt them via gpg, then actually ask for the passphrase as-needed
<clever> so you have to manualy ssh-add before use
<clever> but its too dumb to discover ~/.ssh/id_rsa on its own, and ask for the passphrase on-demand
<clever> if you just want plain ssh-agent, that should be fine
<clever> not entirely sure its off though, the signs are muddy
<clever> now i'm not even sure how/why it works at all, lol
<clever> makefu: and now that i look closer, i think thats disabled?, and its not even doing anything...
<clever> makefu: this is how mine is setup
<clever> [clever@amd-nixos:~]$ gist -p .xsession
<clever> srk: and all of that was written before the initrd had proper networking support, so the ip stuff is a bit of a hack
<clever> srk: it also needs the more standard fileSystems things as well, like the uuid and type
<clever> Reventlov: start with just a basic derivation like this, paste in the right url to its source, then run nix-build and see what fails first: https://gist.github.com/cleverca22/06ca28c95083d564cad827b09f3a2a89
<clever> srk: so you just set fileSystems."/".iscsi = { enable = true; host = "foo"; lun = "bar"; };
<clever> srk: the iscsi-boot.nix module is also pretty crazy, i modified what nixos supports in fileSystems
<clever> its a totally standard MBR partition table with grub in the MBR, stored in a file on an iscsi server, lol
<clever> grub has zero clue its network booting, lol
<clever> srk: so when grub tries to read the local hdd via standard bios routines, it winds up reading an iscsi image!
<clever> srk: the really fun part, is that the sanboot command, hijacks the bios routines for reading the local hdd
<clever> srk: at one point, i was network booting my gentoo laptop via this script, to run nixos on it without wiping the drive
<clever> srk: you could probably also do that stuff with server-side scripting, one sec
<clever> so you can login and run "justdoit" to wipe the hdd and install nixos
<clever> that nixos image also includes the justdoit script on line 12
<clever> and line 27 instructs ipxe to load the image that comes from nixos, via modules/installer/netboot/netboot-minimal.nix
<clever> the code i was copying had an actual php script, with a switch/case statement, to provide different configs based on the MAC
<clever> which is the "php" script defined on line 25-28
<clever> so now ipxe is told to load the filename on line 70
<clever> ipxe will then re-query the dhcp server, this time with the user-class set to "iPXE", causing the if statement to flip the other way
<clever> srk: it then connects to the tftp configured on line 79, which uses the directory made on 19
<clever> srk: the process starts with the dhcp config, line 69 will fail the match, and it will instruct the bios to download the file on line 72
<clever> and the NAT gives you wifi via the old laptop wifi
<clever> plug anything in, netboot, and it just loads a nixos installer
<clever> and it would run nginx/dhcp/tftp on the ethernet jack
<clever> it would then configure NAT, with the wifi as the 'internet' side, and the ethernet jack as the 'local' side
<clever> the original use for this, was to install it onto my old laptop
<clever> complete with nat, lol
<clever> here is an entirely self-contained netboot server, in a single nixos module
<clever> ive put password prompts and signature checking into my ipxe scripts
<clever> while ipxe has an entire scripting language
<clever> pxelinux.0 supports a very basic config file
<clever> thats a much dumber network boot loader
<clever> oh, and i remember now, pxelinux.0 is an entirely different program/package
<clever> and you can configure the dhcp server to use whatever file you want
<clever> and the last 2 are for actual network booting
<clever> .usb is another mbr image, but with usb drivers included
<clever> .lkrn acts like a linux kernel, for use with bootloaders
<clever> .iso is an iso9660 cdrom image
<clever> oh these, .dsk is an MBR formatted disk image
<clever> ipxe.dsk ipxe.iso ipxe.lkrn ipxe.usb undionly.kpxe undionly.kpxe.0
<clever> that is just a default name
<clever> srk: this is where i get ipxe from
<clever> [clever@amd-nixos:~]$ nix-build '<nixpkgs>' -A ipxe --arg config '{}'
<clever> main issue with automating even the signing, is that your private keys wind up in the binary cache, and hydra will share them with the world
<clever> srk: the dummy json files in the root also let you just nix-build the default.nix's for testing, to preview the json hydra will be using
<clever> srk: https://github.com/cleverca22/hydra-configs in here is the spec.json for nearly every project on my own hydra
<clever> srk: i dont see such a jobset on the random nixos.org projects i checked
<clever> srk: the config for that jobset comes from the spec.json hydra was pointed at
<clever> srk: any declarative project will have a jobset called .jobsets
<clever> Phlogistique: yeah
<clever> Phlogistique: also, i think you have crossSystem backwards, it should be set to linux
<clever> Phlogistique: do you want to cross-compile, or just use a remote builder of the right arch?
<clever> which then locked itself out on the 2nd copy
<clever> fearlessKim[m]: i suspect scp preserved the permissions of the original "file" when you first copied it
<clever> -r-------- 1 root root 0 Feb 11 03:10 /proc/kmsg
<clever> fearlessKim[m]: i think the problem is writing to the local skmsg.log
<clever> but "sudo -i" sets the right HOME=/root/, then nix-channel --list works
<clever> vvvvo: apple is being naughty, "sudo nix-channel --list" uses the wrong $HOME
<clever> dhess: it can be used to almost trivially convert any VPS into nixos
<clever> dhess: have you seen my kexec trick?
<clever> dhess: yeah
<clever> dhess: i manage 2 netbooks with that
<clever> dhess: yeah, and you can use that directly, by setting it to the "none" backend
<clever> catern: you can apply the overrides on a per-host basis
<clever> catern: so you can pre-test a new nixpkgs on a staging cluster
<clever> catern: nixops also lets you trivially deploy a second copy of the entire cluster
<clever> catern: yeah, at some point, you would update the nixpkgs version, and delete some of the overrides
<clever> catern: in general, i would use an override to upgrade some services, rather then trying to mix things
<clever> catern: ah, you may want to use packageOverrides to change the versions of the services
<clever> catern: oops, ^^^
<clever> chessai: do you mean restarting one machine at a time, or pushing updates out to an already running machine?
<clever> chessai: and dont tell them :P
<clever> chessai: just install ubuntu inside virtualbox, and hit the fullscreen button
<clever> samueldr: lately, the data is in text files with a fixed width, spaces for padding
<clever> samueldr: the PDF's ive been dealing with are unclaimed property reports
<clever> samueldr: its a latex monad
<clever> samueldr: pandoc is the primary way of creating the pdf's, and lately, i have been using HaTeX (a haskell package)
<clever> samueldr: and if i modify any of the code, nix just re-computes whatever it has to, using the normal dep tree
<clever> samueldr: and the entire process was started with a single `nix-build`
<clever> samueldr: ive written a nix expression and some haskell code, that took nearly 600mb worth of PDF files, extracted the data from them into a database, filtered&sorted it, then spit out a PDF file of the results
<clever> samueldr: i also use nix for pdf generation and data processing
<clever> samueldr: and ive had the alarm go off 3 times within a 2 hour span
<clever> samueldr: ive had the alarm clock just not go off one day, because the shifting dodged the set time
<clever> samueldr: i'm in NB, and if i leave the phone timezone on automatic, it will randomly grab a quebec tower, and shift the clock by an hour
<clever> samueldr: heh, quebec is so close to me, that it causes issues with my cellphone, lol
<clever> once_upon_a_nixo: very, i was able to trivially spin up an extra 40 mirrors over a weekend
<clever> once_upon_a_nixo: i use nixos on all new installs i make, and all of the work systems
<clever> gchristensen: yeah, lol
<clever> all of them are in the same $PATH, and conflict
<clever> samueldr: it doesnt really, there is only 1 ruby directly accessible, 2.0
<clever> fixed the syntax errors
<clever> [clever@amd-nixos:~]$ nix-shell -p 'map (x: pkgs."ruby_${x}") [ "2_0" "2_1" "2_2" "2_3" "2_4" ]'
<clever> this would give you a shell that had every version of ruby at once, lol
<clever> [clever@amd-nixos:~]$ nix-shell -p 'map x: pkgs.ruby_${x} [ "2_0" "2_1" "2"2" "2_3" "2_4"]'
<clever> gchristensen: oh, wait no, that wont work right