2017-04-19

<clever> and you would still need a dhcp and dns server on the lan side
<clever> you would still be using hostapd with my idea, and still need nat to link the br0 and WAN interfaces up
<clever> CMCDragonkai: and then set a single static ip on that bridge
<clever> CMCDragonkai: i think if you want the wifi to act like a more normal router, you will need to put both the lan wired card, and the wifi card, into a bridge
<clever> CMCDragonkai: and only if the hash changes, does it restart the service
<clever> CMCDragonkai: i think its generating a service, the hash of which depends on the configured ip
<clever> avahi cant start with a rebuild-switch because dbus is upset
<clever> sphalerite: and almost anything dealing with dbus
<clever> ah, not sure then
<clever> sphalerite: unfreeRedistributable bypasses some of the normal rules
<clever> pie_: acording to the nix expressions, fonts = { enableCoreFonts = true; fontconfig.ultimate.substitutions = "ms"; fonts = [ pkgs.unifont pkgs.noto-fonts-cjk ]; };
<clever> so when it works, you can just ask for an arm build of coreutils
<clever> the biggest difference, is the the nixpkgs cross-compile stuff automaticaly applies to every package in nixpkgs
<clever> its more of an alternative, to let you run the native arm toolchain, rather then making a cross toolchain
<clever> and then it will be in ~/.nix-profile/bin/register
<clever> but you could probably also nix-env -iA qemu-user-arm -f ~/nix-misc/default.nix
<clever> so i can just do /root/arm/bin/register
<clever> i keep a symlink in /root called arm (from nix-build -A qemu-user-arm -o arm)
<clever> the admin would need to activate the binfmt stuff on bootup
<clever> steveeJ: this has to be registered as root before you do anything with arm, but nix-daemon isnt required
<clever> its currently manual
<clever> steveeJ: there is a register script inside the derivation
<clever> yeah, thats about all you can do
<clever> sphalerite: dont think it can do anything like that, and it will usualy not hit a limit on active jobs, so it should just do normal load balancing between processes
<clever> steveeJ: this builds a static qemu-user-arm for nix, and also has a patched copy of nix, so you can convince nix that the host can run arm locally
<clever> steveeJ: have you seen the qemu-user stuff i have done before?
<clever> steveeJ: the error at the end should tell you the dependency chain
<clever> steveeJ: i cant remember if i tried to cross-compile perl
<clever> johnramsden: { writeTextFile }: writeTextFile {stuff} in a file, and then callPackage it like normal
<clever> steveeJ: ah yeah, that looks right
<clever> steveeJ: cant find the info i had earlier
<clever> but ive heard that the cross-compile stuff has gone thru an overhaul recently, so that may only work on 16.09 or maybe 17.03
<clever> steveeJ: and i think you just have to set libc to the right value, and it will build the right libc
<clever> steveeJ: the old method is documented on https://nixos.org/wiki/CrossCompiling#Cross-compiling_in_practice
<clever> johnramsden: yeah
<clever> pkgs.writeTextFile { name = "foo.txt"; destination = "/share/polkit-1/actions/foo.txt"; text = "file contents"; };
<clever> might need raw writetextfile
<clever> hmmm, may not work, since the / is in the name
<clever> pkgs.writeTextDir "share/polkit-1/actions/foo.txt" "file contents";

2017-04-18

