2017-04-25

<clever> [root@amd-nixos:~]# nix-collect-garbage --max-freed 1m
<clever> which it refuses to gc
<clever> joepie91: when i check my box, i can find stuff i forgot about ages ago
<clever> lrwxrwxrwx 1 root root 23 Mar 12 15:17 26kqyvvf6h9chi30fachc8hkx8553a54 -> /home/clever/srk/result
<clever> ah
<clever> joepie91: about?
<clever> idealy, man.nix would define a hook in a list, and system-pack.nix would run it
<clever> bennylb: if you set programs.man.enable = false;, it will omit man-db from the system packages, and skip the .man output of every package in the systemPackages
<clever> bennylb: not currently, see the TODO on line 130
<clever> bennylb: for things installed system wide, it would have to be done here: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/config/system-path.nix#L131
<clever> bennylb: i have noticed that the whatis database is missing
<clever> so they have to be deleted when starting the program
<clever> sellout-: unix sockets are weird like that, they will persist on the filesystem, but its imposible to re-open them
<clever> sellout-: oh, and what OS is this on?
<clever> sellout-: double-check ps aux to confirm its not already running, and if its gone, delete the socket
<clever> joepie91: and if i ls that on my main nixos box, i find 133 things with roots laying all over the system
<clever> joepie91: also, all indirect roots land in here
<clever> lrwxrwxrwx 1 clever clever 23 Apr 25 14:09 /nix/var/nix/gcroots/auto/6l1sr3ajddd5nwgjp09r69nyky0kwi2p -> /home/clever/hello.root
<clever> it just ignored the boot priority if uefi was on
<clever> Tipping_Fedora: i had to entirely disable uefi to even make linux boot on my system
<clever> Tipping_Fedora: ive never gotten uefi to actualy boot on any of my systems, and i havent heard anything about how to configure it to dual-boot
<clever> that does sound like it would help with things
<clever> and there are more complex rules on where it has to go
<clever> and youll never find it again
<clever> if you dont make it indirect, it will get lost within /nix/var/nix
<clever> i just keep them in home
<clever> it can be put anywhere you can write to
<clever> and i dont think it allows it in the store at all
<clever> mainly so you can delete it later
<clever> and as long as that symlink remains there, hello cant be GC'd
<clever> i now have a symlink in my home dir, that points to the build of hello
<clever> lrwxrwxrwx 1 clever clever 54 Apr 25 14:09 hello.root -> /nix/store/jl72gxms9rg3czv3wj1rskw6n0h3k6gm-hello-2.10
<clever> /home/clever/hello.root
<clever> clever@c2d ~ $ nix-store -r /nix/store/jl72gxms9rg3czv3wj1rskw6n0h3k6gm-hello-2.10 --add-root /home/clever/hello.root --indirect
<clever> as an example, say i have the storepath "/nix/store/jl72gxms9rg3czv3wj1rskw6n0h3k6gm-hello-2.10"
<clever> the root must be in an area you have write permissions to
<clever> but you dont need root to delete <x>
<clever> joepie91: and if you delete <x>, the chain is broken, and it can gc <y>
<clever> joepie91: nix-build -o and nix-store --add-root <x> --indirect both create that type
<clever> joepie91: indirect roots work by making a symlink chain from /nix/var/nix/gcroots/auto/ to <x> to /nix/store/<y>
<clever> joepie91: it will create an indirect root, that uses /home/clever/jvm.root
<clever> joepie91: that is the output path, the same as nix-build -o
<clever> joepie91: then you run my cmd on the storepath, to create a symlink to it, that will become a gc root
<clever> joepie91: after you do nix-prefetch-url you will get a storepath for it
<clever> simukis_: yeah
<clever> simukis_: nixpkgs.config.packageOverrides = pkgs: { package1 = pkgs.callPackage ./package1.nix {}; };
<clever> and if its not yet in the store, it will fetch it from a binary cache
<clever> joepie91: this lets you add a gc root to anything that is in the store or binary cache
<clever> nix-store -r /nix/store/foo.tar.gz --add-root /home/clever/jvm.root --indirect
<clever> if the user puts a set of mods into ~/.nixpkgs/ and then does factorio.override { mods = [ ./mod1.zip ./mod2.zip ./mod3.zip ]; } in config.nix
<clever> ./modfoo.zip is one way around that
<clever> i also had to deal with the auth wall just for the game itself
<clever> ah yeah
<clever> so it can have deps
<clever> maybe also make those entries attrsets
<clever> joepie91: i think the user would need to provide a list of either fetchurl's or ./modfoo.zip's
<clever> ah, that helps
<clever> joepie91: yeah
<clever> joepie91: for chromium, i believe it accepts a cli arg, and its simpler to put stuff elsewhere
<clever> joepie91: so i had to copy the ts binary, and symlink everything that wasnt changing, just to put the plugins in a different derivation
<clever> joepie91: in the case of teamspeak plugins, it tries to follow any symlinks and find the real ts binary, then look relative to that
<clever> i'm a dude :P
<clever> dcz: use something like fetchurl or fetchFromGithub to download that revision, and import the result of the fetch
<clever> thats harder to notice then the join-spam
<clever> and thats why i know what matrix is, lol
<clever> oh, its not there
<clever> ben: nix-store
<clever> ben: there is also a nix-store --add or --add-fixed
<clever> CcxWrk: you can also run nix-env -i ./result and i believe it will install it into the profile
<clever> Tucky: then it will relay such access to the daemon, that has write
<clever> Tucky: you must run nix-daemon as root and set NIX_REMOTE=daemon
<clever> CcxWrk: if you run nix-build against that file, it should make a result symlink that contains the cross compiler commands
<clever> and screen was pretty glitchy even with all of them available
<clever> that works
<clever> niksnut: but then how will i get my physical vt100 terminal to work?!
<clever> yeah
<clever> Profpatsch: ah, so there is only the issue of how it will serialize when i try to insert things in the middle
<clever> Tucky: i mostly just wait for permission errors to remind me about what i missed
<clever> Tucky: each user needs write to their own per-user folder, so they can manage their profile and channels
<clever> Tucky: yeah
<clever> Profpatsch: ah
<clever> Profpatsch: for example, i want a program that can set boot.loader.grub.device = "/dev/sda"; in a configuration.nix string
<clever> Profpatsch: i'm thinking of automated editing of a nix file
<clever> Profpatsch: is it possible to turn a nix file into an AST, then turn it back into a nearly identical nix file?
<clever> unlmtd[m]: havent seen that before
<clever> ive also memorized the source for the kernel as well
<clever> heh
<clever> and you can read the state-1-init.sh in the same dir to see the usage
<clever> unlmtd[m]: its as simple as doing @foo@ in the config, and then setting foo="${vim}/bin/vim";
<clever> unlmtd[m]: then you need a derivation that can apply sed to it
<clever> unlmtd[m]: if the config is in a nix file, you can just do ${vim}/bin/vim
<clever> CcxWrk: line 13 gets the cross binutils and gcc
<clever> CcxWrk: that was an example i made a few months ago, that skips making a libc capable gcc
<clever> steveeJ: and any time nix tries to cast a path to a string, it will copy the entire thing to /nix/store, if its not there already
<clever> steveeJ: if you do src = ./.; then nix will cast it to a string, and the 2 will work the same

