2019-08-27

<clever> ldlework: 3 paths, all under 1mb, all made ~2 minutes ago
<clever> sqlite> select path, narsize/1024/1024 as narmb, datetime(registrationTime,'unixepoch') from ValidPaths where path like "%BindingAttributes%" order by registrationTime;
<clever> ldlework: add a where path like "%BindingAttributes%"
<clever> ldlework: or just remove the limit entirely, or invert the direction
<clever> ldlework: you want to go the other direction
<clever> ldlework: you set the limit to 1gig
<clever> manveru: yeah, not that hard
<clever> manveru: would need to trace nix-daemon though
<clever> ldlework: that would be a nice improvement you could PR
<clever> DariusTheMede: configuration-common.nix
<clever> DariusTheMede: there is an overrides file in the same directory, so you dont have to edit
<clever> DariusTheMede: hackage2nix
<clever> ldlework: the example i gave limits to >256mb
<clever> ldlework: youll need to adjust the size limitation
<clever> ldlework: i'm not sure if there is an api to sort all paths by registrationTime
<clever> ldlework: part of it is just learning the internals of nix in depth
<clever> ldlework: nix-env -iA nixos.sqliteInteractive
<clever> ldlework: its a caching mechanism, its expecting that you will paste the new hash into the nix expr, and then it will reuse the product it previously made
<clever> pbb: yep
<clever> pbb: pkgsCross.raspberryPi.stdenv.mkDerivation
<clever> pbb: pkgsCross is the cross-compile framework, to cross-compile from current to something
<clever> ldlework: this will list everything in /nix/store over 256mb, sorted by when it was created
<clever> sqlite> select path, narsize/1024/1024 as narmb, datetime(registrationTime,'unixepoch') from ValidPaths where narsize > 256 * 1024 * 1024 order by registrationTime;
<clever> sqlite> .mode column
<clever> [root@amd-nixos:~]# sqlite3 /nix/var/nix/db/db.sqlite
<clever> pbb: pkgsCross
<clever> ldlework: after renaming it to the correct hash, it registers it as valid, and fixes the last-mod to 1970
<clever> ldlework: oh!
<clever> > let foo = "y"; in { x = 42; }.${foo} or "fallback"
<clever> > let foo = "y"; in { y = 42; }.${foo} or "fallback"
<clever> heh
<clever> ldlework: can you pastebin more of the error nix gave?
<clever> ldlework: if you remove the |tail, are there non-lock files?
<clever> Ariakenom: ahh, its the ntfs that ships with linux itself
<clever> you*
<clever> ldlework: yep, your broke ls
<clever> ldlework: `type ls` ?
<clever> ldlework: what did you do to your ls? lol
<clever> Ariakenom: then its the ntfs kernel driver, rather then the fuse one, what about `lsmod | grep ntfs` ?
<clever> ldlework: can you pastebin `ls -ltrh /nix/store/ | tail` ?
<clever> ldlework: the failed output is the only thing that wont be 1969
<clever> ldlework: simplest thing is to check mod-times, ls -ltrh /nix/store/
<clever> ldlework: so, it got renamed, and you have a different hash in /nix/store/
<clever> 2019-08-27 05:40:58 < clever> ldlework: but if a fixed-output drv fails due to a hash mismatch, the $out is renamed to match the hash it actually has
<clever> ldlework: yep
<clever> ldlework: 2019-08-27 05:46:18 < clever> ldlework: still in /nix/store/
<clever> Ariakenom: grep ntfs /proc/filesystems
<clever> near the top
<clever> ldlework: then look at the outputs it lists
<clever> ldlework: nix show-derivation /nix/store/67x8lfbw9dk9xllpkq4z6ppi399zhdvn-BindingAttributes-nuget.drv
<clever> Ariakenom: what does `man mount.ntfs` do?
<clever> ldlework: what was the .drv file it was building? from the error?
<clever> 2019-08-27 05:40:58 < clever> ldlework: but if a fixed-output drv fails due to a hash mismatch, the $out is renamed to match the hash it actually has
<clever> 2019-08-27 05:40:21 < clever> ldlework: any time a build fails, the $out is left at the expected path, but not flagged as valid
<clever> ldlework: still in /nix/store/
<clever> ldlework: every derivation, including fixed-output, has a $out
<clever> ldlework: it increments the number at the end if one is in the way
<clever> so if you fix the expr, it will compute the new name it gets renamed to
<clever> ldlework: but if a fixed-output drv fails due to a hash mismatch, the $out is renamed to match the hash it actually has
<clever> ldlework: any time a build fails, the $out is left at the expected path, but not flagged as valid
<clever> Ariakenom: run `id`
<clever> Ariakenom: you would have to check the manual for the ntfs driver your using
<clever> Ariakenom: the option may be uid=1234, cant remember exactly
<clever> Ariakenom: that must be set to your own id
<clever> Ariakenom: the uid=0 is the problem
<clever> Ariakenom: does it show the difference in `cat /proc/mounts` ?
<clever> Ariakenom: should be enough to umount and then mount again
<clever> Ariakenom: something like options = [ "user=clever" ];
<clever> Ariakenom: the user option needs a user to actually give access to
<clever> Ariakenom: you also have to add a user= to the mount options, standard ntfs stuff
<clever> ldlework: yes
<clever> ldlework: nix-locate or ,locate on the bot
<clever> marler8997: grep doesnt follow symlinks, and it depends on what version of nix your using
<clever> not sure what broke it, but setting NIX_REMOTE is the solution
<clever> marler8997: what does `type nix-shell` report?
<clever> marler8997: `export NIX_REMOTE=daemon` and try `nix-shell` again?
<clever> the full output
<clever> marler8997: `id` ?
<clever> marler8997: ls -lhd /nix/store/
<clever> marler8997: what is $NIX_REMOTE set to?
<clever> marler8997: yes, it works as any user
<clever> ldlework: but now you have to force it to behave the way nix wants it to
<clever> it should fetch, and thats it
<clever> it should not be building dependencies in the fixed-output drv
<clever> ldlework: dependency paths shouldnt be in the fixed-output drv
<clever> jackdk: yeah, that does the same thing, but its not optional on my image
<clever> (but it now needs a few extra gig of ram to boot)
<clever> so once it boots, you can unplug the drive!
<clever> while my initrd, has the whole rootfs inside the initrd
<clever> Guest55: the official iso will mount part of the cdrom when running, and needs the usb/cd inserted to work
<clever> Guest55: the main difference between my initrd and the official iso, is memory usage
<clever> Guest55: you can use nix to make a kernel+initrd pair for nixos, then copy them to a drive and add a menu entry
<clever> Guest55: yeah, thats the kind of thing this nix file was made for
<clever> ldlework: try just `diff -r` at first
<clever> but hydra could also be configured to pre-build these files, and offer them for download
<clever> Guest55: you can use nix-build without nixos, just install nix on any linux distro
<clever> and ive answered this kind of question before, about a year ago
<clever> its easy to add to another bootable media
<clever> you can then shove that onto any bootable media, and configure whatever bootloader you like to obey that fragment of cfg
<clever> Guest55: if you run nix-build on this file, it will create a directory with 3 things, a kernel, a initrd, and a fragment of a grub config
<clever> Guest55: one minute...
<clever> yep
<clever> and then you can have multiple roots, for other hosts, that share some of the nodes/leaves
<clever> nodes in the middle can be groups of leaves
<clever> and the leaves are the config
<clever> the root is just hostname.nix
<clever> my main design is to make a tree of imports
<clever> and i could down the road, add it to the imports of rpi1.nix, to make it active on the pi
<clever> and now its active on the nas
<clever> i then add media-center.nix to the imports of nas.nix
<clever> for example, from my repo, media-center.nix fully configures X11 to load plex on bootup, and run it full-screen
<clever> camsbury: just add gaming.nix to the right imports list
<clever> camsbury: no need to make things conditional
<clever> but you could also set systemPackages from different modules, and nixos will merge them for you
<clever> then you put the option in the one that makes the most sense
<clever> then laptop.nix has imports = [ ./core.nix ];
<clever> camsbury: laptop1.nix, laptop2.nix, laptop3.nix, all 3 have imports = [ ./laptop.nix ];
<clever> camsbury: use hostnames then
<clever> and nothing has to be conditional, because laptop.nix is only used by the laptop
<clever> and configuration.nix symlinks to the right starting point
<clever> camsbury: you start at laptop.nix, or desktop.nix, and then both do imports on a core.nix
<clever> camsbury: instead of starting at configuration.nix, and conditionally loading different things
<clever> camsbury: or restructure it to be a tree with several roots
<clever> camsbury: you want to use mkMerge or imports
<clever> so all of hardware = is gone
<clever> camsbury: line 121, that overwrites the entire hardware key
<clever> notgne2: oh, thats it exactly
<clever> camsbury: and this
<clever> nix-repl> options.hardware.pulseaudio.enable.highestPrio
<clever> camsbury: what about this?
<clever> nix-repl> options.hardware.pulseaudio.enable.files
<clever> [root@amd-nixos:~]# nix repl '<nixpkgs/nixos>'
<clever> camsbury: grep pulse -A3 /etc/nixos/configuration.nix
<clever> camsbury: can you pastebin the full output of `nixos-option hardware.pulseaudio.enable` ?
<clever> camsbury: and is that the one from the github repo?
<clever> camsbury: what does `nix-instantiate --find-file nixos-config` say on the broken machine?
<clever> camsbury: can you pastebin the configuration.nix?
<clever> camsbury: what happens if you run nixos-rebuild switch?
<clever> camsbury: for bool options, if conflicting values are found, nixos will throw an error