<clever> bkchr: pkgs.fetchurl
<clever> nix will redo read-only on the entire thing, once the build has finished
<clever> bkchr: line 31 is already doing that partialy, to allow templates to be changed in nix
<clever> bkchr: so you need to chmod +w the output before you can mkdir
<clever> bkchr: this copies the github version to $out, and fetchgit left it read-only
<clever> bkchr: ah, found the problem
<clever> bkchr: can you also pastebin the exact error its having?
<clever> bkchr: you can just do let foo = fetchurl { ... } in .... { ${foo} ....
<clever> bkchr: you can use fetchurl outside of src
<clever> bkchr: you need to use pkgs.fetchurl and then refer to its result
<clever> bkchr: all network access is disables when normal builds are running
<clever> bkchr: oops, can you gist the file you have changed?
<clever> ben: can you gist the file you have changed?
<clever> flyx: every attribute inside a derivation gets cast down to a string, and becomes an environment variable within the build
<clever> ben: under nixos, bash has been configured to never cache things from $PATH
<clever> flyx: export hardeningDisable=all
<clever> flyx: thats just an environment variable
<clever> zraexy: so you need to end a </para> that you never opened, if you want 2 paragraphs in a description
<clever> zraexy: one thing that caught me off guard, every description in nixos options is wrapped in a <para>
<clever> kuznero: and nixos-unstable-small might already have fsharp41
<clever> kuznero: http://howoldis.herokuapp.com/ you can see how old nixos-unstable is in here
<clever> but that does answer the question, your looking in nixos-unstable
<clever> kuznero: you are normally using nix-channel to manage the copy of nixpkgs
<clever> kuznero: nixos unstable or nixpkgs unstable?
<clever> myguidingstar_: ive seen a number of people with network issues like that in nixops+vbox, dont remember what the answers where
<clever> this is what i had written a few weeks ago
<clever> from = start: end: if start == end then [ end ] else [ start ] ++ (from (start+1) end);
<clever> it appears to generate a list of numbers from 0 to n-1, and also maps f over them
<clever> yep, i wrote that in raw nix just last week, lol
<clever> [ 0 1 2 3 4 5 ]
<clever> nix-repl> builtins.genList (n: n) 6
<clever> does this do what i think it does?, *tries*
<clever> static void prim_genList(EvalState & state, const Pos & pos, Value * * args, Value & v)
<clever> so the return values arent forced, and thunks get passed back into the lambda
<clever> so the only perf cost, is the size of the list
<clever> so i think it will iterate over every entry in the list on the spot, but might just wind up creating a chain of 20 thunks
<clever> addPrimOp("__foldl'", 3, prim_foldlStrict);
<clever> benley: i just use an android tablet
<clever> benley: ah, its been broken so much i dont even bother trying it
<clever> benley: and the connect button doesnt even render on nixos, so its 100% unusable
<clever> benley: because the server and client are tighyly integrated
<clever> tv for example, refuses to even run if its out of date
<clever> teamviewer*
<clever> some programs like firefox, chrome, and teamspeak are an exception
<clever> so the stability of the channel will increase over time
<clever> i believe releases like 16.09 and 17.03 wont get version changes, only bug fixes
<clever> and once the test is all green, the channel should update
<clever> that page also links to the test jobs within hydra
<clever> timclassic: its described at the top of http://howoldis.herokuapp.com/
<clever> hyphon81: look at the very first line of text, 'The NixOS wiki is outdated and is being shut down. If you wish to add or improve NixOS documentation, please grab a ticket from the Move the wiki! milestone'
<clever> myguidingstar: yep, --force-reboot causes it to use boot rather then switch, and will probably follow it up with a reboot
<clever> myguidingstar: check the nixops manual to see if there is an option to make it reboot to apply changes
<clever> myguidingstar: i think the problem is the switch action, if nixops used the boot action, then rebooted, this problem shouldnt occur
<clever> shanemikel: some things like teamspeak have the packagd QT deleted, and its switched to the nixpkgs QT
<clever> shanemikel: the homepage is also usualy declared in nix packages, so if you can find that, grep nixpkgs for it
<clever> shanemikel: and sometimes, i apt-file a debian based machine to turn the lib into a package name, then use the above tools to find that package in nix
<clever> shanemikel: nox, command-not-found, and just grep against nixpkgs are my main tools
<clever> yep
<clever> so you just put a list of packages where zlib is, run nix-build, and it makes a bash script, that bash script will patch things
<clever> i have also made a nix expression that generates a bash script: https://gist.github.com/cleverca22/8cae5bc9c02c12099a3bf5e20e75161f
<clever> patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)"
<clever> yeah, it needs patchelf ran on it
<clever> shanemikel: what interpreter does it have?
<clever> shanemikel: and if you run 'file' on that binary?
<clever> jeremejevs: you would need to git clone nixpkgs, checkout the revision listed in nixos-version, and then edit this line: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/x11/xserver.nix#L564
<clever> Apr 18 03:05:23 nixos display-manager[5374]: (++) Log file: "/dev/null", Time: Tue Apr 18 03:05:23 2017
<clever> but!
<clever> i think xorg will write more details to the log file, then it does to stderr
<clever> anything like segfault in the last ~10-20 lines
<clever> jeremejevs: that is strange, anything at all in dmesg?
<clever> can you gist the last ~50 lines of that journal?
<clever> it should also show some of the journal
<clever> jeremejevs: systemctl status display-manager
<clever> yep
<clever> ijophst: there is even an entire nix expression, that will run substituteAll on a given file, and just takes an attrset of things to replace

