2017-05-27

<clever> dash: i remember when you had to install winsock
<clever> teaching them how to use it and helping to maintain it is a whole other beast
<clever> yeah, installing it is one thing
<clever> so if you ever break it, shove the stick in and call, i can remotely wipe and reinstall
<clever> and i could also make a usb stick that boots directly into nixos, with my vpn and ssh key pre-configured
<clever> setup a vpn, and just remotely update it
<clever> boomshroom: one thing i have been thinking about, using nixops to manage nixos on machines for family members
<clever> dash: i found my dad driving a jeep on the front lawn one day, shining the headlights in the livingroom windows
<clever> dash: and i have yelled "get off the lawn"
<clever> dash: 30 years old :P
<clever> same, was kicked out in 2004, grade 11
<clever> i only really got into it in late highschool
<clever> lol
<clever> turns out, i left xorg up, with screensavers
<clever> i remember one day trying to figure out why my server cpu usage was all going to a weirdly named program, i think it was pipes
<clever> i think that had a 2.4 kernel
<clever> it was already out of date by then
<clever> tywkeene: well, i used redhat9 in 2004 :P
<clever> it now sits in storage and i just netflix it
<clever> i have the entire sg1 series on dvd
<clever> heh
<clever> stop making me feel old!
<clever> :O
<clever> i remember having to visit my uncle, because i didnt have the space channel
<clever> :D
<clever> line 37, it will use dd to wipe the old partition table and boot sector
<clever> :D
<clever> or run "justdoit" and let the script do it all
<clever> ssh back into it, and either do a normal install (fdisk, nixos-generate-config, nixos-install)
<clever> and within 2 minutes, its running nixos from a ramdisk
<clever> this collection of nix expressions will compile down to a ~250mb .tar file, upload it to any linux machine, unpack to /, and /kexec_nixos
<clever> tywkeene: another fun thing i did recently is this
<clever> as an added benefit, you cant forget to undo debug stuff and leave the system in a weird state
<clever> to test a fix out
<clever> or in the case of some scripts, cp /run/current-system/sw/bin/foo foo; chmod +w foo; $EDITOR foo ; ./foo
<clever> next time you boot or nixos-rebuild, that will be undone, and the symlink restored
<clever> for example, copy the contents of /etc/nix/nix.conf to a new file, delete the symlink, and rename the copy
<clever> in some cases, you can temporarily cheat by copying
<clever> and neither is writable
<clever> same contents in 2 different places, potentialy with different names
<clever> that does file-level dedup
<clever> so if 2 files have the same hash, they wind up hardlinked to eachother, via the .links/<hash>
<clever> tywkeene: it hardlinks every file in the nixstore to /nix/store/.links/<hash>
<clever> tywkeene: have you seen what nix-store --optimize does?
<clever> and a decade ago, i had a working tape drive that connected to the floppy drive ribbon
<clever> i think i have 2 or 3 scsi tape drives
<clever> only protection against a single failing drive
<clever> dash: no real backup plans for the nas or desktop
<clever> the desktop is a zfs mirror
<clever> my nas is a 3 drive raidz1 with nfs
<clever> and the hdd failed one day, but i luckily had a backup image
<clever> it was one massive imperative heap
<clever> i never once updated a single package on my LFS system
<clever> and this script handles the bulk of that
<clever> and stdenv.mkDerivation provides a default builder
<clever> 99.99% of the other arguments just pass on to the environment of the build, and bash scripts in the stdenv handle them
<clever> as a bare minimum, every derivation must have system, name, builder, and args set
<clever> here is an example derivation that doesnt use the stdenv
<clever> and if i pulled up the lfs docs, i could probably recreate it ontop of bare nix
<clever> i have looked at how the stdenv bootstrap works in nixpkgs
<clever> including the interpreter and libc
<clever> and LFS did fun things like building an entire toolchain based under /tools/
<clever> but the internals of linux you learn in LFS also apply to all of the edge-cases nix hits
<clever> the LFS system was mainly a toy to learn, and i stayed mainly gentoo after that
<clever> boomshroom: i used LFS as my router for several years
<clever> roughly in that order
<clever> i ran redhat9, ubuntu, gentoo, and LFS
<clever> heh
<clever> :)
<clever> ah yeah, nothing references it
<clever> and 125 can be nuked
<clever> that will override the config, and make it more reproducable
<clever> import nixpkgspath { config = {}; };
<clever> so root's overrides will randomly come and go
<clever> and line 4 might be a problem, if you import nixpkgs with {}, it will load config.nix from $HOME
<clever> isNormalUser auto-sets home
<clever> line 125 of the gist is also of no use
<clever> so yeah, just nuke that whole string
<clever> but thats probably not needed if you only have 1 card
<clever> BusId is the only part that could remain
<clever> 110 as well
<clever> and line 111 is a duplicate, 631 of xserver.nix already sets the driver
<clever> lines 109 and 113 have to be deleted
<clever> tywkeene: the .deviceSection string is inserted into an existing section "device" block
<clever> nixy: makewhatis isnt being ran, so that might be to blame
<clever> so you can gist -p /etc/nixos/configuration.nix /nix/store/foo-xorg.conf
<clever> there is a gist command in nix
<clever> are you able to ssh in from another machine?
<clever> can you gist the xorg.conf and the configuration.nix?
<clever> not sure then
<clever> tywkeene: what does "journalctl -u display-manager" say?
<clever> ah
<clever> tywkeene: are you manualy running startx?
<clever> at least in chromium
<clever> i have flash disabled and twitch works