2019-08-26

<clever> ldlework: also, contents can be a list
<clever> pie_: it already finished the eval, its now recursively printing out the entire nix expr, i dont think you want --eval
<clever> ldlework: buildEnv
<clever> pie_: can you paste some of the repeating output?
<clever> ldlework: run diff -r on the 2 paths, to see how they are different
<clever> ok, that one happened to work fine
<clever> > '' one'''''$ end ''
<clever> > '' one''' two ''$ end ''
<clever> Miyu-chan: the problem is when you want to put ''' right before ''$
<clever> > let bar = "bar"; in ''foo''\'''\$${bar}''
<clever> but there is no way to make a '$ .....?
<clever> yeah, theres the problem, ''$ turns into $, while '''$ turns into ''$
<clever> > let bar = "bar"; in ''foo'''$${bar}''
<clever> > let bar = "bar"; in ''foo''$${bar}''
<clever> hmm, ah, you want a literal $bar, not a \$bar
<clever> > let bar = "bar"; in "foo'\$${bar}"
<clever> > let bar = "bar" in "foo'\$${bar}"
<clever> lucus16: i think this is identical to your example
<clever> > let bar = "bar"; in ''foo'\''$${bar}''
<clever> lucus16: yeah, i can see the issue...
<clever> ,escape''
<clever> or just "cp ${./hot-mess.txt} hot-mess.txt"
<clever> aveltras: i think so
<clever> and things are seperated enough from the shell above, that the shell wont notice
<clever> then the 2nd disown, exits, without cleaning up its own children
<clever> i think the disown works, by having disown first fork out a child, then that child forks again to make emacs
<clever> that will change the owning tty and process group, and disown the child
<clever> from the old days when you dialed into a machine over a modem
<clever> SIGHUP is sent when you close the terminal, its the hang-up signal
<clever> i think it keeps stdout linked, but will stop the SIGHUP
<clever> dminuoso: nohup emacs &
<clever> sphalerite: yeah, it depends on if you want to forever ride a bike with trainwheels, lol
<clever> cmake helps automate a lot of things, but then you never learn how make itself works
<clever> when i first got into linux, i just obsessively read every man page for every command, lol
<clever> which is explained in the man page for info
<clever> if `info` cant find the info file, it searches for a man page by the same name
<clever> vvbb[m]: https://www.gnu.org/software/make/manual/ is another copy of the manual
<clever> just the standard man page for make, that is shipped with make
<clever> vvbb[m]: nix-shell -p --command "man make"
<clever> and part of it is just knowing how pkgconfig is meant to be used
<clever> vvbb[m]: most of it should be in the manual for make
<clever> just stuff you pick up after using linux for over a decade
<clever> vvbb[m]: the only thing i read was the stack overflow i linked above, the rest was pretty much all memorized
<clever> vvbb[m]: are you using the makefile in my gist?
<clever> vvbb[m]: default.nix returns a set, you want `nix-shell -A simple`
<clever> vvbb[m]: thats how i start most projects
<clever> the refresh button in your browser
<clever> vvbb[m]: refresh the gist
<clever> vvbb[m]: or nix-build -A output && ls -lh result/
<clever> vvbb[m]: nix-build -A simple && ./result/bin/simple
<clever> vvbb[m]: if nothing has change with the code, it wont re-run it, and if you perfectly undo something, it can reuse a previous result!
<clever> vvbb[m]: gist updated, you can now `nix-build -A simple` to build the program, or `nix-build -A output` to both build, and run it, producing a result/hello.png
<clever> vvbb[m]: this builds with both `make` under` nix-shell` and also `nix-build
<clever> hpfr: i believe so
<clever> LarryTheCow: dont think so
<clever> LarryTheCow: journalctl -u sshd
<clever> LarryTheCow: the systemd journal
<clever> vvbb[m]: probably
<clever> vvbb[m]: in your Makefile, do gcc $(pkg-config --cflags cairo) ...
<clever> vvbb[m]: you want to use pkgconfig
<clever> yep, it was the "and friends" part
<clever> tdeo: check the args for writeTextFile then
<clever> mdash: -ff is also helpful, it will mutate the output filename, and write to logfiles.<pid>
<clever> mdash: id prefix it with `strace -ff -o /tmp/logfiles` and then look at why it gave an error
<clever> whats the permission error?
<clever> mdash: serviceConfig.Type = "forking"; i think
<clever> tdeo: pkgs.writeText and its friends
<clever> teto: howoldis will link to the subset that must pass
<clever> teto: the channel updates when the tests pass, and hydra has tried to build everything, the non-test stuff doesnt have to pass
<clever> evanjs: nixpkgs-unstable also waits for darwin builds, so that can hold it back
<clever> evanjs: which is newer?
<clever> ,howoldis
<clever> emptyflask: then run `diff -r /nix/store/a /nix/store/b` to diff them, what differs?
<clever> emptyflask: try building the repo on 2 machines (linux and mac), fixing the hash to match what it claims, then use nix-copy-closure to copy the paths to a single machine
<clever> wtv_nick: yep
<clever> wtv_nick: doing that (and undoing when your done) is not trivial on any other distro
<clever> wtv_nick: i once ran into an issue with minecraft segfaulting in opengl, and it was fairly simple to just build a special opengl with debug print statements everywhere, to confirm where it was failing
<clever> infinisil: thats how i convinced him to convert to nixos
<clever> like, reinstall levels of unusable
<clever> and i know somebody else, that did an upgrade on fedora, and it basicalled killed all of xorg, and made the machine basically un-usable
<clever> but it only took seconds to pick an older generation in grub, to undo the whole upgrade
<clever> wtv_nick: i recently began having problems with the whole machine locking up due to changes in the graphics drivers
<clever> both config files, and actual packages
<clever> thats not simple to do in a bash script
<clever> so any change to an input will properly update all things that depended on it
<clever> wtv_nick: all config files are built in a sandbox, and only have access to what they defined as inputs, and the output path is a hash of all of the defined inputs
<clever> which you use depends on if kernel changes are involved, and if you broke it so badly that you cant even boot
<clever> wtv_nick: you can either pick an older state from grub, or use `nixos-rebuild rollback`
<clever> wtv_nick: ive bricked a few machines with `apt-get dist-upgrade`, but nixos lets you undo even major changes
<clever> wtv_nick: the other major benefit, is that you can undo changes very easily
<clever> ldlework: this is the main change i had to do, to make it build
<clever> + cp -r --no-preserve=mode ${paket-deps}/.nuget $HOME
<clever> + cp -r --no-preserve=mode ${paket-deps}/* .
<clever> which is adding 66mb to it
<clever> in my case, there is a random .nar.xz in one of my nixpkgs dirs, lol
<clever> /nix/store/gcpzi1q7bv9mxryxdhq2lym2k7njqx3c-nixpkgs 296 2019-08-12 20:19:24
<clever> may be handy to toss it into a wiki
<clever> which lets you discover what it just dumped
<clever> infinisil: this will list every store path over 256mb, sorted by when it was added to the store
<clever> sqlite> .mode column
<clever> sqlite> select path, narsize/1024/1024 as narmb, datetime(registrationTime,'unixepoch') from ValidPaths where narsize > 256 * 1024 * 1024 order by registrationTime;
<clever> [root@amd-nixos:~]# sqlite3 /nix/var/nix/db/db.sqlite
<clever> warning: dumping very large path (> 256 MiB); this may run out of memory
<clever> commonly named things like nixpkgs could be filtered by the module
<clever> infinisil: filterSource
<clever> then your just asking for problems, because you config is scattered over the machine and you cant just backup /etc/nixos :P
<clever> that also solves the imports problems
<clever> infinisil: yeah, check the core.nix example i linked above
<clever> but that must exist in the directory it needs to backup, hence, nixos-generate-config
<clever> which is what ./. solves
<clever> because it copied the wrong config
<clever> infinisil: secrets in the host configuration.nix leaking to targets in nixops
<clever> so if your nixpkgs gets ahead of nixops, bad things happen
<clever> infinisil: defaulting to true may cause security issues in nixops cases, and it would need a new nixops to turn it back off
<clever> infinisil: and then that both enables, it, and tells it exactly where to look
<clever> infinisil: i'm thinking, instead of the module trying to guess where you get the config from, you just give it a ./. to tell it
<clever> dansho: zfs and then you dont care!
<clever> infinisil: what if nixos-generate-config put those 3 lines, into the default configuration.nix?
<clever> oh, that gives me an idea
<clever> (and any secrets it may contain)
<clever> infinisil, evanjs: this variant, will just archive the entire nixos-configs dir, including .git
<clever> infinisil: if <nixos-config> doesnt exist, or is the wrong config (nixops for ex) it will copy the wrong file
<clever> ldlework: you didnt use the no-preserve flag i gave earlier
<clever> /nix/store/z955xygfz1c365nasjfbh4jhf0dnzsvf-dotnet-sdk-2.2.103/sdk/2.2.103/Microsoft.Common.CurrentVersion.targets(1128,5): warning MSB3191: Unable to create directory "obj/Debug/netcoreapp2.2/". Access to the path '/build/disinfo/Disunity.Disinfo/obj/Debug/netcoreapp2.2/' is denied. [/build/disinfo/Disunity.Disinfo/Disunity.Disinfo.csproj]
<clever> so its imposible to tell which one is which in the errors
<clever> ldlework: next minor problem, both derivations have the identical name
<clever> ldlework: build fails here, hash mismatch
<clever> and default.nix is the only one that should import <nixpkgs>
<clever> ldlework: you want to start the file with { stdenv }:, and then load it with callPackage
<clever> ldlework: first minor problem, you import <nixpkgs> in each file, that ruins performance
<clever> *looks*
<clever> yeah
<clever> fresheyeball: heh, was looking like a hit&run, you vanished the instant the problem was solved!
<clever> just remove the line for /mnt
<clever> fresheyeball: you should have 4 exports lines, one for /mnt, and then 3 for each subdir
<clever> fresheyeball: try removing the exports line for /mnt ?
<clever> fresheyeball: what is the line from exports, for spruce, and what does `mount | grep spruce` say on the client?
<clever> try putting them back in and see what happens
<clever> thats a work-around for when your not using nohide
<clever> nohide should be stopping it from doing that
<clever> not the thing you mounted over /mnt/spruce
<clever> that confirms, the nfs server is sharing the /mnt/spruce directory on /
<clever> umount spruce on the server, and ls again?
<clever> then check on the server, does it exist?
<clever> mount everything back up, and make the file from the client
<clever> you may need to go back to step 1, since you deleted the file
<clever> if you umount it, then ls the directory beneath the mount, does the file the client made appear?
<clever> i said ntfs, not nfs
<clever> also, that step was for the server