2018-04-09

<clever> you still need luck if you want it done by the time you wake up :P
<clever> with any luck, it might be done by the time you wake up
<clever> just go to bed :P
<clever> ive had perl configure run for several hours
<clever> yeah, that can take forever
<clever> ah
<clever> Myrl-saki: whats the last thing it output?
<clever> you?
<clever> id say rebuild nix with nix
<clever> yeah
<clever> not sure about that config you pasted
<clever> Myrl-saki: also, you can set a default for that in nix-daemon's env
<clever> trusted-users = builder
<clever> [clever@system76:~]$ cat /etc/nix/nix.conf
<clever> Myrl-saki: desktop is freezing up
<clever> but your nix was still in roots profile
<clever> ah, then its mostly single-user
<clever> cbarrett: who owns /nix/store/ ?
<clever> the darwin installer defaults to that
<clever> cbarrett: then you are using a multi-user install
<clever> cbarrett: where does ~/.nix-profile point for the non-root user?
<clever> cbarrett: those are supposed to be there
<clever> cbarrett: `sudo -i` then `nix-env -iA nixpkgs.nix`
<clever> cbarrett: what does `type nix-store` return?
<clever> avn: just add xlibs.libX11 and pkgconfig to buildInputs
<clever> xlibs.libX11.dev 371 r /nix/store/2802m84rk70vac9n6wz6d8cgzzzk2600-libX11-1.6.5-dev/lib/pkgconfig/x11-xcb.pc
<clever> [clever@amd-nixos:~]$ nix-locate x11-xcb
<clever> hakujin: its simpler to just manually run nix copy after nix-store has finished
<clever> fendor: does xterm work from the same shell?
<clever> fendor: i suspect that whatever your building has fully built, and the exec in `stack exec` is now running a gui program
<clever> Myrl-saki: check to see if gcc is running on the remote machine
<clever> no
<clever> yep
<clever> it will push the .drv over
<clever> not sure what that will do to things
<clever> Myrl-saki: i think its been fixed
<clever> the normal build slave config in /etc/nix/machines
<clever> Myrl-saki: just nixos-rebuild and it will just work
<clever> Myrl-saki: v6 and v7
<clever> TweyII: nix-push
<clever> so the compiler will think you have an armv7l cpu
<clever> oh wait, but the qemu-user stuff is a fake "native->native" build
<clever> and the native vs cross will always have different paths
<clever> any change to the flags will affect the storepath
<clever> just add it to imports and qemu-user.arm = true;
<clever> Myrl-saki: i recently made this nixos module to simplify the process: https://github.com/cleverca22/nixos-configs/blob/master/qemu.nix
<clever> Myrl-saki: probably
<clever> Myrl-saki: what boomshroom said
<clever> nix-shell cant use any sandbox features
<clever> Myrl-saki: if your not using sandboxes, its less of an issue
<clever> Myrl-saki: if you built nix manually with ./configure && make && make install, some of the parts of the nix sandbox wont work
<clever> Myrl-saki: also, nix sandboxes only work if the nix itself was built with nix
<clever> Myrl-saki: not sure, the defaults have changed and the options been renamed
<clever> Myrl-saki: install the sodium-dev package and re-run configure to add support
<clever> kreisys: now to figure out why this segfaults constantly...
<clever> [clever@amd-nixos:~/apps/nixpkgs]$ nix build -f . teamspeak_client --arg config '{ packageOverrides = pkgs: { libpulseaudio = pkgs.enableDebugging pkgs.libpulseaudio; }; allowUnfree = true; }'
<clever> kreisys: yay
<clever> thats a bit odd
<clever> kuri0: when installed to the same usb stick?
<clever> Elorm[m]: you probably want .xprofile
<clever> Elorm[m]: when .xsession exits, the entire session is terminated
<clever> i believe it will work on any linux platform
<clever> it should
<clever> but libredirect does not!
<clever> i found a bug in libredirect a few months ago, turns out several syscalls like stat() will happily accept a null pointer as a filename
<clever> this example remaps /usr/share/X11/xkb
<clever> kuri0: libredirect is the answer
<clever> an FHS user env is almost never the answer
<clever> kuri0: it will need to be patched
<clever> tnks: that can help if the derivation is in the binary cache, and you only want to link to the library
<clever> as long as you pass a sha256 to the fetch functions, that might work
<clever> recursive nix currently isnt an option
<clever> and parse the result at build-time
<clever> then dont import it, but just pass its output path as a normal input
<clever> and things will never not be built yet
<clever> if you do things properly, nix will always build the thing before you can use it
<clever> not that i know of
<clever> using maybe jq
<clever> kreisys: fromJSON looses context, so you must pass that json into the derivation, and parse it at build-time
<clever> kreisys: i have a feeling these are the problem
<clever> magic.nix: context = importJSON contextJson;
<clever> witchcraft.nix: context = importJSON contextJson;
<clever> need to check each step
<clever> not sure yet
<clever> so i need to see how the data got from the fetchurl to the mkUntarPackageScriptlet
<clever> your somehow loosing the nix context along the way
<clever> where does it get the full context from?
<clever> dependenciesFor maybe
<clever> the values given to it lack context
<clever> so the problem is with mkUntarPackageScriptlet maybe
<clever> ../../voodoo.nix: tar xf ${attrs.npmPackage} --warning=no-unknown-keyword --directory=$moduleDir --strip-components=1
<clever> so nix doesnt give you the tar in the sandbox
<clever> so you passed it a string in buildCommand, that lacked context
<clever> this is inside the buildCommand
<clever> ntar xf /nix/store/9pawlbxkvpb4wjibvbjv6vm6z87pnlzn-node-cli-cursor-2.1.0.tgz
<clever> nixos
<clever> so nix doesnt think you depend on them
<clever> you somehow lost the context on those tar files
<clever> while yours just keeps going
<clever> so mine fails the moment it does something bad
<clever> which forces you to declare inputs properly
<clever> i have sandboxing enabled

