2018-03-14

<clever> but the installer would generate a bash script, that runs proof/namespaceutil against the fake root dir in $HOME
<clever> you would also need proot after the install, like i still need the namespace utils
<clever> in the nix-installer.nix i linked above, i only use arx for the "installer", and it copies the full store into ~/nix-install/nix/store/
<clever> so it unpacks to a tmpdir every time you run it
<clever> the arx file it generates is basically a self-extracting tar file
<clever> or have it copy things to ~/nix/store/ so the store actually persists
<clever> but you can just skip the namespace, and run a bash script and proot instead
<clever> nix-bundle uses it to run a staticly linked namespace helper against the nix/store in a tar
<clever> the end result is a "bash" script (with a tar appended to it), that will unpack itself to a tmpdir, and run the command hard-coded into it
<clever> tobiasBora: this uses arx to package up ${archive} and it will run ${startup} after unpacking it
<clever> tobiasBora: arx may also be of interest to you
<clever> yeah
<clever> so you pass around the tarball that nix generated
<clever> tobiasBora: nix can be used to generate a tarball, which you would then just unpack to a given path
<clever> tobiasBora: ah, then youll probably want to read my expression as an example, of how to make a similar thing with proot
<clever> and includes a script to enter the namespace
<clever> tobiasBora: this generates an arx bundle using mount namespaces, that will install nix to ~/nix-install/nix/store/
<clever> tobiasBora: ah right, thats where the nix-installer.nix i recently wrote comes in
<clever> tobiasBora: adding arm-linux isnt that much more complex
<clever> trevorcook: https://nixos.org/nix/install already does that on darwin and x86-linux
<clever> and you may need to switch buildInputs to nativeBuildInputs
<clever> CrazedProgrammer: try .overrideDerivation instead of .overrideAttrs
<clever> so nixos thinks the kernel isnt capable of running nixos
<clever> CrazedProgrammer: so the kernel does have those flags, but nixos cant auto-detect them
<clever> CrazedProgrammer: ahh, i think the passthru and .features are being lost
<clever> or rather, nixos i think
<clever> and thats a nix level assertion!
<clever> srhb: 2018-03-14 11:38:42 < CrazedProgrammer> clever: thanks! tried it, seems to disable the default config: https://i.crzd.me/paste/ZlRAGCuL.nix https://i.crzd.me/9fB8BDrr.png
<clever> CrazedProgrammer: sometimes, its just simpler to fork nixpkgs and insert lz4 at the right spot
<clever> trevorcook: and then bash sourced .bashrc, and printed out text, which confused the nix protocol
<clever> trevorcook: i think when it ssh'd into the remote machine, it ran bash to execute nix-store --serve
<clever> CrazedProgrammer: but i dont see a clear way to add lz4, and the config vanishes when you .overrideDerivation
<clever> CrazedProgrammer: yep
<clever> srhb: this may be why overrides break
<clever> in lib.extendDerivation true passthru kernel
<clever> trevorcook: what about `ssh tcook@host nix-store --version`
<clever> srhb: yep
<clever> trevorcook: try --to tcook@host
<clever> possibly neither, extraConf isnt valid here
<clever> its not clear if .override is acting on lines 1-6 or 18-40
<clever> that shouldnt be needed
<clever> CrazedProgrammer: .override can only change the args on the 1st line of a package, and cant modify things like buildInputs
<clever> CrazedProgrammer: try wrapping the entire .override{} with () and then do .overrideAttrs (drv: { buildInputs = drv.buildInputs ++ [ lz4 ]; })
<clever> trevorcook: can you gist the exact command you ran and its output?
<clever> CrazedProgrammer: can you gist your current override?
<clever> elvishjerricco: also, you may want to clean the echo's up, they can break things like scp
<clever> electrocat: a few things may not work when using nix2 without root and nix 1.11 as the daemon, but nothing that major
<clever> elvishjerricco: interactive ones still source a thing in /etc, so they work fine
<clever> elvishjerricco: but its only really an issue for non-interactive shells
<clever> so every single user must have a .bashrc, and there is no way to configure it globally
<clever> trevorcook: or rather, from /etc, i mean
<clever> trevorcook: anoyingly, ive discovered that a mac will never source a file from $HOME when on non-interactive shells
<clever> trevorcook: nice
<clever> srid: yet ive never once ran xmonad, nor any tiling window manager more complex then ratpoison
<clever> srid: ive been pretty weird with xmonad, i come up with fun and whacky ideas on how it can do abnormal things
<clever> srid: and it does support this event, so you just have to convince xorg to send it
<clever> srid: lol, the entire graphics ffi, is on the xmonad project
<clever> srid: one issue ive had with hackage, back-references, what functions accept or provide a XRROutputInfo
<clever> srid: i see data's in here that have similar names
<clever> srid: does 'xev' show anything when you plug in a monitor?
<clever> trevorcook: try again with .profile
<clever> srid: it may need to ask xorg to send them first via some api
<clever> trevorcook: add an echo to ~/.bashrc, then try `ssh user@host nix-store --version` and see if it both prints that echo, and finds nix
<clever> also, auto-config doesnt work so well on my desktop, my monitors are laid out in the 1,3,2 order
<clever> and depending on the api, auto-detect&switch
<clever> srid: so you could trivially add an xmonad binding that activates hard-coded xrandr profiles
<clever> srid: ah, sounds like its at least using the same module i linked
<clever> srid: you may also want to look into the xmonad source and figure out what library it uses to hook into X to begin with, so you can stay compatible with that
<clever> srid: its haskell, so i would expect you to be able to ffi into pretty much anything, and then hook the right events
<clever> srid: but you could add code to the xmonad config file to manage this!
<clever> srid: i use xfce and it just auto-detects that without any fuss
<clever> or you could just "$@" at the end of line 11, passing all flags to the server, and then allow the haskell to accept 2 -p's, so the later ones override
<clever> you could parse $* within that bash script, and accept flags to override the port
<clever> which costs you a bit of ram and a pid
<clever> without exec, the shell on line 10 hangs around waiting for the server to quit
<clever> Myrl-saki: only improvement i can say, is to add exec on line 11
<clever> Myrl-saki: 404
<clever> ive not really been using any cheap ones, i either go AWS, OVH, or just throw another desktop into the storage room
<clever> kolb: a: hydra wont really work when installed with nix-env enless you want to do a lot of configuring by hand, b: the build was recently broken on nixos-unstable, you may need to update your channel
<clever> sure
<clever> the script in that paste, looks better suited to runCommand "name" {} ''
<clever> so it wont do what your thinking
<clever> also, all it does, is write the string to $out/bin/<name>
<clever> so `writeScriptBin "foo"` is a function that takes 1 more
<clever> writeScriptBin is a function that takes 2 arguments
<clever> Myrl-saki: it needs a name for the script
<clever> Myrl-saki: writeScriptBin is a derivation
<clever> in this case, just finding the path is a bit tricky
<clever> Myrl-saki: this calls electron with the right paths for it to find things
<clever> Myrl-saki: you could use just writeScriptBin and nothing else
<clever> rawtaz: when you least expect it :P
<clever> but for release, it just bundles
<clever> so at dev time, it builds faster
<clever> you could also do both, have a boolean flag to switch between them
<clever> but it doesnt have to copy the binary, just call it with the right params at runtime
<clever> yeah
<clever> so changes to the client dont needlessly recompile the server
<clever> and then make a 3rd derivation, that just generates a bash script to run it with the right args
<clever> in theory, you could make a the server accept those paths via cli args or env vars
<clever> i also just now hard another idea, an optimization
<clever> layus: recursive nix would allow that to work
<clever> layus: yeah
<clever> Myrl-saki: it probably never existed to begin with
<clever> layus: the gcc search path works by having scripts in the stdenv iterate over everything in $buildInputs (a bash variable) and adding the include subdirs to the -I path via a gcc wrapper
<clever> layus: that will likely break the gcc include path for most things
<clever> layus: nix-shell --pure already does that
<clever> layus: what exactly are you trying to do?
<clever> ottidmes: yep
<clever> ottidmes: for a build slave to do that, you must copy over ALL systemPackages to the slave, 2-3gig of files
<clever> ottidmes: for example, the system-path derivation, is just scanning to see what files exist, and making a symlink tree, quick&easy
<clever> ottidmes: ive found that the trivial ones are often slower with slaves
<clever> ottidmes: maxJobs = 1; may allow that, but yeah, its a bit of a pain
<clever> ottidmes: ah, if you set something like nix.maxJobs = 0; then it just never builds locally
<clever> ottidmes: why do you want to build it there?
<clever> ottidmes: though in your case, if the one slave you dedicated to the job happens to be busy with anything
<clever> ottidmes: ive also found nix to be rather eager to offload things to slaves, and it only builds locally if all the slaves are busy
<clever> ottidmes: i think requiredSystemFeatures is ignored when building locally
<clever> bryanRobson: go into the hardware-configuration.nix and remove the extra swap and it should be good
<clever> bryanRobson: what does fstab say about it? can you paste that line here
<clever> bryanRobson: is that uuid listed in /etc/fstab ?
<clever> as long as lpr itself is in PATH
<clever> silver_hook: yep
<clever> nice
<clever> silver_hook: and does that path exist?
<clever> silver_hook: what does "${pkgs.cups-filters}/share/cups/data/testprint" eval to inside `nix-repl '<nixpkgs>'`
<clever> silver_hook: i think you just want pkgs.cups-filters
<clever> nixos/modules/services/printing/cupsd.nix: serviceConfig.ExecStart = "${cups-filters}/bin/cups-browsed";
<clever> [clever@amd-nixos:~/apps/nixpkgs]$ grep -r --color cups-filters
<clever> silver_hook: if you gist the --tree output, i can skim over it
<clever> it will likely be within nixos/modules
<clever> silver_hook: see what refers to cups-filters, and then find its nix expressions
<clever> silver_hook: ah, for that, you can work in the other direction, `nix-store -q --tree /run/current-system`
<clever> garbas: does -vvvv have any effect?
<clever> yeah, ive seen that in some docs
<clever> nixops at least has a ~/.ec2-keys that lets you store and name several
<clever> so conflicts will arise if i need to use multiple accounts and all the tools require ~/.aws/credentials
<clever> ah
<clever> elvishjerricco: how does it know which accesskeys to use?
<clever> garbas: i checked the irc logs for context around line 3, but nothing useful
<clever> silver_hook: and that would then contain the instructions on how it was built
<clever> silver_hook: this then shows the path to the .drv that generated it
<clever> /nix/store/idzpv1j9yryq9lrsa82yg9ihxxvivyld-cups-2.2.6.drv
<clever> $ nix-store -q --deriver /nix/store/hxrscdgw57pya4jwj56fgivgfjcn91c2-cups-2.2.6-lib
<clever> i dont have cups fully configured, so i'll use -lib as an example
<clever> /nix/store/hxrscdgw57pya4jwj56fgivgfjcn91c2-cups-2.2.6-lib
<clever> $ nix-store -qR /run/current-system | grep cups
<clever> that will show the path to the output
<clever> silver_hook: nix-store -qR /run/current-system | grep cups

