2017-07-14

<clever> that one might not need root on the guest
<clever> schoppenhauer: i have heard that nixops has a proper container backend
<clever> var li = document.createElement("li"); ul.appendChild(document.createTextNode("foo")); ul.appendChild(document.createTextNode(", ")); ....
<clever> within the li i mean
<clever> var ul = document.createElement("ul"); ul.appendChild(document.createTextNode("foo")); ul.appendChild(document.createTextNode(", ")); ....
<clever> joepie91: you could also make a single ul, containing multiple text nodes
<clever> joepie91: there is also document.createTextNode i believe
<clever> gchristensen: it can also override NIX_PATH
<clever> chominist[m]: when using NIX_REMOTE=local?real= ?
<clever> mpickering: unquote the path and it should work
<clever> mpickering: can you gist the shell.nix file?
<clever> ubo thinks hydra is trying to track us
<clever> i think metrics is a "bad word"
<clever> and i just switched to u-block this week, lol
<clever> exactly, turning it off fixed it
<clever> but for you to have the exact same error...
<clever> was going to say its my adblock
<clever> same
<clever> Error loading tab: 0 error
<clever> so its just the xkb dir in the xkeyboard_config package
<clever> thats how nix computes the default path
<clever> chominist[m]: those files are in the store, the display-manager service sets it up for Xorg automatically
<clever> -xkbdir /nix/store/bc94k6vdap0sx1p2r43h96cid4ghxnkg-xkeyboard-config-2.20/etc/X11/xkb
<clever> same, i have some notes from questions i asked before, but havent done much
<clever> LnL: i think --option substituters could be used to treat /nix/store as a binary cache, when doing a build that targets /tmp/nix-cache/nix/store/
<clever> and you can then either copy it to /nix/store, or use option substituters to implement a copy-closure thing
<clever> LnL: yeah, this sets up a store that isnt mounted at the right spot yet, and the paths in the above cmd are wrong
<clever> [nix-shell:~]$ NIX_REMOTE='local?state=/tmp/nix-cache/&real=/tmp/nix-cache' nix-store -r /nix/store/4qjj1bj8ll69sgwfbdmnmb8p0yl11wy0-hello-2.10
<clever> i believe the 1st example treats a store as a cache, and the 2nd example lets you act on a store that isnt at /nix/store yet (chroot'ing for you)
<clever> it sounds like all store actions will go to that dir, and not /nix/store/
<clever> LnL: oh, interesting, not sure what that will do exactly, will need to play with it
<clever> LnL: oh, and then nix-push what you want to save into that, so travis can tar it back up
<clever> i also saw a trick in the github issues many months ago, where you first nix-build the kernel, then nix-shell into the kernel, so you can use its deps and $out to build modules
<clever> nix-shell also wont delete the outputs, so you can shell into the failing derivation, and then grep for $out in $lib
<clever> domenkozar: the above also helps greatly in fixing reference cycles in multiple output derivations
<clever> domenkozar: and i have found uses for that, a failed build leaves the $out intact, and then i can investigate logs it left there
<clever> and because it refuses to use it, things like ~/.nix-profile/ wont refer to it
<clever> i believe it will also refuse to use invalid paths, and remove them if they are in the way of a future build
<clever> and it may stop updating things like the channel or nix version
<clever> LnL: but if you cache everything, including db.sqlite, it may get confused when travis tries to install nix again
<clever> and nix doesnt manage ~/.stack/, so it never cleans up the broken ELF's
<clever> and when nix updates glibc, the binaries in the cache become invalid
<clever> binaries made by stack in ~/.stack/ can refer to the ld.so in the store
<clever> it also accepts a branch name, and can detect the repo from the current dir
<clever> Usage: travis logs [NUMBER] [OPTIONS]
<clever> oh, and the travis cli tools can probably help to bypass a lot of the browser being crap problems
<clever> domenkozar: my core2duo laptop took over 5 minutes just to load an appveyor log a week or 2 ago
<clever> i think that module is to let you use a samba password via pam
<clever> i think rpcbind just lets you lookup the port behind a named service
<clever> simpson: what about rpcbind?
<clever> dash: and googles 8.8.8.8 keeps randomly claiming the domain doesnt exist
<clever> dash: it has even returned aaaa records in response to an a query, with no ipv6 setup
<clever> dash: so it can return a records when the client asked for srv
<clever> dash: one users router, doesnt use the record type (a, aaaa, srv) as a key in the cache
<clever> dash: i recently switched one of my services to SRV, but now i'm finding new fun bugs
<clever> yeah, that has to be done for ipfs
<clever> i just pick a random number between 1024 and 65535 when i start a project
<clever> ipfs should probably get a dedicated port
<clever> i suspect its failing to contact the daemon
<clever> and just silently trying to access it directly
<clever> you gave yourself write but not read
<clever> and you lack read to many of the files
<clever> you lack write to the repo.lock file
<clever> -rw-r--r-- 1 ipfs ipfs 0 Jul 14 05:35 repo.lock
<clever> Infinisil: re-run the ls as root
<clever> Infinisil: can you pastebin the output of ls -ltrhR /var/lib/ipfs
<clever> and stat for a file/dir
<clever> Infinisil: run "id"
<clever> ive only used it with the data in home
<clever> what does "type ipfs" say?
<clever> ah yeah, and that
<clever> what directories exist within there?
<clever> chmod g+w
<clever> what about ls -lhd /var/lib/ipfs
<clever> are you using screen or tmux?
<clever> are you using screen or tmux?
<clever> how far did you logout?
<clever> you can also use "id" to inspect the current groups anduid
<clever> Infinisil: "exec sudo -i" followed by "exec sudo -u infinisil -i" will fix that one shell

2017-07-13

<clever> jophish: sounds easy enough

2017-07-12

<clever> because of zfs, my ghz is ~300-400mb, but nix still has to copy over a gig over the network when doing copy-closure
<clever> copumpkin: i have also noticed 178mb .a files inside ghc, that somehow compress down to 60mb with my zfs
<clever>  60M -r--r--r-- 2 root root 178M Dec 31  1969 libHSghc-7.10.3-0AG9TOjDEtx4Ji3wSwHOBe_p.a
<clever> joepie91: yep
<clever> joepie91: brb
<clever> joepie91: so it can compute the key names for everything in one block, before the config value is known
<clever> joepie91: i think its more about the name of the key not depending on the config or options sets
<clever> joepie91: mainly the top level ones i believe
<clever> joepie91: and to prevent infinite recursion, the key names in the config set must be static, so it can compute them and know which module to route the requests into
<clever> joepie91: so you are getting your own return value as an argument
<clever> joepie91: nixos will take the .config returned by every module (after recursively following imports), and merge them all together, then pass that merged result as the config argument, to every module
<clever> joepie91: i dont think nixos supports this kind of dynamic module creation, goes a bit farther then what it was designed for
<clever> joepie91: and the stack trace wouldnt point to line 26, it would point to the internal nixos code, that tries to run the function
<clever> joepie91: nix doesnt apply functions when they are in a list like that
<clever> joepie91: oh, line 26 of networks/default.nix is also wrong, that is a list containing a function and a set
<clever> joepie91: mostly so you can just get by with a single function at the top level of node-application.nix
<clever> then it would receive all arguments a module takes, plus some extra
<clever> joepie91: maybe something like this in pastebin-steam.nix, { pkgs, ... }@args: import ./node-application.nix (args // { tarball ... })
<clever> its not being passed in as an argument
<clever> joepie91: i just noticed, how is node-application.nix even getting a reference to config?
<clever> and then it could possibly auto-generate all of the config and options
<clever> joepie91: you could get the same effect by doing something like nodejs.services.pastebin-stream = { tarball = ... ; }; i think
<clever> joepie91: the key to how it works is the submodule on line 119, and the map on line 117
<clever> joepie91: this code lets you do services.openvpn.servers.<name> = { ... }; and it will auto-generate multiple service units
<clever> joepie91: you may want to look at how things like openvpn are being handled, one sec
<clever> joepie91: ah
<clever> joepie91: proper nixos modules typicaly start with { pkgs, ... }: and dont have to be imported like on line 15
<clever> joepie91: and what is the pkgs attribute at the top, that doesnt look right
<clever> joepie91: and yeah, that stack trace is almost unreadable, only one entry is even related to your file
<clever> joepie91: if you make the serviceName or cfg based on a constant, it should work better
<clever> joepie91: nixos needs to be able to pre-compute the attribute keys for the entire config tree, before it can read the values of anything
<clever> joepie91: i think i see the problem, the mkIf depends on the value of cfg, which depends on the serviceName
<clever> joepie91: can you gist the entire trace and maybe i can decode it?
<clever> joepie91: odd, the broken version is what i would have expected to be the working one
<clever> joepie91: ah, your using it inside of the config, not as the value of config itself
<clever> joepie91: i thought the whole purpose of mkIf was to deal with that
<clever> yep
<clever> and this
<clever> clever@c2d ~ $ realpath $(nix-instantiate --find-file nixpkgs)
<clever> /nix/store/5n59fpmkjna4gfcnjh5b0kpgn4vnpvkq-nixpkgs-17.03pre96825.497e6d2/nixpkgs
<clever> this is also an option
<clever> clever@c2d ~ $ nix-env -p /nix/var/nix/profiles/per-user/clever/channels -q
<clever> nixpkgs-17.03pre96825.497e6d2
<clever> the travis test is being derpy, i think its trying to rebuild the entire kernel
<clever> ah, and that is in the default XDG_CONFIG_DIRS, should work then
<clever> yeah
<clever> bkchr: they will instead land in either /run/current-system/sw/etc/xdg/autostart or ~/.nix-profile/etc/xdg/autostart
<clever> bkchr: and i dont expect things in $out/etc/xdg/autostart to land in the real /etc/xdg/autostart
<clever> bkchr: dont have any push access here
<clever> vaibhavsagar: i believe it runs Setup.hs, which imports cabal
<clever> giving both --datadir and --docdir appears to prevent the issue
<clever> but if your datadir doesnt contain ghc, the docs wind up in --prefix
<clever> if your --datadir contains ghc, the docs appear inside it
<clever> domenkozar: but its an odd bug to keep in mind, which may crop up again, given that cabal behaves differently if "ghc" is present in the --datadir or not
<clever> domenkozar: i dont remember which package it was on, but it was fixed by just always passing some enable flag to configure, i discovered it when reading the comments in that nix file
<clever> yeah
<clever> so it wont ask pkg-config for the real one
<clever> if it finds psql in the cflags, it assumes you already setup the -I path
<clever> and due to hashes, psql can appear in the cflags without being the psql include path
<clever> something in nixpkgs will auto-detect if psql is i the cflags, to determine if it needs to run pkg-config or not
<clever> bennofs: also, i have seen a bug because the word "psql" appeared in the hash
<clever> o vs 0
<clever> i think nix avoids ones that could make the hash confusing
<clever> bennofs: its a non-standard form of base32

2017-07-11

<clever> for example, not even root can delete an old /var/empty/ when cleaning an old drive out
<clever> LnL: some filesystems have extended attributes,and the immutable bit makes something read-only, even to root
<clever> the value of foo is bar, which is baz, which is foo, which is bar, which is baz, which is foo, which is bar,which is baz, which is foo, which is bar,which is baz, which is foo, which is bar,
<clever> pretty obvious why it has infinite recursion
<clever> also figured out the typo in my example
<clever> 36
<clever> [clever@amd-nixos:~]$ nix-instantiate --eval -E '{ x }: x*x' --arg x 6
<clever> can you gist the contents of that file?
<clever> what is the error?
<clever> it should have a --show-trace
<clever> though in --eval mode, it will only eval, and not run
<clever> <LAMBDA>
<clever> [clever@amd-nixos:~]$ nix-instantiate --eval -E 'x: x*x' --argstr x 6
<clever> --arg and --argstr are also available, to pass values to the file
<clever> ah, --eval prints the value, and -E lets you run a string without having a file
<clever> 25
<clever> [clever@amd-nixos:~]$ nix-instantiate --eval -E '5*5'
<clever> nix-instantiate --eval or -E, some combination
<clever> ah
<clever> nix-build -E 'with import <nixpkgs>{}; callPackage ./foo.nix {}'
<clever> joepie91: if it starts with { stdenv,, then it must be loaded with callPackage
<clever> and i should probably get some sleep, its 5am now
<clever> and also try ls -ltrh in the installPhase
<clever> add a -v to the cp
<clever> and youve set src to ../checks, so nix will have copied the scripts to the current dir already
<clever> yeah
<clever> oh wait
<clever> usually better to patchShebangs $out/checks/
<clever> so the patch wont find it
<clever> kuznero: i see your patching the stuff in . but your copying from ../checks/
<clever> kuznero: and the patch function isnt recursive
<clever> kuznero: it needs to be before check-services-running.sh gets ran
<clever> joepie91: and it can be tricky to read
<clever> joepie91: it should be full, but its mainly a function call level trace, not a thunk by thunk trace thru every attribute
<clever> kuznero: so the script cant be ran until after you run patchShebangs on the directory
<clever> kuznero: oh, /usr/bin/env doesnt exist inside the build sandbox
<clever> shouldnt be, can you gist the expression and the output when its building?
<clever> so it will always be available
<clever> bash is already in the stdenv
<clever> which will depend on the state of $PATH (and the buildInputs) during the build
<clever> you give it a directory, and it will replace #!/usr/bin/env bash with the output of "which bash"

2017-07-10

<clever> srhb: i believe one of the input nodes would be related to the trackpad
<clever> i see 2 for usb devices, 1 hid, 1 hidraw, and 3 input nodes
<clever> srhb: for example, plugging in my usb mouse causes 7 events to show up, twice each
<clever> the usb device itself, and then the hid interface created by the driver
<clever> i would expect a usb keyboard to have several entries in udev
<clever> its just a matter of decrypting the output from udev
<clever> srhb: i believe everything with a driver in linux will appear in udev, including character and block devices with no hardware behind them
<clever> which then automaticaly reconfigures the screen layout in synergy, so it knows which desktop is to the left/right of the laptop
<clever> for example, a different usb mouse in every room, and using udev rules to detect which one it is
<clever> ive done crazy things with udev before
<clever> srhb: then there is a query command somewhere in google, that tells you every attribute you can match against in udev
<clever> srhb: id check "udevadm monitor" first, while plugging in the external trackpad, to find its udev path
<clever> adding a similiar rule, that matches the name of the external one might work
<clever> ahh
<clever> srhb: and there is an activation script to reload it every time you run "nixos-rebuild switch" or "nixos-rebuild test"
<clever> srhb: it goes into a udev rule

2017-07-09

<clever> that channel then loads config.nix, which mutates the package set
<clever> the nixos. tells it which channel to load
<clever> erlandsona: you need nixos.erlandsona
<clever> and a directory is just a list of names and objectid's
<clever> every object in git is stored as sha1(value)=value, all objects have a type, and sometimes a size prepended to the value
<clever> and everything in git is sha1, which is close to becoming useless
<clever> so the treeid doesnt even exist
<clever> it just builds a url to the .tar.gz archive
<clever> and then you have things like fetchFromGithub, that entirely ignore the git protocol
<clever> you must start a clone from a commit that is at the tip of a branch
<clever> you could, but git doesnt allow you to clone a random tree of objects
<clever> nix will enforce it always being the exact same source
<clever> one of the key things with fixed-output derivations, is that you dont have to trust the repo or the network
<clever> and the treeid is a hash over a list of (filename, objectid) (the contents of the root folder)
<clever> catern: the commit is a hash over (commitmsg, parent commit, treeid)
<clever> catern: the problem is that git is a bit of a blockchain design, and to confirm the files you cloned are from that commit, you have to clone the entire history
<clever> /bin/sh=<pathtosh> <pathtoglibc> ... <the full closure of sh>
<clever> gchristensen: after reading the source i linked above, i think its enough to setup build-sandbox-paths just like on nixos
<clever> gchristensen: the nix sandboxing
<clever> gchristensen: did you figure out how sandboxing works on OSX?
<clever> Coyin: yeah, and nox does have caching, but i think it rebuilds too often
<clever> most of my laptops only have 1 speaker, cheap buggers
<clever> yep
<clever> yep
<clever> Coyin: i just tab-complete in nix-repl '<nixpkgs>'
<clever> erlandsona: did you do a nixos-rebuild switch?
<clever> ''
<clever> cp -vi ${./hda-jack-retask.fw} $out/lib/firmware/hda-jack-retask.fw
<clever> mkdir -pv $out/lib/firmware
<clever> runCommand "name" {} ''
<clever> then you can just do something like this
<clever> do you already have hda-jack-retask.fw in a local file, or do you want to fetch it from a url?
<clever> hashing thing?
<clever> erlandsona: for hardware.firmware, it would need to be a package containing a /lib/firmware/hda-jack-retask.fw file, i believe
<clever> i had to patch the source of pulse to make it work right
<clever> even outside of nix, pulse didnt support this
<clever> i had to hook up 2 sets of headphones and a sound bar
<clever> a few months ago, i was patching pulseaudio to support all the output channels in my card
<clever> :D
<clever> chromium will loose the ability to capture from the mic
<clever> teamspeak will loose all audio, and take a minute to quit
<clever> skype will silently go offline, while claiming to be online
<clever> ive also found that if the PA daemon crashes, several programs mess up in fun ways
<clever> and pavucontrol will also tell you what those programs are
<clever> you may need to close all programs using audio, including pavucontrol
<clever> and also, is pulseaudio in use?
<clever> check dmesg
<clever> and also writeScriptBin
<clever> if bash isnt required, you can also #!/bin/sh
<clever> so what you typed may be better
<clever> "#!/usr/bin/env bash" is usualy more portable, but $PATH wont be set when the kernel runs something directly
<clever> erlandsona: usualy, you would run patchShebangs on such a script to fix it
<clever> it also looks like this already tells the kernel where to look
<clever> erlandsona: and also look at the description of the other firmware related options in that file
<clever> you have to do import <nixpkgs> { config = config.nixpkgs.config; };
<clever> Infinisil: ah, any time you do import <nixpkgs>{};, it reads config.nix from $HOME
<clever> Infinisil: firefox-bin is a pre-compiled thing, while firefox is built by hydra
<clever> Infinisil: not sure, can you gist the entire error?

2017-07-08

<clever> weird
<clever> ftp*
<clever> i think its just shown when you connect with a CLI fpt client
<clever> does it let you login?, does it advertise a hostname?
<clever> try running an ftp client against that
<clever> i scanned both 4 and 6
<clever> its not open on my end
<clever> and why is 21 open??
<clever> your cell network might be blocking 22
<clever> Infinisil: and youve setup your auth properly, its not even asking for a pass! :D
<clever> Permission denied (publickey,keyboard-interactive).
<clever> [clever@amd-nixos:~/nix]$ ssh -4 infinisil.io
<clever> Infinisil: https://pastebin.com/XS9V5f6h
<clever> Infinisil: when i scan it from this end, its open on both v4 and v6
<clever> Infinisil: did you scan that from inside or outside the network?
<clever> Infinisil: another thing to keep in mind, some routers are wonky
<clever> pie_: factorio
<clever> yeah
<clever> pie_: heh, how do i keep forgetting!
<clever> https://gist.github.com/cleverca22/eaa78d7b2918753b8539e222185fb724 is what i have left over from when i was helping somebody else
<clever> so the url works as a channel
<clever> LnL: the default.nix will import <nixpkgs> and apply the overlay for you
<clever> LnL: pretty sure you need to import the overlay.nix file in that dir i think

2017-07-07

<clever> LnL: nice
<clever> LnL: yeah
<clever> nekroze: it can help to "nix-repl release.nix" and then tab-complete tests.
<clever> nekroze: nix-build release.nix -A tests.something
<clever> Infinisil: ah yeah, that can also be done
<clever> an example of that from my own config
<clever> Infinisil: had to use some fun tricks to even test it, because nixpkgs wanted to rebuild 2 GHC's for every change i made: https://gist.github.com/cleverca22/60c46368afb999c16224fc17af5c538d