2018-04-08

<clever> how is it getting these paths...
<clever> builder for '/nix/store/0givz1pbazsywgi5388rsd3qa72v78hy-node-hello-1.0.0-modules.drv' failed with exit code 15
<clever> let me have a closer look
<clever> not really
<clever> and thats how nix builds the build-time dependency tree
<clever> and when you pass that string into any new builtins.derivation call, it collects all of the context, and uses that to know what the inputs are
<clever> and if you do any string manipulation with that magic string, the context spreads like an infection, and all strings based on it have the same context
<clever> any time you call builtins.derivation {a set} in nix, it will generate a magic string, that points to the output, and it has some extra "context" attached to the string, to say which derivations it depends on
<clever> do you know how the string context works?
<clever> i think part of the problem here, is that the context is too invisible
<clever> so you must never use readFile on something that refers to store paths
<clever> readFile has the sameproblem
<clever> not with nix
<clever> you must pass the whole json file to the derivation, and parse it at build-time
<clever> that will have the same problem
<clever> yeah, no signs of context tracking there
<clever> i think
<clever> so you can never read a json file with storepaths
<clever> fromJSON doesnt support dependency tracking
<clever> it must also be a build-time dependency, for it to even look for that hash
<clever> let me check something...
<clever> how are you passing those values into this derivation?
<clever> so nix doesnt consider them as inputs anymore
<clever> but you somehow broke the dependency tracking on the strings
<clever> inputs can be in any attribute
<clever> this derivation doesnt depend on its inputs, so the build fails here
<clever> tar: /nix/store/if4n5zak610pxxd6j43i4kv0zha6xsya-node-ansi-styles-3.2.1.tgz: Cannot open: No such file or directory
<clever> building '/nix/store/0givz1pbazsywgi5388rsd3qa72v78hy-node-hello-1.0.0-modules.drv'...
<clever> try doing it in its own derivation with just writeText to make things simpler
<clever> it should depend on the things its refering to
<clever> kreisys: to start with, use pkgs.writeText to just make a file that contains a single string from selfAndNoDev, and then `nix-store -qR` that result
<clever> yeah, i'm starting to get lost, lol :P
<clever> kreisys: where does mapPackages come from?
<clever> kreisys: which file generates nix.json?
<clever> the linux kernel has its fair share of curse words :P
<clever> can you gist it?
<clever> what is the derivation that made that file?
<clever> you have to pass the whole path to the json into a derivation, which reads it without nix
<clever> also, i think buildins.readFile looses the dependency info
<clever> run nix-store -qR on the output json and see what it says
<clever> if you are given storepaths as inputs, and include those in the output, it should know you depend on them
<clever> lol
<clever> which in your case, would produce several gig
<clever> yarn2nix avoids circular issues by just doing the entire `npm install` inside a single derivation
<clever> i also got yarn2nix tweaked to not rebuild things on every minor change
<clever> yarn2nix works by generating a .nix file, and then importing it using import-from-derivtion
<clever> the other users wont have those paths, and it will fail
<clever> and it wont work to commit anything with storepaths
<clever> you need to use just raw string manip to make the nix file
<clever> yeah
<clever> kreisys: or just use nix to pass the derivations into it directly?
<clever> kreisys: what if you generate a nix file, not a json file?
<clever> ow!
<clever> kreisys: how big is your finished node_modules?
<clever> kreisys: i recently worked on a project using yarn2nix, and it works great
<clever> kreisys: why are you giving it a storepath in json?
<clever> seafood: yep
<clever> kreisys: un-quote the path
<clever> yeah
<clever> and will be constantly changing
<clever> that contains the state of every other branch
<clever> ruhatch: does the .git directory exist in the output?
<clever> ThatPako: hardware.sound.enable had its default changed
<clever> nix-copy-closure --to root@remote /nix/store/hash-foo
<clever> jackdk: nix-copy-closure can also copy finished builds to another box
<clever> yeah
<clever> or if you already have an installPhase, just do it there
<clever> jackdk: id do it in postInstall
<clever> jackdk: the PERLPATH has to be setup right
<clever> jackdk: i just use cp
<clever> rotaerk: which then goes into buildInputs
<clever> rotaerk: librarySystemDepends is just added to the giant otherBuildInputs list
<clever> ah right, let me check something
<clever> rotaerk: i think the issue is that the override in default.nix doesnt affect the .env attribute
<clever> what about $srcs ?
<clever> thats strange
<clever> but inside the nix-shell, do echo $src
<clever> does $src/.git exist?
<clever> double check what $src is
<clever> i think the .env is undoing the overrides on line 40/41
<clever> echo $librarySystemDepends would get it, but may also include other things
<clever> ah, the haskell mkDerivation complicates it a bit
<clever> rotaerk: you can also add foo = hello; in the nix, and then just use $foo in the nix-shell