2017-04-17

<clever> thats handled by the substitute function in setup.sh
<clever> ijophst: everything in the extrautils/bin path (which includes all of busybox) gets symlinked to /bin
<clever> ijophst: that path will only be valid inside the initrd
<clever> jeremejevs: ah, and that start job its stuck on, that might be trying to find the old /boot
<clever> it only overwrites hardware-configuration.nix
<clever> no
<clever> jeremejevs: thats one common issue when /boot is getting formated
<clever> jeremejevs: otherwise, the resulting nixos will try to mount the old (and missing) boot filesystem
<clever> jeremejevs: you need to update /mnt/etc/nixos/hardware-configuration.nix with nixos-generate-config --root /mnt
<clever> calvertvl: ah yeah
<clever> Mic92: ive heard that it has problems locking up
<clever> calvertvl: for non-luks systems, i would just use a normal swap partition
<clever> :D
<clever> and i incorrectly thought it was crashed
<clever> and now your paying for the fake speed the write-cache gave
<clever> so when the sync does happen, it hangs for unusualy long periods
<clever> SD cards have a low write speed, and linux buffers too much
<clever> yeah
<clever> Dezgeg: at times, i have noticed it hanging, because it had 100mb's in the write buffer, and i just killed power, lol
<clever> Dezgeg: though there is a sync call in nixos-rebuild
<clever> and i think it changes the metadata in every dir in the tree up to the root folder, which is in a circular log
<clever> and new metadata
<clever> so it never overwrites data, it creates a new copy of the data with the changes
<clever> zfs guards against it by making all data and metadata immutable
<clever> a hard-reboot will also corrupt the disk
<clever> jeremejevs: power outage
<clever> frheajgre: https://nixos.org/nixos/options.html#docker.enable this option will need to be set in /etc/nixos/configuration.nix
<clever> yeah, once you throw some http into the mix, it can just use a remote database
<clever> sphalerite: then it can just read /proc/cmdline to find arguments
<clever> sphalerite: and then pass a hostname as a kernel parameter
<clever> sphalerite: if you are using the boot.php from my original gist, you could also modify the netboot.ipxe it chainloads, and embed that into the php script
<clever> ah, and then hard-code a map of ether->hostname into the image, via ethers
<clever> so it doesnt nuke every machine you accidentaly boot it on
<clever> sphalerite: i think it would be safer for it to register itself as booted in some central server, and then wait for a hostname, sshpubkey, and the order to self-nuke
<clever> avn: ive read its source and helped a few people with it, but have yet to actually use it
<clever> avn: needs less control over the network then full netboot
<clever> avn: oh, and i was thinking of using the kexec in nixops also
<clever> so when it boots, you can simply type in 'justdoit' and it will do the entire install
<clever> this one creates a bash script in the systemPackages of the netboot
<clever> sphalerite: also, do you see the justdoit in my last gist?
<clever> avn: and in theory, you can also drop those into /boot and add a grub option
<clever> avn: i just took the netboot kernel+initrd, and ran kexec on them
<clever> avn: that was also in my plans
<clever> avn: https://gist.github.com/cleverca22/75e3db4dabeff05b743e9be77a2341b9#file-netboot-nix-L1 this replicates that code, and loads a custom configuration.nix
<clever> avn: but there is no way to customize the configuration.nix
<clever> and there is a netboot.nix in there that contains exactly 1 derivation
<clever> lrwxrwxrwx 1 clever clever 51 Dec 7 07:37 netboot -> /nix/store/w46h600glmq9m2v5cjpc2q06jd61winq-netboot
<clever> clever@c2d /var/www/c2d $ ls -ltrh
<clever> if i remember where i left it, lol
<clever> but i should be able to upgrade that netboot with just a nix-build
<clever> yeah
<clever> so if i just flip on netboot in any machine, it drops me to the same login prompt the iso gives
<clever> with a full nixos install env in the initrd
<clever> i also have netboot configured in my lan
<clever> but as long as you dont use tank again elsewhere, you should be fine
<clever> ive never tried to rename them
<clever> so pools dont collide if i ever need to rescue 1 hdd in another machine
<clever> i also try to make the pool name align to the hostname
<clever> and compression, it varies depending on disk size and cpu speed
<clever> i usualy enable snapshots for / and /home, but disable snapshots for /nix
<clever> and also i always make a seperate zfs filesystem for /, /home, and /nix
<clever> i prefer to keep an ext4 /boot
<clever> currently, i only use luks on portable machines
<clever> erigoaj: you can always go the non-luks route, that one should have less problems
<clever> erigoaj: mostly by looking at lsmod when things are working, and making an educated guess
<clever> erigoaj: using this option, you can force what kernel modules it will load within the initrd
<clever> erigoaj: https://nixos.org/nixos/options.html#boot.initrd.ker
<clever> yep :)
<clever> erigoaj: yeah, that sounds like the uuid you wanted to use
<clever> erigoaj: that may show the uuid of the encrypted version of the device
<clever> erigoaj: what does blkid say when ran on /dev/sda2 ?
<clever> alphor: ive always used a prestart script
<clever> hodapp: then you probably just eval "$configurePhase"
<clever> hodapp: you could just run the entire genericBuild function to get all of it handled for you
<clever> hodapp: line 870 is using some weird bash syntax to either eval $configurePhase or run configurePhase
<clever> "/nix/store/bdjyhh70npndlq3rzmggh4f2dzdsj4xy-hello-2.10"
<clever> [clever@amd-nixos:~]$ nix-instantiate --eval -E 'with import <nixpkgs>{}; "${hello}"'
<clever> hodapp: nixpkgs is weird like that
<clever> hodapp: typing 'configurePhase' into the shell will run the default configurePhase bash function, not eval the $configurePhase variable
<clever> dejanr: the storepath after its built, or its nix expression path?
<clever> hodapp: then each version shows up under python3Packages and python2Packages
<clever> hodapp: i think most of them go into top-level/python-packages.nix, and then nixpkgs will call the package twice, once with python2, and once with python3