2018-03-13

<clever> the nix expressions are used to generate the .drv files
<clever> the raw directions telling nix-daemon how to build something
<clever> nix-store -qR on the .drv would give you ALL the build-time things, including stuff it no longer needs (like the gcc source!)
<clever> and there is no one magic tool to list off everything you currently have that can be copied to a remote machine to speed up its building
<clever> Myrl-saki: the issue, is that the deps in the default.nix may themselves not be built yet
<clever> Myrl-saki: nix-copy-closure already gets the closure, its in the name
<clever> but once imported, it is bound to that hostid, and you need force to change that
<clever> so it sounds like the rule is, an exported pool can be imported by anybody
<clever> infinisil: done
<clever> or clang in your case
<clever> nix-shell and the stdenv handle it all for you, so `nix-shell -p libtasn1` adds it to the search path for gcc
<clever> nix can garbage collect the .dev output after your done building
<clever> you only need the header at compile time
<clever> split outputs
<clever> and look in result-dev
<clever> mpickering: try -A libtasn1.dev
<clever> mpickering: how did you get the path to those files?
<clever> infinisil: so if you disable forceImport, then you must cleanly export the pool when changing hostId's (from installer to main os)
<clever> MichaelRaskin: it does contain it, acording to nix-locate
<clever> libtasn1.dev 12,759 x /nix/store/81pmcrfl1i5hpz58sm4p88d4pw9hf49c-libtasn1-4.10-dev/include/libtasn1.h
<clever> infinisil: this time, all i did was `shutdown -h now` and then boot it back up, its just spamming .....'s at the initrd
<clever> disk wiped, doing a second install
<clever> infinisil: it boots just fine, possible because i did a full `zpool export tank` before shutting down the installer
<clever> so it would just cause a rebuild with $version set to a value at build-time, which has zero impact on the build
<clever> sean__: it probably wont even change the name
<clever> sean__: more that changing the version wont change the url inside the src, due to how nix works
<clever> infinisil: got distracted, but the nixos-install was running last i checked it
<clever> and how many your trying to delete
<clever> MichaelRaskin: i think it would depend on the inode count
<clever> and you can tune the inode count to be higher and go monthly
<clever> mkfs is always faster then rm -rf
<clever> similar to LnL's idea
<clever> gchristensen: and use it as a cache
<clever> gchristensen: though you could have a disk image on a file, that you format once a week, rather then rm -rf
<clever> MichaelRaskin: my hydra has gc-keep-derivations and gc-keep-outputs set
<clever> we need a repl for the daemon unix socket
<clever> so whatever you do, performance is going to suck
<clever> MichaelRaskin: and every invocation has a massive amount of initialization
<clever> MichaelRaskin: if `nix-store --delete` is given multiple files, it will stop at the first in-use one, and not delete further files
<clever> but invalid paths come first
<clever> gchristensen: i think by default, nix will shuffle all garbage, and then delete until it hits the --max-freed quota
<clever> infinisil: and now i can tell qemu to justdoit!
<clever> infinisil: yeah
<clever> infinisil: testing some things out in my kexec env to see what happens...
<clever> that list appears to suffer from the 3rd problem :P
<clever> and properly hand-off full control of it
<clever> so you need to export the pool and flush the write caches, then flush the read caches and import the pool
<clever> infinisil: your read cache may wind up claiming something that is false, because your un-aware of writes another machine did
<clever> infinisil: which may confuse and crash the reading kernel
<clever> infinisil: even reads are unsafe, because the other machine may change things your not expecting
<clever> gchristensen: thats why zfs wont import the pool if the hostId is wrong
<clever> infinisil: i was once booting my laptop over that
<clever> infinisil: iscsi is basically sata over tcp
<clever> gchristensen: in the past, i have used nbd (a relative of iscsi) to jurry-rig an lvm array together across 2 machines, so i could replace one of the drives with a bigger one
<clever> gchristensen: iscsi
<clever> ghostyy: nixos will append that list to the existing one, and add it to the PATH env for the service
<clever> Orbstheorem[m]: nix-build -E 'with import <nixpkgs> {}; callPackage ./default.nix {}'
<clever> Judson: check the shell.nix i linked
<clever> Judson: one sec
<clever> boomshroom: i meant to send that msg to rawtaz
<clever> rawtaz: and it would be in the same directory as configuration.nix
<clever> rawtaz: imports = [ ./thatfile.nix ];
<clever> rawtaz: then nixos will merge the 2 files for you
<clever> rawtaz: the simplest way to use it, is to add its path to the imports list
<clever> rawtaz: that is a nixos module, which is what configuration.nix also is
<clever> rawtaz: but if you lack both config and options, nix will automatically wrap the entire thing with config = { ... };
<clever> rawtaz: technically, configuration.nix must only contain 3 attributes, config, options, and imports
<clever> boomshroom: you put a config attribute in your configuation.nix
<clever> nix.extraOptions = "secret-key-files = /etc/nix/signing.sec";
<clever> boomshroom: thats to configure nix-serve, which is seperate from nix2.0 signing things on its own
<clever> boomshroom: nope
<clever> boomshroom: thats one style i tend to use
<clever> boomshroom: add this to nix.conf using the right configuration.nix entry
<clever> secret-key-files = /etc/nix/signing.sec
<clever> messy!, bash sets it with a default priority, but its not the .default of the option type
<clever> boomshroom: run this, `nixos-option users.defaultUserShell`
<clever> boomshroom: ah, and that slao what you get when you manually ssh
<clever> boomshroom: nix is parsing the output of `nologin` as an int
<clever> c2d ~ # nologin
<clever> This account is currently not available.
<clever> boomshroom: that number, is the string "This acc", backwards
<clever> boomshroom: floating point in nodejs ate the first few bytes
<clever> 'cca sihT'
<clever> > new Buffer('6363612073696854','hex').toString('ascii')
<clever> boomshroom: what happens if you try to manually run something like `ssh user@host nix-store --version`
<clever> ottidmes: a one-shot systemd service would run on bootup, and with the right restart triggers, on every rebuild-switch
<clever> boomshroom: what is the hostname of the build slave?
<clever> 'cca sih\u0000'
<clever> > new Buffer('6363612073696800','hex').toString('ascii')
<clever> ottidmes: and then broken projects prevent you from updating the OS
<clever> ottidmes: ah, thats less re-inventing hydra, but you still need to build the closures of every project on every system update
<clever> ottidmes: on (re)build of what?, the project, or nixos?
<clever> ottidmes: a systemd timer might be better then, but now your starting to re-invent hydra
<clever> ottidmes: restart triggers only work when you do a rebuild-switch, and it still needs a wantedBy
<clever> ottidmes: a one-shot systemd service is the closest thing to what you want
<clever> ottidmes: second, this happens so early in bootup, that systemd isnt even running, so you have zero network access
<clever> ottidmes: first, the machine will refuse to finish booting until it has fully build everything
<clever> ottidmes: an activationScript is the worst place to do that
<clever> or it will keep the old version around, not the new one
<clever> though you will also need to update those roots any time something like openssl changes
<clever> mjacob: simplest answer, just dont run garbage collection
<clever> it will persist until you undo it with `nix-env -e packagename`
<clever> yeah
<clever> mjacob: the nix-env thing will be available in $PATH, and overwride whatever you had in configuration.nix
<clever> mjacob: entirely seperate
<clever> FareTower: simple answer: pick an older generation from the bootloader when rebooting, that will undo all changes to nix.conf
<clever> channels dont have anything to do with GC roots
<clever> yep
<clever> then ~/.nix-profile points somewhere new!
<clever> instantepiphany: one thing you could do is mess with $HOME
<clever> instantepiphany: but nix-env -i still acts on ~/.nix-profile/ and that will persist after you exit the shell
<clever> instantepiphany: yep
<clever> it can obey NIX_PATH, but it wont look in it by default
<clever> yeah, nix-env is one of the weirder tools in the toolbox
<clever> instantepiphany: ~/.nix-defexpr/
<clever> behind the scenes, <nixpkgs> gets translated into builtins.findFile builtins.nixPath "nixpkgs"
<clever> /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs
<clever> [clever@amd-nixos:~/iohk/daedalus]$ nix-instantiate --eval -E 'builtins.findFile builtins.nixPath "nixpkgs"'
<clever> instantepiphany: this dumps the internal NIX_PATH value, after all -I's have been applied
<clever> nix-instantiate --eval -E 'builtins.nixPath'
<clever> instantepiphany: you can also append -I nixpkgs=whatever to it
<clever> instantepiphany: yeah
<clever> ottidmes: there is also nix-instantiate --find-file nixpkgs
<clever> instantepiphany: also, you shouldnt really be using nix-env inside nix-shell, its installing things into your user, that will persist even after you leave the shell
<clever> instantepiphany: but if you `nix-env -iA nixos.hello` it will check the nixos channel on the host system
<clever> instantepiphany: yes and no, if you `nix-env -f '<nixpkgs>' then it will search for a `nixpkgs` inside the `output` directory
<clever> instantepiphany: nix-env will only obey that if you do something like `nix-env -f nixpkgs.nix -iA hello`
<clever> bgamari-: you can limit what packages obey the modified glibc, but the entire closure of you program would still have to be rebuilt
<clever> tommyangelo: using query, delete, and du, you can figure out why the large paths are still around, and delete them
<clever> tommyangelo: `nix-store --query --roots /nix/store/12725jwvrfjqkmpd58h9wnvpwl1zmscg-ghc-8.2.2` will tell you why a given ghc is still around, and `nix-store --delete /nix/store/12725jwvrfjqkmpd58h9wnvpwl1zmscg-ghc-8.2.2` will delete it (dont force it)
<clever> tommyangelo: can you start with this command and tell me the output? `du -h --max=1 /nix/store | sort -h`
<clever> tommyangelo: `nix-collect-garbage` should have gotten rid of it
<clever> pjan: you can also install screen/tmux, and run a curses based irc client like irssi
<clever> pjan: it will appear on your gist.github.com page, from any device
<clever> pjan: `nix-env -iA nixos.gist` then `gist --login` and `gist -p logfile.txt`
<clever> pjan: what is the full output of nixos-install?
<clever> thought you where talking about the pool not being closed properly at shutdown
<clever> ahh
<clever> hyper_ch2: offline just stops writes, which can lead to the pieces of the mirror getting out of sync with eachother