2018-04-07

<clever> ah, i'm guessing the tmpfiles stuff changed how things works
<clever> abrxs: so you might need to chmod after you copy
<clever> abrxs: when you copied the file, the copy is still read-only
<clever> abrxs: in the prestart, run id, and ls -lhd ${cfg.stateDir}
<clever> and what is the error in the journal? can you add that to the gist?
<clever> abrxs: why not just -C ${confFile} ?
<clever> achambe: exactly the same thing i did here
<clever> achambe: it returns a string with the storepath
<clever> abrxs: you will want to set createHome and home then, and nixos will make the directory for you
<clever> abrxs: is the User field set on the service?, the preStart may not have permission to create the directory
<clever> abrxs: does /var/lib/servicename/conf.yml exist?
<clever> not sure
<clever> yep
<clever> mkaito: its a bit ugly, but you could use another activation script and mkAfter, to redo the chmod every time nixos changes it
<clever> mkaito: its hard-coded to 700 in the perl, i think an issue may have been opened for it
<clever> joko: ive got plain-text logs i could search
<clever> joko: linked a line of source that is relevant
<clever> i dont think it has an open issue
<clever> yep
<clever> but how does that nix file extract the tar?
<clever> and when you put a tarball into the NIX_PATH, it uses the same code
<clever> nix, builtins.fetchTarball cant unpack tar's inside that dir
<clever> simplest thing, just unpack nixpkgs manually and give nix a dir
<clever> tilpner: i think the problem is that its invoking tar without the /tmp/foo prefix on its input file
<clever> heh
<clever> MichaelRaskin: yeah, i just dont have that syntax memorized
<clever> and even if the entire os is installed, it has to re-build and re-download it all in ram, then copy the differences to disk
<clever> which required enough ram to store the entire closure!!
<clever> a while back, nixos-install was rewritten to nix-build it on the host
<clever> joko: the above might even fix a bug nixos-install had (unsure if 18.03 has it)
<clever> only thing missing is using the host store as a binary cache, and installing the bootloader under chroot
<clever> nix build '<nixpkgs/nixos>' -A system --store local?root=/mnt/
<clever> thinking about it...., i could implement 90% of nixos-install with a single nix command...
<clever> joko: replaced by nixos-enter
<clever> zybell_: there is also some rough categories
<clever> the last person i helped with this issue, it was just network io
<clever> achambe: if you go into `alsamixer -c 0`, and try to unmute everything, does it start working?
<clever> achambe: and on the playback tab, is it muted?
<clever> what happens when you run pavucontrol?
<clever> achambe: does alsamixer show any devices?
<clever> achambe: have you rebooted since applying that change?
<clever> and with the generations gone, there is a lot of new garbage!
<clever> iqubic: it then does the normal garbage deletion that nix-collect-garbage always does
<clever> the default was changed recently
<clever> achambe: hardware.sound.enable = true;
<clever> it wont run under windows, but most tools that can read an exe can work with it
<clever> infinisil: if you then use dd to extract a section of the bios, starting at offset 0x47EBAC, you get a perfectly valid .exe file, which can be read by tools like objdump
<clever> its like ELF for linux or mach-o for darwin
<clever> it doesnt use the windows api's, but it uses the PE file format
<clever> infinisil: yeah, efi is entirely based around that file format
<clever> if your not, its a paper weight!
<clever> if your lucky, it works
<clever> and then reflash the chip with flashrom
<clever> infinisil: so you could just insert another into the list
<clever> infinisil: uefi firmware is much more standardized, its basically a giant array of .exe files, which get initialized on bootup, before it looks for the boot media
<clever> infinisil: and then my efi system partition can be ext3 on nvme, lol
<clever> infinisil: in theory, i could unpack the bios, insert an extra PE32/PE64 binary that provides drivers for ext3 or nvme, and then repack the bios
<clever> infinisil: i was also directed to this, but never got around to packaging it: https://github.com/LongSoft/UEFITool
<clever> so there is no way to reprogram the bios from within
<clever> both my laptop and desktop lack flashrom support
<clever> and with the right tools, you can datamine the crap out of it
<clever> and the zip files contain more of the same
<clever> the nas is uefi, it has .zip, PE, jpeg, gif, and png signatures everywhere
<clever> the router is legacy, and the bios is almost entirely unreadable binary garbage
<clever> my router and nas support flashrom, it is able to at least read the bios image
<clever> i looked into coreboot a bit a month ago
<clever> and efi booting only finds it if the firmware supports it
<clever> legacy booting will never find nvme at the grub level
<clever> i discovered this when i tried to put the MBR + stage 1.5 onto a dumb sata disk with /boot on nvme
<clever> yeah
<clever> and it relies on the EFI providing the nvme support
<clever> yep, but grub needs to be able to find linux first
<clever> without drivers, its just an unknown pci device
<clever> you need drivers to turn it into a block device
<clever> but my laptop can
<clever> which means my primary desktop can never have /boot on nvme
<clever> it relies on the uefi services the firmware provides, so you have to rely on your motherboard oem giving you nvme support
<clever> yet it can still boot from nvme!
<clever> another fun fact, grub has no nvme support
<clever> yeah
<clever> but only if your using nvme
<clever> lines 50/51, 53, 54, 66-68, 70/71, and maybe some more, need a p
<clever> infinisil: line 44, the disk has just been nuked from orbit, no partition tables exist
<clever> but that doesnt help with creating names for sfdisk to create partitions of
<clever> infinisil: nice!
<clever> you wind up telling it to create /dev/nvme0n11
<clever> and rootDevice is /dev/nvme0n1
<clever> if you use this, to tell sfdisk to create a partition
<clever> ${cfg.rootDevice}1 : size=${toString (2048 * cfg.bootSize)}, type=83
<clever> infinisil: there is, but this problem was during partition creation
<clever> lejonet: yeah
<clever> tos9: your welcome :)
<clever> and without the p, the partition creation tool saw /dev/nvme0n1p11 and created partition 11, then failed to find 1
<clever> but nvme, is /dev/nvme0n1 and /dev/nvme0n1p1
<clever> so /dev/sda + 1 is /dev/sda1
<clever> the script assumes ${device}${partition} for partitions, and ${device} for the device
<clever> infinisil: that also broke my justdoit script
<clever> the uefi firmware has been modified to support that
<clever> apple also tends to use HPFS+ for their /boot's
<clever> and also, just guess, and ls to see if it looks nixos-y
<clever> tos9: blkid /dev/sd*
<clever> Lisanna: and cmake if the project is a bit more complex
<clever> tos9: you still need to mount your rootfs to /mnt, your store to /mnt/nix and your boot to /mnt/boot, the same as when you initially installed
<clever> so there is no point in checking the size of things
<clever> the makefile assumes its being used inside nix, and that the compiler is sane