2017-04-16

<clever> kuznero: a nixpkgs maintainer
<clever> just need to wait for a maintainer to notice that things have been updated now
<clever> yeah, since its purely adding new things, there is very little chance of it breaking old things
<clever> kuznero: and then in the github ui, you can create a pull request
<clever> kuznero: make sure you clone from master, make the changes, then commit, and push to your fork on github
<clever> the .xz may need to be removed, and the compression code on 204 may need updating
<clever> or you can do { key = let key=value; in value; }
<clever> so you can either do let key=value; in { key=value; }
<clever> any place you can put a value, you can also do: let key=value; key=value; in value
<clever> kuznero: for the exact syntax, its something like this
<clever> kuznero: can you gist the entire file?
<clever> now ps is a local variable, and wont be exported
<clever> kuznero: that needs to be in a let block, not the main attribute set
<clever> kuznero: and what is the error?
<clever> gotta break everything dont they? lol
<clever> ah
<clever> kuznero: there is a mono package in nixpkgs, that i have used that to run an exe file before (i believe it was all .net bytecode)
<clever> kuznero: and also for simple haskell projects, you dont need cabal to build in nix: https://github.com/arcane-chat/arcane-chat/blob/master/chat-shaker/default.nix
<clever> kuznero: [ 1 2 ] ++ [ 3 4 ]
<clever> shanemikel_: is xorg still running? or failing to start?
<clever> johnramsden: ah, if its not a shebang, then you may want ${bash}/bin/bash
<clever> johnramsden: and then nixpkgs will re-patch it to the absolute path of bash for you
<clever> johnramsden: if the script lands in $out/bin/, you can usualy patch it to #!/usr/bin/env bash
<clever> i have had to deal with setting the ip directly before: https://github.com/cleverca22/toxvpn/blob/master/src/interface_linux.cpp#L45-L52
<clever> https://github.com/GaloisInc/HaNS/issues/3 oh, there is even a fork that used pcap to handle the rx side
<clever> and the tap code is probably just to make it easyer to test the networking stack outside of xen
<clever> its meant to run as a unikernel under xen
<clever> but it could be possible to just do raw ethernet frames into eth0 with the linux socket api
<clever> https://github.com/GaloisInc/HaNS/tree/master/src/Hans/Device it appears to only support tap devices, and the xen hypercalls
<clever> yeah, builtins are a different thing
<clever> about the only difference is that the haskell repl can use lightweight threads to fork off "children", while busybox has to spawn whole new processes, and re-initialize busybox inside each
<clever> yeah
<clever> it was more as an example that you can run haskell without needing to rely on any init framework
<clever> yeah
<clever> theres not much need for the .img
<clever> but i already have the entire closure of the os in the initrd
<clever> yeah
<clever> MichaelRaskin: yep, but i was testing all of this in qemu and had no rootfs to actualy mount
<clever> MichaelRaskin: the above gist doesnt have any lvm support, and currently doesnt even mount a persistant drive
<clever> MichaelRaskin: ah
<clever> unlmtd[m]: the above gist uses a haskell program as pid 1, and as the repl for a basic shell
<clever> unlmtd[m]: i havent looked at its source
<clever> unlmtd[m]: here is another random example i put together, how to boot linux with a single ELF file and no forking, https://gist.github.com/cleverca22/ef84b943d33b1aa33f8ecdeb32c20c09
<clever> Mic92: then it doesnt know which unit to tag the journal data under
<clever> Mic92: i have heard of bugs in systemd, like when a process quits, systemd deletes all state about that pid, before it can finish processing journal messages related to that pid
<clever> timclassic: looks good
<clever> oaierjg: the ext4 must be on a partition, not the root of the device, your probably destroying the partition table every time you do that
<clever> oaierjg: they call it bios_grub
<clever> oaierjg: and also, bios boot partition is a checkbox in gparted, under flags
<clever> oaierjg: yeah
<clever> oaierjg: just make a bios boot partition, it only takes 5 seconds to do that
<clever> oaierjg: but GPT's partition table is larger, and its not safe to use space that is flagged as unused
<clever> oaierjg: when using MBR, grub just jams it into "unused" space between sector 0 and the 1st partition
<clever> 1MB in size should be plenty
<clever> oaierjg: it has no fs type and does not need to be formated
<clever> oaierjg: you need to make a dedicated 'bios boot partition' in the partition editor, grub needs that to boot
<clever> oaierjg: did you use MBR or GPT?
<clever> so there may wind up being zero files outside of that dir
<clever> ah yeah, though nixos is capable of booting with only a /nix/store
<clever> adding --owner=0 to the docker tools will make it work the same on both nixos and other
<clever> that rule is only broken when you install nix on another os, and you lack root to do things well
<clever> and /nix/store must always be root:root and read-only on any proper nix machine
<clever> :)
<clever> it should be easy to test, just git clone that repo, edit the file, and run nix-build -I nixpkgs=/home/clever/nixpkgs to use the modified dockerTools
<clever> so you dont need root to fix things
<clever> but the commandline in make-system-tarball will make tar store uid 0 in the tar, and ignore the uid on-disk
<clever> timclassic: i think the dockerTools expressions inside nixpkgs need to be fixed to force uid/gid 0/0
<clever> timclassic: is it using tar to build the docker files?
<clever> boxofrox: thats usualy made by things like 'nixos-rebuild build'
<clever> yep
<clever> boxofrox: the containers have their own set of users
<clever> if i'm reading it right, you could probably even put it on the last line of the time
<clever> simpson: i dont think it has a limit on which line it has to appear on