2017-04-24

<clever> but some display managers may try to optimize that away
<clever> disasm: then systemd has to re-launch it, with the new config
<clever> disasm: i think the display manager will typicaly exit when you logout
<clever> Tipping_Fedora: you can also add yourself to the wheel group
<clever> nschoe: licensing reasons
<clever> it will use the key you made when running as the "hydra" user to check it out
<clever> qknight: in my case, the input is a git checkout of git@github.com:cleverca22/privaterepo.git
<clever> and use the ssh url in the hydra gui
<clever> just give hydra's ssh key read-only access to the repo
<clever> ah, then you can probably do similiar in there
<clever> qknight: and the ssh key in my hydra is linked to that github account
<clever> qknight: that github user has access to private github repos
<clever> qknight: then you can put an ssh based url into the build inputs, the same one you would use for pushing back to github
<clever> qknight: and give that ssh key access to your source, in my case, https://github.com/cleverca22-hydra
<clever> qknight: first, do "sudo -u hydra -i" and run "ssh-keygen" to make a keypair, no passphrase
<clever> qknight: yeah, ive done that as well
<clever> kuznero: those are explained on http://howoldis.herokuapp.com/
<clever> kuznero: try this one: nix-env -iA fsharp41 -f https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable-small.tar.gz
<clever> kuznero: nixos-unstable is 8 days old, that PR is 7 days old
<clever> jophish: you will need to patch it to #!${bash}/bin/bash, using the cross-built bash
<clever> jophish: which will probably be the x86 one
<clever> jophish: oh, if you have #!/bin/bash or #!/usr/bin/bash, it will patch it to $(which bash)
<clever> taktoa: there is now an option you can set at runtime to turn down the holepunching
<clever> jophish: the cross-compile stuff has been redone since i last used it, so id need to look into it again
<clever> kuznero: what about nix-env -iA fsharp41 -f https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz
<clever> Tipping_Fedora: and if its pre-compiled, you will need to patchelf it: https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/instant-messengers/skype/default.nix#L44
<clever> qknight: in nix.buildMachines via configuration.nix
<clever> qknight: you can set localhost as a buildslave
<clever> Tipping_Fedora: you would need to write a package
<clever> qknight: you will also need to configure system-wide known-hosts entries for each build slave: https://gist.github.com/cleverca22/43d0576b427fa85ce0efab81e99a84a8#file-hydra-configuration-nix-L30-L32
<clever> Tipping_Fedora: let me find the url
<clever> Tipping_Fedora: Dezgeg has built sd card images for the rpi
<clever> qknight: first option in https://nixos.org/nixos/options.html#buildmach
<clever> qknight: yeah, you need to populate nix.buildMachines
<clever> Tipping_Fedora: https://nixos.org/nixos/packages.html
<clever> and master will lead to a lot more compiling
<clever> qknight: if you just add https://github.com/nixos/nixpkgs, then it will follow master
<clever> qknight: this makes it follow the nixos-unstable-small channel
<clever> qknight: at the very top, enabled/one-shot/disabled
<clever> qknight: and you have disabled checked
<clever> qknight: the $NIX_PATH is also clear, and you didnt tell it where to find nixpkgs
<clever> qknight: you want just jobset-nixpkgs.nix
<clever> qknight: there is no hydra-tutorial sub-dir in the hydra-tutorial repo, so the nix expression in that screenshot is invalid
<clever> qknight: and if you want to copy how the main hydra does nixpkgs, you can just look at http://hydra.nixos.org/jobset/nixpkgs/trunk#tabs-configuration
<clever> qknight: hydra will eval the default.nix file in the hydra-example input (which is on my github), and then build every attribute in the file
<clever> qknight: here is an example i setup a while back: http://hydra.earthtools.ca/jobset/hydra-example/example-master#tabs-configuration
<clever> qknight: do you want to build a custom project, or all of nixpkgs?
<clever> qknight: 32 or 64bit machine?
<clever> unlmtd[m]: we also have #arcane-chat on freenode already
<clever> unlmtd[m]: me and taktoa also have plans for an entire chat program, text+voice+video
<clever> unlmtd[m]: a list of random things i have plans to finish, a gui installer for nixos, ssh agent forwarding in nix-build, a haskell display manager for nixos, fuse mounting for /nix/store
<clever> ive memorized large chunks of nix and nixpkgs code, and have ideas on how to improve a number of htings
<clever> heh
<clever> unlmtd[m]: and this may also cause problems: https://github.com/NixOS/nixpkgs/issues/22318
<clever> unlmtd[m]: oh, even better: https://github.com/NixOS/nixpkgs/issues/24691
<clever> unlmtd[m]: maybe related: https://github.com/NixOS/nixpkgs/issues/24717
<clever> ben: it creates an instance of callPackage, that will search inside super for the default argument values
<clever> yeah, ive heard of that as well
<clever> ZoomZoomZoom: which i think would be put into nix as serviceConfig.PermissionsStartOnly = true;
<clever> ZoomZoomZoom: try running the "id" command in prestart, before the mkdir
<clever> ZoomZoomZoom: is a user set on the service?
<clever> and i should have the choice to remove curl, rsync, strace, tar, diff
<clever> for example, i cant remove nano, ever
<clever> gchristensen: i think some of these are also un-needed
<clever> gchristensen: rogue runs on tty9, and the manual is on tty8
<clever> oh yeah, and there is a 1 byte mistake in one of the docs
<clever> maybe even a fork bomb, lol
<clever> i have seen one or 2 that try to source $stdenv/setup inside a normal phase, which will probably cause infinite recursion
<clever> and i always see people either using a custom builder, or an FHS env when they are new to nix
<clever> gchristensen: oh, and i think this part of the manual needs work, using a builder like that can often completely break the ability to override things
<clever> jophish: you wouldnt replicate the commands exactly, but it would remind you about weird things you may have had to edit
<clever> cant remember who has push access to accept it
<clever> gchristensen: hows this look? https://github.com/NixOS/nixpkgs/pull/25177
<clever> simp__: can you gist your current configuration.nix?
<clever> and you could use the recording as a guide when making a proper derivation
<clever> jophish: thats an idea, record the commands you run, and leave the $out in result/ (not as a symlink, a real dir)
<clever> gchristensen: also, i need to look into that ssh agent forwarding idea with nix
<clever> and it could just throw away $out when your done, impurities are not allowed in the real /nix/store!
<clever> gchristensen: another nix-shell mode, beyond --pure, where it just treats nix-daemon as an ssh server, and gives you a shell inside a real sandbox
<clever> gchristensen: oh, that gives me an idea
<clever> so i had to manualy make $out, and give myself write, to simulate a nix sandbox
<clever> and root gives it write to the inputs and doesnt reproduce the failure
<clever> but a normal nix-shell installPhase fails, because it also lacks write to $out
<clever> (as it should!)
<clever> and because i setup nix-daemon on the mac, it lacked write to its inputs
<clever> one of the install phases was trying to install things to a dependency
<clever> which reminds me of a bug i saw in qt on osx
<clever> so you must damage the build state to even open a shell in it
<clever> and if that already exists, nix-shell fails
<clever> and nix-shell'ing creates a __nix_qt5__ in the pwd
<clever> and some things like QT need a preconfigure hook ran to make qmake even function
<clever> gchristensen: for that, i build with -K, then nix-shell and cd
<clever> and the tooling has known log files that it hides info in
<clever> may be of more use in standardized languages like haskell or rust, where there is a standard package format already
<clever> but you would need a general idea on what could fail in the future, and make it save things before it fails
<clever> for example, save config.log to $out, so you can debug it without having to reproduce it locally
<clever> you can also set failureHook to a snippet of bash, that will do such logging
<clever> so you could log details on the failure to $out
<clever> i think hydra also counts that as failed, but lets you download the $out
<clever> and will cache whatever it left in $out
<clever> then nix will consider it as finished, not failed
<clever> jophish: if you set succeedOnFailure=true; in a build, then any fatal error code will update $out/nix-support/failed and "succeed"
<clever> jophish: oh, there is another thing of interest
<clever> try a different wm?
<clever> simp__: there is a listing on https://nixos.org/nixos/options.html#desktopmana
<clever> simp__: i think you also need to enable a desktop manager
<clever> simp__: can you gist the current configuration.nix?
<clever> simp__: i believe you need to set .enable=false on the other ones
<clever> simp__: and i think you can only have 1 display manager active at once
<clever> simp__: yeah, services.xserver.displayManager.sddm.enable = true;
<clever> jophish: i think it should be rpath'd into the elf at compile time
<clever> so i havent had time to learn what wierd things i3 can doo
<clever> i just stick to plain old xfce
<clever> but not the stuff done with nix-env (that has its own --rollback option)
<clever> simp__: it also rolls back the software installed system wide
<clever> are you able to ssh in from another box?
<clever> ah
<clever> simp__: xorg crashing after you login?
<clever> with 16 of the, id expect it to be more spread out
<clever> heh
<clever> Dezgeg: coprocessor 15 handles performance counters, and from your last link, i think it also does some atomic stuff
<clever> Dezgeg: this may help: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dai0195b/index.html
<clever> dcz: add one of these to the derivation: hardeningDisable="all"; or hardeningDisable = [ "stackprotector" ];
<clever> dcz: ah, the hardening options are only tested on 5, one sec
<clever> jophish: freenode has both #ghc and #haskell
<clever> i dabbled in that a bit when trying to make oprofile work
<clever> ah, its co-processor stuff again
<clever> took me a while to find it, havent been to that corner of the arm docs yet
<clever> Dezgeg: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0489i/Cihfifej.html
<clever> right
<clever> ah
<clever> dcz: did you re-run nix-shell after making that change?
<clever> dcz: put gcc48 into the .override of stdenv, where gcc5 currently is
<clever> lukego: and if you still want to protect the variable using the bash ${foo}, it needs escaping: "echo \${srcs}"
<clever> lukego: just $srcs, ${srcs} tries to reference a nix variable
<clever> jophish: 2017-04-24 09:26:18 < Dezgeg> or gdb it, once it hits SIGILL do x/5i $pc to see what instruction it crashed on
<clever> lukego: can you gist your current code?
<clever> nix-repl> lib.concatMapStringsSep "\n" (x: "echo ${x}") [ "a" "b" "c" ]
<clever> "echo a\necho b\necho c"
<clever> lukego: or you could also concatMap in nix to unroll the loop
<clever> lukego: if srcs= is on the derivation, nix will turn it into a $srcs env variable automaticaly, then you can use a normal bash for loop
<clever> i also have a different FP_arch
<clever> Tag_FP_arch: VFPv3-D16
<clever> jophish: i'm not seeing neon in my rpi2 builds, you may want to double-check that the cpu can support everything listed
<clever> dcz: then you can just tab-complete any package, or :b hello to build one
<clever> dcz: nix-repl '<nixpkgs>' to load up nixpkgs
<clever> though if you have a v7 cpu, it should just work on v6 and v7
<clever> and -A as well, which shows sub-arch level stuff (v6 vs v7)
<clever> Tag_CPU_name: "7-A"
<clever> root@raspberrypi:~# /nix/store/rbd67ylkmx2fpci7k4d4kaf6lnwrikyv-binutils-2.28/bin/readelf -A /nix/store/rbd67ylkmx2fpci7k4d4kaf6lnwrikyv-binutils-2.28/bin/readelf
<clever> jophish: try running an arm objdump against the ghc with -d
<clever> root@raspberrypi:~# /nix/store/rbd67ylkmx2fpci7k4d4kaf6lnwrikyv-binutils-2.28/bin/objdump -d /nix/store/rbd67ylkmx2fpci7k4d4kaf6lnwrikyv-binutils-2.28/bin/objdump | less
<clever> jophish: one min
<clever> ah
<clever> jophish: one trick, you can copy that shell script to $HOME, then just edit the right bash into the copy, and try running it
<clever> jophish: ah, that will need to be fixed then
<clever> jophish: its an aarch64 cpu right?, does it have backwards compat? which also has to be enabled in the kernel
<clever> jophish: so its either armv6 or armv7
<clever> dcz: and a PR is now open to fix cimg for all!
<clever> jophish: what does "file" say about the binary?
<clever> oops, missed that in the copy/paste
<clever> but qmake is missing from $PATH everywhere else, so no way to use a wrong version by mistake
<clever> ive got another one open elsewhere for a QT project, where i can just qmake && make
<clever> either on the same, or different nix files
<clever> and you can run as many nix-shell's as you want
<clever> so you can do pretty much anything you want
<clever> the packages are described using a turing complete language
<clever> changing the version usualy doesnt need a copy of the entire file, but this package broke the ability to easily change things
<clever> dcz: and if you wanted to change the version of cimg, you would just tweak lines 6 and 10 of cimg.nix
<clever> dcz: line 4 will load a modified form of the cimg package into nix, which should fix all of the paths
<clever> dcz: i just tab-completed under xorg. and found libX11
<clever> simp__: yep
<clever> dcz: not all of the tools can search recursively, its mostly a matter of memorizing the common hiding places, and searching with nix-repl
<clever> yeah, that would be far better
<clever> simp__: so it kept getting corrupt, and i had to repeat the steps at least 10 times, lol
<clever> simp__: i think part of what helped hammer LFS into me, is that i tried to use a laptop with bad sectors
<clever> dcz: and you shouldnt need the env on line 7 of the paste, the mkDerivation is already an env you can shell into
<clever> dcz: all of the xorg stuff is inside the xorg attrset
<clever> dcz: xorg.libX11
<clever> and nix's store makes it trivial to undo changes and keep conflicting versions at the same time
<clever> great for learning, but a pain to maintain over time
<clever> simp__: its basicaly a pile of .tar files and a book full of ./configure ; make ; make install
<clever> which is basicaly nixos, without nix