2017-05-20

<clever> that casts a string to a path i think
<clever> and $out's hash depends on the path to those commands (the shell)
<clever> so it has to use a normal "run these commands" derivation to "compile" the file
<clever> its more of an issue that nix has no write-file primitive
<clever> so when the aarch64 does its own native build, it has a different path, and has to rebuild everything that depends on the text file
<clever> ben: but then the $out path wont be the same
<clever> ben: in theory, you can mess with things to always use the hostPkgs.runCommand in here, so it wont try to cross-compile the textfile
<clever> ben: the writeTextFile derivation uses the shell from the target platform to run echo
<clever> johnramsden: then it will overwrite file1.conf every time you open a shell, updating it to what the last nixos-rebuild made
<clever> johnramsden: butif you do something like environment.interactiveShellInit = "cp -vi ${file1} ~/.config/foo/bar/file1.conf";
<clever> johnramsden: because the language is evaluated lazily
<clever> johnramsden: if you dont assign the result of the map to anything, nix will not even run it
<clever> johnramsden: so you could put a command that writes to $HOME/.config/ in the spots where i set B thru F
<clever> johnramsden: here are examples i made for every form of setting env variables (some are just scripts that set vars) https://gist.github.com/cleverca22/282c960da95dd23b72150ca36ef3ff50
<clever> johnramsden: then writes things wherever it wants
<clever> johnramsden: the closest you can do, is make a script that lands in /etc/profile, and runs upon login
<clever> johnramsden: and then the function returns the /nix/store/<hash>-<name> part
<clever> johnramsden: so it will leave files at locations like /nix/store/<hash>-<name>/home/user/.config/libvirt/qemu.conf
<clever> johnramsden: it will write all of those paths into /nix/store
<clever> johnramsden: what do you want to do with environment_user?
<clever> yeah
<clever> ben: so you can set "build-extra-platforms = aarch64-linux" in /etc/nix/nix.conf, and nix will try to run aarch64 programs
<clever> ben: then using the patched nix on line 10 as an override of nix on the host (so it replaces nix-daemon), will add a new build-extra-platforms option
<clever> ben: if you run the register script inside the arm64 package, then linux will be able to just run aarch64 binaries
<clever> ben: one option is the qemu stuff i wrote a while ago
<clever> which it will ssh into and push all the dependencies to
<clever> it wants an aarch64 build slave in /etc/nix/machines
<clever> ah
<clever> ben: what are the 2 platforms its censoring out?
<clever> so the first person to pickup the phone cant just plug in and steal your files, without being able to unlock the phone
<clever> i'm guessing you need to approve the desktop in the iphone ui?
<clever> [20:30:03.611][4] preflight_worker_handle_device_add: Device 5bdd7301098fd52c91a76a4c4ea1496134730707 is not paired with this host.
<clever> [20:30:03.604][1] preflight_worker_handle_device_add: The stored pair record for device 5bdd7301098fd52c91a76a4c4ea1496134730707 is invalid. Removing.
<clever> thats different then
<clever> oh, even root
<clever> jbo: under nixos, normal users lack access to usb nodes by default
<clever> in the case of this device, it maps to that exact node, which isnt writable by me
<clever> crw-rw-r-- 1 root root 189, 134 May 19 19:10 /dev/bus/usb/002/007
<clever> Bus 002 Device 007: ID 046d:0a1f Logitech, Inc. G930
<clever> libusb*
<clever> if its using libfuse, then it must have permission to the /dev/bus/usb/ nodes
<clever> ah
<clever> not sure about iphone
<clever> android uses mtp, to provide a fs level access, rather then a block level access
<clever> and they generaly cheat and use 1 partition, so the whole thing would have to shutdown
<clever> modern phones cant appear as block devices, because that would require the phone to un-mount the fs first
<clever> then it would rely on an interactive bash being in the $PATH at runtime, which is pretty much always there
<clever> anything your output references when its done installing, becomes a runtime dep
<clever> nix doesnt have a way to list runtime dependencies, only build-time dependencies
<clever> nixy: if your using "#!/usr/bin/env bash", and bashInteractive comes first in $PATH, it should
<clever> ah
<clever> if you have another hdd for the mbr
<clever> another option, is to just chainload the nixos grub from the other grub
<clever> and tries to load modules that arent compatible with the grub core
<clever> it changes the module search path
<clever> but if you pre-load the gentoo versions, it worked fine
<clever> ive found that the gentoo grub cant load the nixos grub modules
<clever> if your using a different grub, you may want to run insmod on everything nixos uses, before you source the nixos grub.cfg
<clever> ah
<clever> that sounds safer
<clever> trikl: i think if you rename unicode.pf2 and background.png, it will stay in plaintext mode
<clever> but i always do ext4 for /boot if zfs is at play
<clever> i dont know what grub does in that situation
<clever> but some filesystems like zfs hash the crap out of the data, and wont like that
<clever> so it can write to it in-place, without having to touch the FS metadata
<clever> so it generaly pre-allocates a lot of space in the grubenv file
<clever> write support for filesystems in grub is a bit limited
<clever> looks normal
<clever> whats in it?
<clever> its a file in either /boot or /boot/grub/
<clever> does grubenv exist?
<clever> trikl: what error does it give if you just leave it to the default?
<clever> trikl: the commandlines look identical
<clever> trikl: can you gist the grub.cfg file?
<clever> trikl: i think you would need to modify the perl script that generates grub.cfg
<clever> (but -A is already claimed in nix)
<clever> similiar to ssh -A
<clever> but if the issue i opened on nix gets solved, then you could run nix-build with the right flag, and it just works
<clever> yeah, i usualy do that instead
<clever> that allows fetchgitPrivate to access the ssh agent
<clever> the private key is a seperate part, finding that link
<clever> /etc/ssh/ssh_known_hosts
<clever> nixy: ah, then you would need to manualy do the same thing, under /etc/ssh/
<clever> nixy: and this appears to be a dup of an issue i already posted a full answer on
<clever> nixy: you can configure the knownHosts system wide in nixos
<clever> nixy: are you loading it with callPackage?
<clever> Infinisil: i have been thinking about looking into do again myself
<clever> Infinisil: line 1 also implies its looking for an FS with the label DOROOT
<clever> Infinisil: try symlinking /boot/grub.cfg to point to /boot/grub/grub.cfg ?
<clever> :(
<clever> Infinisil: what error does it have on boot?
<clever> ext4 would be safer against improper shutdowns, but rule out efi
<clever> vfat should work either way
<clever> vda1 will be your /boot
<clever> looks good
<clever> but gpt uses more then just 1 sector, and thats an ugly hack to begin with
<clever> with the old mbr style, grub just put it into 'unused' space between sector 0 and partition 0
<clever> if anything is done to that partition after a grub-install, the hdd will cease to be bootable
<clever> Infinisil: grub uses the bios boot partition to store raw x86 executable code
<clever> the boot partition cant be in the zfs pool

2017-05-19

<clever> that is seperate from /boot
<clever> the bios boot partition must not be formated or mounted
<clever> what does this say about vda15?
<clever> fdisk -l /dev/vda
<clever> another common problem is not putting the /boot config into configuration.nix's fileSystems."/boot"
<clever> mount /dev/sdXY /mnt/boot
<clever> yeah
<clever> was /boot mounted to /mnt/boot/ when installing grub?
<clever> ah
<clever> this is how i setup some of the filesystems on my machine
<clever> "/nix" = { device = "amd/nix"; fsType = "zfs"; options = [ "noatime" ]; };
<clever> "/" = { device = "amd/root"; fsType = "zfs"; };
<clever> Infinisil: device should be in the form of pool/fs
<clever> Infinisil: yep
<clever> i would expect overrideAttrs to work, but the buildPythonPackage stuff may be messing with that
<clever> henrycrutcher: too many files missing from the gist, cant recreate the problem here
<clever> error: ipython-6.0.0 not supported for interpreter python2.7
<clever> henrycrutcher: can probably do it on line 4
<clever> i only fixed the let blocks
<clever> oh, i forgot to fix the list part
<clever> you can also join most of those let blocks
<clever> need to wrap it in another ()
<clever> [ f x ] doesnt run f on x, it makes a list of f, and x
<clever> this is a list with 2 functions in it
<clever> [ ... jedi.overrideAttrs( oldAttrs: rec { doCheck = false; }) ... ]
<clever> oh, found your problem
<clever> and what line does it say the error is on?, if you run it with --show-trace
<clever> can you gist the default.nix?
<clever> henrycrutcher: what are you trying to run?
<clever> yeah
<clever> and nix-build will allow them to leak into the build
<clever> impureEnvVars is an array of strings (variable names)
<clever> 1, you can use .overrideAttrs on something, 2, it only works on fixed-output derivations
<clever> currently only using the automatic snapshot creation in nixos, with no send/recv
<clever> so its much safer to have an ext4 /boot for the kernls
<clever> grub has trouble reading the kernel from certain zfs directories
<clever> some of it is in /boot/grub/, but some is in raw binary on the hdd
<clever> what kind of info do you want?
<clever> Infinisil: grub on gpt needs a bios boot partition
<clever> Infinisil: and then the grub kernel you pick in the DO control panel will read grub.cfg
<clever> Infinisil: if i'm reading disasm's link right, you can configure grub2 in nixos, probably with boot.loader.grub.device="nodev";, and nixos will generate a /boot/grub/grub.cfg
<clever> disasm: looks like grub2 i think
<clever> disasm: is that grub1 or grub2?
<clever> how much data do you want to save, and where do you want the final install to be located?
<clever> the bios has to be told to look there
<clever> Infinisil: but also, the nice thing about nixos, you dont really need to keep much, you could just copy configuration.nix and remake the system in minutes
<clever> Infinisil: if you want to keep the data, then you would copy it over to the zfs pool first
<clever> uefi needs vfat
<clever> depends on if your using legacy or uefi
<clever> and if you aim boot.loader.grub.device to the root of that new hdd, it will be bootable
<clever> i would make a dedicated ext4 for /boot/ to handle the boot issues ive seen
<clever> shlevy: yeah, ive been wanting to patch nix-build to add agent forwarding
<clever> shlevy: it should also be possible to do private githubs with an ssh-agent
<clever> Infinisil: then fix hardware-configuration.nix/configuration.nix, and nixos-rebuild boot
<clever> Infinisil: then you can mount the new zfs filesystems up under /mnt/, and "nixos-install --chroot" to get a shell inside it
<clever> Infinisil: if you have enough free space in the zfs pool to hold the entire fs, you should be able to just copy the data over while booted into an install iso
<clever> LnL: ah yeah, ive done that before as well, --arg config '{}' will make most nix commands ignore config.nix
<clever> [ "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7l-linux" ....
<clever> nix-repl> nix.meta.platforms
<clever> [clever@amd-nixos:~/apps/nixpkgs]$ nix-repl default.nix
<clever> LnL: works fine in nix-repl
<clever> Infinisil: yeah, i use zfs on every new install
<clever> 18255 nixUnstable;
<clever> 18253 nix
<clever> 18249 inherit (callPackages ../tools/package-management/nix {
<clever> there is an inherit in all-packages.nix
<clever> LnL: ah, the pkgs.nix attribute?
<clever> but with tmp on tmpfs, your going to get that anyways
<clever> but there will be some performance loss if /tmp and /nix/store are on different volumes
<clever> koserge: when using zfs, i always put /nix/store on its own volume
<clever> overrideDerivation happens after it
<clever> overrideAttrs happens before all of that, so the attributes are still where you expect them to be
<clever> stdenv.mkDerivation does a lot of funky stuff like renaming buildInputs to nativeBuildInputs
<clever> its like they expect you to only ever use the internet
<clever> so ssh and nfs are imposible
<clever> the 2nd n band router refuses to let wifi clients talk to wired clients
<clever> the first one refused to stop sending ipv6 ra packets, and blackholes all ipv6 traffic
<clever> ive had very bad luck with all the N band routers ive tried
<clever> i barely get 30mbit out of my current wifi
<clever> gchristensen: nice
<clever> i always -Q when using -j, to make it more readable
<clever> yeah
<clever> either you tried to manualy write to $out from nix-shell, or the package is somehow broken
<clever> it needs root to modify things vital to the system, so just never use sudo, and your safe
<clever> also, if you run the above commands without root, it cant brick the machine
<clever> there was a bug about 6 months ago that corrupted grub.cfg
<clever> just beware that booting master may cause other unrelated problems
<clever> Infinisil: yeah
<clever> yeah, it wont clear the search path
<clever> adelbertc: nix-env -f all-packages.nix -iA dev
<clever> Infinisil: the above nix-build can also be used to just build it
<clever> then run the vm and test it out
<clever> in there, you can enable the service, and create a user with a pre-set password
<clever> this will build a qemu vm, using a given configuration.nix file (in the current dir)
<clever> nix-build nixos -A vm -I nixos-config=./configuration.nix
<clever> services are harder to test, is it a new or old service?
<clever> ah
<clever> use -A to direct it towards the package you have changed
<clever> "nix-build -A hello" will build just the hello-world package
<clever> including everything that has been flagged as broken
<clever> just 'nix-build' alone in the nixpkgs root, means build EVERYTHING in nixpkgs!
<clever> ah, that explains it
<clever> Infinisil: what exact arguments did you run nix-build with?
<clever> Infinisil: did you give nix-build a -A flag?
<clever> Infinisil: so you need to --show-trace, and find the usage of pkgs.activator, and remove it
<clever> ah, the pkgs.activator attribute is directly set to a throw statement
<clever> and mkRootLayer fires up an entire vm
<clever> looks like mkPureLayer is just rsync + tar
<clever> Infinisil: what exactly is the error coming from?, can you gist the entire output?
<clever> i'm still curious as to what its doing differently
<clever> ah
<clever> Infinisil: running nix-build in the root of nixpkgs?
<clever> and if its not null, mkRootLayer
<clever> if its null, it will call mkPureLayer
<clever> it can often help to read the nix expressions behind something to learn how it works
<clever> exarkun: and that needs /dev/kvm setup correctly to get any kind of performance
<clever> exarkun: manipulating filesystem level stuff as root needs a qemu vm on nix
<clever> but its been like this for months
<clever> its almost like some 3 letter agency is mitm'ing me poorly
<clever> why does it give me a different cert:S
<clever> strange, exact same ip i have
<clever> oh, and 4/5 are a bit funky, because i need to also do 802.1q
<clever> line 5&6 of the gist defines which card is each
<clever> one port for the modem, one port for a normal switch that handles the lan
<clever> the machine i'm using happens to have 3 gigabit ports, but i'm only using 2
<clever> yeah
<clever> main requirement, is that you have a computer with 2 nics, that can match the speed of your internet
<clever> almost directly connected to the modem
<clever> that file as a whole, runs my router
<clever> and also handles 2 custom domains, for .localnet
<clever> this runs a dns cache in nixos, and allows 192.168.2.0/24 to use it
<clever> i just run my own dns
<clever> it could be that only the dns server is fubar, and everything else is fine
<clever> strange, maybe your dns server is acting up?
<clever> dns only takes a domain
<clever> [clever@amd-nixos:~]$ dig www.racklodge.com
<clever> run dig or ping on it in a shell
<clever> oh, and what ip does it resolve to?
<clever> and its not expired?
<clever> for me, it was signed by geotrust, and it expired on oct 7th, 2016
<clever> https://www.racklodge.com/ who is the CA for you?
<clever> i think the load balancer is broken, and masking the problem
<clever> and the funny thing is, they use a different cert depending on where you connect from
<clever> it could be worse, one of the datacenters i use has an expired ssl cert on the front page!
<clever> lol
<clever> ah
<clever> what is the name of the program?
<clever> Infinisil: (facepalm)
<clever> Infinisil: is there at least a .deb available?, or did some idiot imperatively install the entire thing, then clone the vm en-mass? lol
<clever> what error comes up when you dont use 6?
<clever> and java7 isnt backwards compat?
<clever> did you check openjdk?
<clever> Infinisil: package those deps and show them!
<clever> for the last 2 lines, if the video seems to work fine for you, you can probably ignore it
<clever> yeah, if you dont care about bluetooth audio, you can ignore the first half
<clever> rhon: what kind of warnings?
<clever> justanotheruser: it looks like you put an attrset in your systemPackages
<clever> justanotheruser: i see system-path near the bottom

2017-05-18

<clever> disasm: add an "exit 1" to one of the phases
<clever> it will just hide the old tmp with a tmpfs
<clever> but you will want to clean it out manualy before you turn it on
<clever> trikl: it appears to be false right now
<clever> the default of that nixos option has changed at some point
<clever> rebooted*
<clever> the hdd was damn slow, and i left a mess in there and rarely booted
<clever> gchristensen: i have had issues a decade ago, when my server would take half an hour to boot, because it cleaned /tmp on startup
<clever> so the wifi part is completely stock
<clever> joniWoni: oh, and in my case, i'm using an old-ass router (with the dhcp turned off) to add wifi to my network
<clever> joniWoni: i havent used it yet, but nixos also has hostapd options: https://nixos.org/nixos/options.html#hostapd
<clever> joniWoni: this file is configured to run my router, with normal ethernet on both sides, but you should be able to easily switch it to a wifi port, after you get hostapd up
<clever> joniWoni: i would use iptables/dnat (nixos has an option for that), hostapd, dhcpd, and bind
<clever> ah, thats it
<clever> Infinisil: i think there is a doc attribute in nixos/release.nix
<clever> kiloreux: and you have to uninstall your previous attempts, look in "nix-env -q"
<clever> kiloreux: with just -i, you told it to install everything in the default.nix
<clever> kiloreux: you should have ran nix-env -f nix-directory -iA both
<clever> kiloreux: what command did you run?
<clever> copy/paste the entire output to a gist
<clever> did it actually error?
<clever> kiloreux: did you set ignoreCollisions like i showed in the gist?
<clever> kiloreux: with what error?
<clever> trikl: an example i made for wireshark a while back: https://gist.github.com/cleverca22/5711322b5a12311571d8e828f40f0603
<clever> wut? lol
<clever> cant think of any just yet