<clever>
alphor: main limitation with that method is that you cant nixos-rebuild switch, just shutdown and re-run nix-build, then boot it back up
<clever>
alphor: ive used this on both nixos and gentoo systems to test a basic nixos configuration out without having to setup a proper vm
<clever>
alphor: this will build a bash script that runs a build of nixos under qemu
<clever>
alphor: nix-build '<nixpkgs/nixos>' -A vm -I nixos-config=./configuration.nix
<clever>
alphor: another fun thing you can do on any distro
<clever>
so it depends on preference somewhat
<clever>
full nixos has a bit of a steeper learning curve and forces you to learn everything at once, while nix on debian lets you cheat and just apt-get things and learn the right way later
<clever>
and configures some base stuff like an ssh pubkey, so you can get back into the box
<clever>
my kexec script takes the kernel+initrd from a netboot module in nixos, and just runs it via kexec instead
<clever>
it is now running entirely from ram, so you can repartition the disk however you want
<clever>
so you can basicaly boot the installer CD, without any usb stick or cd drive
<clever>
MichaelRaskin: and if you run that, it will kexec the host into that kernel, which includes a full nixos inside the initrd
<clever>
MichaelRaskin: if you build this, you get a bash script that references a kernel+initrd
<clever>
MichaelRaskin: i have also messed with kexec some, one sec
<clever>
MichaelRaskin: yeah, it depends on what your goals are
<clever>
MichaelRaskin: and in 2 cases, i just ran ./result/bin/switch-to-configuration boot to force nixos to overwrite the gentoo MBR and take over the same rootfs
<clever>
and you typicaly have +w to the directory named after your user
<clever>
sheenobu: so the profiles are all kept in an area where the GC finds roots
<clever>
sheenobu: thats why i used -p /nix/var/nix/profiles/per-user/root/rpi3-netboot in my netboot setup
<clever>
sheenobu: nix-env handles that by symlinking ~/.nix-profile to the name of the profile under /nix/var/nix/profiles/
<clever>
sheenobu: oh right, and if you dont keep the generations in an area like /nix/var/nix/profiles/, they might get eaten by garbage collection
2017-01-11
<clever>
id think it can only be done if the git repo is on github
<clever>
similar rules also apply if you -A foo, but it returned { foo.bar = derivation; }
<clever>
yeah, if the default.nix returns a single derivation, or an attrset containing primites, and one derivation, it just picks the derivation directly
<clever>
sheenobu: that will build the an_attribute attr from the given default.nix, and then use the result as the root of the generation
<clever>
sheenobu: nix-env -p $HOME/.nix-home -f /path/to/something/default.nix -A an_attribute --set
<clever>
pxc: the xeon router is also running a full hydra install, but i have had issues where the UPS barely lasts 10minutes, then i loose all internet
<clever>
pxc: and my internet speeds go way over 100mbit
<clever>
pxc: all of my current arm machines are 100mbit ethernet, running over usb
<clever>
model name : Intel(R) Xeon(TM) CPU 3.20GHz
<clever>
pxc: a random server that came out of a rack, dual-socket motherboard, 3gig of ecc ram, 3 gigabit ethernet ports
<clever>
pxc: yep
<clever>
sheenobu: nixos-rebuild also uses --set in the same way
<clever>
sheenobu: it will entirely replace the contents
<clever>
sheenobu: and in my case, i'm using --set, so nix-env will never use buildEnv to imperatively merge the new stuff with the old generation
<clever>
sheenobu: i recently also used nix-env for network boot images, one min
<clever>
yeah
<clever>
deleting a generation after rollback would prevent that
<clever>
once for each time i --update'd and --rollback'd in the past
<clever>
sheenobu: i ran into this issue on my router, nix-channel --update has broken it a few times, and now i have to --rollback 3 or 4 times to undo a single --update
<clever>
so rollback goes to the generation before the current, not the one it was just on
<clever>
pxc: but if i then do a second update+rollback, it creates 6, then switches back to 5
<clever>
pxc: one issue i have found, is that if say i'm generation #4, and i do an update+rollback, i create a 5, then switch back to 4
<clever>
gchristensen: Bisecting: 17291 revisions left to test after this (roughly 14 steps)
<clever>
they also have bad ram
<clever>
then on a random guess, i memtest'd 2 laptops
<clever>
i put the nas ram back into the nas, and ran memtest, still toast
<clever>
still bad!
<clever>
so i put the 16gig of ram and the ssd's into the nas, and ram memtest
<clever>
motherboard maybe?
<clever>
i stole the ram from my NAS, thats also bad!
<clever>
i swapped the sticks around to try and figure out which was good and bad, it said both where toast
<clever>
gchristensen: memtest86 said the ram in my desktop was bad
<clever>
gchristensen: guess what i spent 6 hours on last night? lol
<clever>
lambdame: your supposed to just use "nix-shell -p gcc"
<clever>
things like binutils and gcc aremt meant to be installed on nixos
2017-01-10
<clever>
leothrix: i believe you want systemd.services.foo.serviceConfig.ExecStart = lib.mkForce "bar"; if you want to bypass nixos's attempt at merging multiple definitions
<clever>
jp302: use pkgs.fetchurl
<clever>
sphalerite: and if xsession exists, all control is transfered to that and this script stops being an issue
<clever>
sphalerite: because xprofile gets sourced and the script continues, the user can inject variables into this context, and alter how the script behaves
<clever>
sphalerite: you can also use xprofile (line 98) or xsession (line 103) to imperatively override things for testing
<clever>
sphalerite: and 128-134 is about where it runs it
<clever>
sphalerite: line 112-115 is where it decides between the default, and the one chosen in the display manager
2017-01-09
<clever>
sphalerite: this script gets ran by the display manager after it has set the uid correctly, and it is ready to launch the chosen desktop manager
<clever>
guacamole_: if you have enough ram to dedicate to each guest, yeah
<clever>
bluetooth or usb otg can solve that
<clever>
surprisingly useable, though the keyboard can be an issue
<clever>
yep
<clever>
often, its been easyer to just run the android app on a cellphone
<clever>
i have to vnc into a windows 7 vm running under xen, with vnc running over a custom vpn
<clever>
same
<clever>
guacamole_: and the new version lacks a connect button!
<clever>
guacamole_: yeah, teamviewer has been very bad at this, i fixed teamviewer client on nixos a few months ago, then they updated it, old version stops working entirely (not permited)
<clever>
guacamole_: one tip, nix doesnt delete the invalid .tar.gz file, so you can just open it in less and see whats going on
<clever>
guacamole_: half of the time, that changing hash is caused by a 404 page with the current time in it
2017-01-08
<clever>
ToxicFrog: and i'm over in NB
<clever>
living room: 17.56c(63.61f), outdoor: -12.25c(9.95f), server: 21.38c(70.47f)
2017-01-07
<clever>
and now python is a dep, that never appears in the users profile
<clever>
so it knows exactly which build of python to use
<clever>
eacameron: which is why its recomended to always do #!/nix/store/foo-python-2.6/bin/python
<clever>
a storepath can never exist without its deps
<clever>
nix-store -r downloads all dependencies
<clever>
eacameron: just skip nix-shell, since you know you only need the bin in path
<clever>
eacameron: it might be simpler to just prepend /nix/store/foo/bin to $PATH then
<clever>
that downloads without putting it into your profile
<clever>
try with nix-store -r instead
<clever>
though it probably wont download then, nix-store -r /nix/store/foo first to dl
<clever>
so maybe nix-shell -p '"/nix/store/foo"'
<clever>
eacameron: the arguments to -p just wind up inside the buildInputs array of a nix expression
<clever>
eacameron: hmmm, not sure, maybe if you quote it weirdly
2017-01-06
<clever>
that*
<clever>
but if thay support was extended to nix itself, you could then add a 2nd file, not managed by nix, and go nuts
<clever>
currently, only hydra supports a : seperated list in NIX_REMOTE_SYSTEMS
<clever>
and i could just plug another 20 in without having to touch any config
<clever>
then hydra will dynamicaly gain/loose slaves as they turn on/off
<clever>
and if one of them stops responding, remove it
<clever>
copumpkin: i was planning on having a daemon within my hydra box, that would listen for new rpi's booting up, and add them to machines.provisioned
<clever>
copumpkin: hydra supports a : seperated list of /etc/nix/machines files (the config option is better in more recent modules)
<clever>
but then you need some way to update the files remotely, or use your vm framework
<clever>
copumpkin: you could skip a lot of the network stuff, and just have a /boot folder with grub, kernel, and initrd
<clever>
but ive since branched out and just added random ideas to it, while keeping it minimal
<clever>
and they would be operating potentialy without internet access
<clever>
copumpkin: was originaly making this for a system that had ~8 servers working together as a unit, and i was thinking that 1 of them could serve the other 7
<clever>
copumpkin: and lines 66-73 are the default script embeded into the binary, it cant change as easily, but it just fetches a bigger script, which must be signed
<clever>
copumpkin: line 80 of ipxe.nix makes a special build of ipxe, that embeds the public certs into it, along with a default script, so it doesnt run untrusted code by default
<clever>
the requester (hydra) will send over a build of curl/git for the target machine, and then that does the download
<clever>
copumpkin: like 56-62 handles signing the files, but that cant safely be done inside nix-build, since the private key is now in /nix/store
<clever>
and ipxe has support to dynamicaly append to the initrd for you
<clever>
copumpkin: this downloads the kernel, initrd, and rootfs over tftp, then verifies signatures on each, public/private keypair crypto
<clever>
copumpkin: when embeded, it will take a lot longer for it to download the initrd and even start linux, but it can just boot without an extra step in the initrd
<clever>
copumpkin: but you can also embed the root image into the squashfs
<clever>
copumpkin: the rpi them tftp'd its firmware from this dir, then the kernel+initrd, and booted
<clever>
copumpkin: this command was building the entire not-os image, including the raspberry pi firmware, and sticking it in a directory named after the rpi serial#
<clever>
[root@router:/tftproot/try2]# time nix-build -j4 not-os/release.nix -A rpi_image -o ../9080d9b6 --show-trace -I nixpkgs=/tftproot/try2/nixpkgs/ && ls -ltrhL ../9080d9b6/
<clever>
copumpkin: let me grab the command i was using for testing a few weeks ago
<clever>
only issue is the purity problems in darwin, how it needs some things in /System that arent open i think
<clever>
copumpkin: a similar design on the xnu kernel would massively help expand the darwin build farm
<clever>
i would just do "git checkout" in the nixpkgs dir as normal, and then switch it back to master when your done
<clever>
so now the state i .git os "corrupt", and your lacking the files that matched up
<clever>
sphalerite: ah, i think i know what happened, 'git checkout' knows what the state of files is (via .git state), and only checked out files that differ between the current state, and nixos-unstable
<clever>
there are 2 branches with the same name, and different uses
<clever>
also, you want the nixos-unstable branch of nixpkgs-channels, not from nixpkgs
<clever>
sounds like it didnt get everything
<clever>
i saw an issue with some talk on it, cant remember which one it was
<clever>
what files did it make?
<clever>
with -I nixpkgs will cover both lines 5 and 6 at once, so you cant miss one of them
<clever>
or build it with -I nixpkgs=/path/to/nixos-unstable
<clever>
sphalerite: you can always switch nix-channel back to release after it netboots, if you wish to install release into the target machine
<clever>
sphalerite: i fixed the store being read-only, but that fix has only made it into nixos-unstable
<clever>
sphalerite: are you using nixos release or unstable?
<clever>
all 916 of those where normal chrome tabs just 10mins ago
<clever>
and swap usage is down to 16%
<clever>
916, down to just 2 open windows
<clever>
817...
<clever>
"one tab" has now converted 694 normal chrome tabs over
<clever>
yes
<clever>
600
<clever>
its up to 577 now
<clever>
thats about half of them
<clever>
eacameron: and now that it has stabalized, i have moved 443 tabs into the "one tab"
<clever>
its a part of nix, that applies even if your not using nixos or nixpkgs