2017-05-26

<clever> nix-channel --remove nixpkgs
<clever> by default, nixos only has 1 channel on it, called "nixos"
<clever> nixos must run one of the nixos-* channels
<clever> and also, dont use nixpkgs-unstable for nixos, that can brick the machine
<clever> nixos-rebuild uses nixos, nit nixpkgs
<clever> sophiag: report a bug to nixpkgs, and/or switch to nixos-unstable
<clever> Infinisil: the groups are only set when dropping from from root to your user
<clever> Infinisil: you need to logout and back in
<clever> so it can install versions that are backwards compatible with data on-disk
<clever> stateVersion tells nixos what version of nixos you originally installed
<clever> c: nothing in configuration.nix can influence what version of nixpkgs it downloads
<clever> b: stateVersion has no impact on what channel it downloads
<clever> a: stateVersion should never be changed
<clever> where in the config did you do that?
<clever> 17.03
<clever> sophiag: and also, 17.03 is a snapshot of the nixpkgs state from march, so changes from 3 days ago wont be in it
<clever> 17.09 doesnt exist
<clever> just a normal 404 from upstream deleting things on us
<clever> sophiag: so you need to find a mirror that still has 1.0.53.758, and prefetch-url that mirror
<clever> 1.0.55.487 vs 1.0.53.758
<clever> sophiag: on line 1, you gave it the url for version g256699aa-16_amd64, but on line 25, its asking for version gde3fc4b2-33_amd64
<clever> sophiag: can you gist the full output of nix-prefetch-url (and its command), and also the full error nixos-rebuild gives?
<clever> sophiag: after the nix-prefetch, try running "file" on the path it gives you, does the type look right?
<clever> sophiag: if the hash doesnt match up, nix will just try to download again
<clever> sophiag: you must prefetch the right file, with the exact hash nix is expecting
<clever> id have to check its source
<clever> i'm not sure what thats doing either
<clever> the with pkgs; on 80 may also spread to every part of the list
<clever> line 129 is core_extended
<clever> sophiag: the error is now pointing to ocalm-core-extended
<clever> what does the backtrace now say?
<clever> yeah, thats in that range
<clever> sophiag: line 133, i think the error said pa_test was failing
<clever> look at the wrapProgram code at the bottom
<clever> wrapProgram will rename things so you can only pass it 1 argument
<clever> output will become a bash script that runs input
<clever> player1_: makeWrapper needs 2 arguments, input and output file
<clever> sophiag: no idea about that one
<clever> sophiag: i have had ubuntu and gentoo do that before
<clever> sophiag: unlike things like ubuntu though, it wont break and leave you in a weird half-updated state
<clever> sophiag: nix-env has priority over systemPackages
<clever> sophiag: another option is to just nix-env -iA nixos.dropbox
<clever> sophiag: you could temporarily remove spotify from the systemPackages
<clever> or oracle changed the rules again
<clever> sophiag: read line 20-23 of the gist
<clever> sophiag: you need to go to the java website and download a given version
<clever> and my poor rpi has been working on gcc for 1h 33mins now, lol
<clever> LnL: already saw the email and opened the pr!
<clever> Drako365: it supports btrfs, ext4, zfs, and some others
<clever> emacs25PackagesNg now
<clever> nix-channel --add https://nixos.org/channels/nixos-17.03 nixos
<clever> sophiag: just run nix-channel --add to set nixos to 17.03
<clever> does --list say nixos is 17.09?
<clever> sophiag: once you update the channel to point nixos to 17.03, nixos-rebuild should work and get chrome
<clever> sophiag: ah, nixos uses the channel called nixos, which you still have set to 16.09
<clever> ekleog: find $(nix-store -qR ...)
<clever> sophiag: yeah
<clever> ekleog: oops, ^^^
<clever> equalunique: nix-store -qR /run/current-system/
<clever> sophiag: what does sudo nix-channel --list currently say?
<clever> sophiag: nixos-17.09 is able to build google-chrome on my end
<clever> ive got my git clone setup so i can test any channel easily
<clever> [clever@amd-nixos:~/apps/nixpkgs]$ git checkout channels/nixos-16.09
<clever> let me check the channels on this end
<clever> yeah, it looks like he was asking if he was on the latest 17.03
<clever> it can also be fixed by just finding that exact version of another mirror and running nix-prefetch-url on it
<clever> but 16.09 is also starting to get old, maybe you should update to 17.03?
<clever> ah, they probably didnt fix 16.09
<clever> ah, an issue is already open: https://github.com/NixOS/nixpkgs/issues/25880
<clever> which channel are you on?
<clever> sophiag: the full one, there may be more info above that
<clever> sophiag: what was the old error?
<clever> equalunique: i also recently made a script to fully automate it an install: https://github.com/cleverca22/nix-tests/blob/master/kexec/justdoit.nix#L33
<clever> yeah
<clever> though i'm on chromium
<clever> i run chrome and havent had any issues like that
<clever> yep
<clever> if you can find it anywhere, you can run nix-prefetch-url on it
<clever> sophiag: nixos-rebuild is atomic, it either updates everything, or it updates nothing
<clever> player1_: wrapProgram can prefix $PATH with things, there should be tons of examples in nixpkgs
<clever> and you may need to pass those on, or run terra inside nix to set them again
<clever> nix sets up a $NIX_CFLAGS_COMPILE that has right right -I flags
<clever> ah
<clever> player1_: did you try clangStdenv.mkDerivation?
<clever> but its configured to reboot at the end of every hour, so if you get the network wrong, it returns control to the original OS
<clever> hardest part is guessing what systemd will name the main NIC
<clever> and if they dont offer dhcp, you have to configure the correct ip in the nixos config files (2 places, configuration.nix and target-config.nix)
<clever> but it could be changed to also support EFI
<clever> yeah, it only works on machines where you can change the kernel,and the host boots via the legacy MBR sector
<clever> danbst: it uses kexec to forcibly take over the cpu
<clever> so in about 6 shell commands, you can turn any remote linux server into a nixos machine
<clever> just yesterday, i redid this kexec trick, so it can fully automate the install
<clever> ekleog: upgrade.patch will add an option for that in nix.conf
<clever> ekleog: but you also need to force nix to run elf files for the "wrong" arch
<clever> ekleog: it will take every syscall, and translate it to suit the host kernel
<clever> ekleog: yeah
<clever> LnL: yeah, just enable the right 32bit compat thing in the kernel
<clever> it lets an x86 machine run arm binaries, without emulating the entire arm os
<clever> ekleog: i sometimes use qemu-user to boost my build times
<clever> so you can cover all the platforms
<clever> the rpi3 is also able to run v6, v7, and aarch64
<clever> LnL: the rpi3 has built in wifi
<clever> only 1 derivation at a time
<clever> yeah
<clever> correction, its still unpacking the gcc source, has been for the last 7 minutes!
<clever> ekleog: http://hydra.earthtools.ca/machines its currently building gcc
<clever> ekleog: but i now have a single v7 running rasbian as the hydra slave
<clever> ekleog: when i was running the v6's, i had them registered as build slaves in my hydra
<clever> oops, wrong e name
<clever> elasticdog: you could just dd it to the right partition
<clever> raw ext4, no partition table, and it needs a /boot on the SD card
<clever> /media/videos/4tb/drives/rpi-iscsi/nix2.img: UUID="03a9d037-3155-43c7-9a4c-c02f7eba0273" TYPE="ext4"
<clever> ekleog: yep, found the disk image
<clever> 32G -rw-r--r-- 1 root root 32G Aug 13 2016 /media/videos/4tb/drives/rpi-iscsi/nix2.img
<clever> ekleog: i never got around to switching the v7 to proper nixos, its rasbian with nix on the side
<clever> ekleog: i did have full nixos on the v6's, with an iscsi root, so i can access the disk image at any time
<clever> glibc for v6 took 47 minutes, gettext took 25mins
<clever> the nixpkgs release i have only does v7
<clever> only a few things are configured to do v6
<clever> but v6 itself isnt really that much slower, when on v7 capable hardware
<clever> yeah, twice the time, because it has to do everything again
<clever> LnL: ah, and i see that mass-rebuild, it just started gcc
<clever> both on the exact same machine
<clever> LnL: 17m9s to build nix on v6, and 16m48s to build nix on v7
<clever> LnL: the rpi1 is v6 only and was so slow i just turned it off
<clever> LnL: the rpi2 and rpi3 are backwards compatible to v6
<clever> elasticdog: the runtime error should have a backtrace pointing to it
<clever> elasticdog: and just patch that to use an absolute path to the so?
<clever> elasticdog: yeah, thats tricky in the python stuff, can you find where in the python its trying to open the library?
<clever> disasm: i think it was marked as broken because it had errors at runtime
<clever> elasticdog: yeah
<clever> and it appears to be in 2 different derivations
<clever> kerberos.out 0 s /nix/store/1lcj3bwfpfy0bi5qmnbw66xz8lg7639d-libkrb5-1.15/lib/libgssapi_krb5.so
<clever> or have an absolute path pathed into the python source
<clever> elasticdog: that does exist, it just needs the right LD_LIBRARY_PATH when python does get ran
<clever> krb5Full.out 0 s /nix/store/vcamvm7mcypf16y594dsdfas2gkblhnr-krb5-1.15/lib/libgssapi_krb5.so
<clever> disasm: nixpkgs.config.virtualbox.enableExtensionPack = true;
<clever> or mkForce to replace the default list entirely
<clever> kykim: swap this to before or first i think, and double-check the resulting nix.conf it generates
<clever> extraCommands = lib.mkMerge [ (lib.mkAfter ''
<clever> kykim: i think either mkOrder or mkFirst
<clever> but with aws, its easy enough to delete, and spawn a new one from the AMI
<clever> just beware that the custom configuration.nix may brick the machine
<clever> you can either write your own configuration.nix from scratch (nixos-generate-config can help) or switch to nixops
<clever> kykim: the ami is normally used with nixops, which will upload a pre-built nixos using nix-copy-closure
<clever> and if there is a common dep, each derivation will re-make it internally
<clever> but yeah, you still need something to dynamicaly generate the list
<clever> let f = target: stdenv.mkDerivation { buildInputs = [ cmake ]; makeFlags = [ target ]; };
<clever> ah
<clever> debug = f "debug";
<clever> let f = target: stdenv.mkDerivation { buildInputs = [ cmake ]; cmakeFlags = [ "-DTARGET=${target}" ]; };
<clever> and then call that 5 times
<clever> maybe, make a nix function that takes a target name, sets the right env variable, and returns a derivation
<clever> ssh back in, and run justdoit, and your install is done
<clever> and within ~2 minutes, it will be running nixos from a ramdisk
<clever> then ssh in, unpack it to /, and run /kexec_nixos
<clever> so you can now use nix-build to generate a .tar file, upload that to any linux server in any datacenter
<clever> gchristensen, sphalerite: i also updated my kexec stuff, it can now do the entire nixos install in 1 command
<clever> sphalerite: and line 518 stops it
<clever> sphalerite: i think one of these is responsible for that
<clever> ah
<clever> because this is the script that passes the nixos config to grub
<clever> doing it in here may also work
<clever> sphalerite: at this point, you would need to remove the 1 at the end, and your done
<clever> /dev/sdb1
<clever> [root@amd-nixos:~]# realpath /dev/disk/by-partuuid/ad3e9290-ae0f-4953-b67b-1dfdeebed926
<clever> lrwxrwxrwx 1 root root 10 May 21 01:34 /dev/disk/by-partuuid/ad3e9290-ae0f-4953-b67b-1dfdeebed926 -> ../../sdb1
<clever> /dev/sdb1: PARTLABEL="bios boot" PARTUUID="ad3e9290-ae0f-4953-b67b-1dfdeebed926"
<clever> [root@amd-nixos:~]# blkid /dev/sdb1
<clever> /dev/sdb1 2048 67583 65536 32M BIOS boot
<clever> ah
<clever> do you want it to be able to support persistant nixos-rebuild?
<clever> the nixos installer iso can already do that
<clever> so it can never update the mbr, but it will still boot
<clever> sphalerite: in those cases, i usualy set grub.device to "nodev" after the mbr has been "flashed"
<clever> though the gpt trick i was thinking of is also missing
<clever> and yeah, finding out if its /dev/sda or /dev/sdb is one reason i dont like mbr
<clever> if your creating the image, then you should know ahead of if its mbr or gpt
<clever> thats exactly what patchelf is for
<clever> a chroot is almost never what you want
<clever> guillaum2: you would write a nix expression, that computes the correct paths
<clever> yeah, forgot to mention the audio group
<clever> one of the outputs is probably on mute
<clever> tanonym: check alsamixer
<clever> the switch action can apply most changes without a reboot
<clever> and has never been defaulting to false
<clever> hardware.sound.enable was created before 2013, and was defaulting to true even then
<clever> (facepalm)
<clever> what error does it throw?