2019-07-24

<clever> `NIX_PATH=/home/paprika/.nix-defexpr/channels:nixpkgs=(realpath .)/nixpkgs:nixos...`
<clever> pie_: why are you encrypting /boot/?
<clever> elvishjerricco: ah, ive never trusted grub with zfs, and i dont bother encrypting /boot either
<clever> pie_: the state file you pasted, says that the ESP should be mounted to /efi (or /mnt/efi when running install)
<clever> pie_: nixos-install always forces the bootloader to be installed
<clever> pie_: and this is the code for managing that state file
<clever> pie_: `nixos-rebuild --install-bootloader switch` will force it to reinstall grub
<clever> pie_: if that file doesnt agree with the current config when doing switch, it will reinstall grub
<clever> pie_: this file contains the version of grub, and some critical cfg flags
<clever> [root@amd-nixos:~]# cat /boot/grub/state
<clever> pie_: one sec
<clever> pie_: one min, something came up
<clever> pie_: ?
<clever> (warning, it prints binary to stdout)
<clever> tilpner: you can do the same thing with `nix-store --dump /nix/store/foo`
<clever> tilpner: i believe it does
<clever> tilpner: but that still has the cost (IO and disk usage) that its going to duplicate the entire thing (21gig in matt`'s case), even if /nix/store already had it
<clever> tilpner: then based on the hash, rename it to /nix/store/hash-name
<clever> tilpner: one sink that hashes, the other that re-unpacks it to /nix/store/temp
<clever> tilpner: one thought i had, is to make a source, that emits ./. as a nar, then run it thru a tee type class, which writes it to a pair of sinks
<clever> but that still has the memory usage problems
<clever> so it only pays that once once
<clever> my solution was to switch it to requireFile, and then add it with nix-store --add-fixed
<clever> tilpner: ive done data processing before with nix, with ~3gig of input files, and ./foo causes the eval to hang for 30+ seconds each time, as it re-hashes it in ram
<clever> tilpner: yeah, ./foo is always a performance cost
<clever> tilpner: should be possible, similar things have been done for the nix-copy-closure api already
<clever> matt`: worst case, it could need 61gig of ram+swap
<clever> matt`: i believe nix needs 2 or 3 std::string's, each holding the entire 21gig tar

2019-07-23

<clever> Thra11: can you paste some logs, like when nix says "will download X and build Y" ?
<clever> nix-store -qR
<clever> then it has to always download it, even after its built
<clever> Thra11: you may also want to double-check that your not depending on something at runtime
<clever> then copy the already built product back
<clever> then (try to) copy those deps to the slave
<clever> if your build slave is not a cache, it will fetch the deps for a thing the slave already built
<clever> then, in the reverse order (deps first), it will build them (possibly on a build slave)
<clever> and once that phase is done, it will tell you what its fetching from a cache, and what it wants to build
<clever> if it cant find that, it will (recursively) check the deps of it
<clever> Thra11: basically, it will start at the thing you want to build, and check for it on caches
<clever> Thra11: if its configured as a cache (not just a build slave), yeah, it can skip ahead
<clever> and it doesnt know it will be copying it back up to that machine yet
<clever> Thra11: it may also be trying to build the fixed-output drv, on the slave
<clever> Thra11: nix doesnt know what the remote machine has, or even which remote machine its going to use, until after it has fetched all of the inputs
<clever> Thra11: nix needs the deps locally before going out to a build slave
<clever> Thra11: if i go under 3gig free, it will run nix-collect-garbage --max-freed automatically, targeting 6gig free
<clever> Thra11: you could also look into auto gc
<clever> Thra11: simplest thing then is the for loop in bash, and dont use --force
<clever> Thra11: are the failed things valid store paths, or builds that fail to finish?
<clever> Thra11: you can use wildcards to, for x in /nix/store/*name-1.3; do nix-store --delete $x; done
<clever> Thra11: `nix-store --delete /nix/store/foo` to target a specific thing and nothing else
<clever> until it hits the quota
<clever> Thra11: invalid paths first (those not in db.sqlite), then everything else in random order
<clever> asymmetric: yeah, the stdenv supplies a lot of things by default
<clever> asymmetric: coreutils is probably part of the stdenv too
<clever> turion: but linux can cross-compile to windows
<clever> turion: windows is a much bigger mess and doesnt have a really usable nix yet
<clever> turion: mac has no real chroot or namespace mechanisms, but once you own /nix its the same as linux
<clever> turion: debian removed the ability to use usernamespaces
<clever> turion: nix-user-chroot can do it with namespaces
<clever> turion: so you can just make and chown an empty /nix dir, and then run the install.sh from the website
<clever> turion: if your current user owns /nix, it can install without sudo present
<clever> turion: and if i ever need a special version, i can just add overrides to the nix
<clever> turion: i just build against whatever haskell versions are in my current nixpkgs, and pin that whole nixpkgs
<clever> turion: nixpkgs contains a pinned export of stackage, but its not based on a specific lts
<clever> all must use nix!
<clever> turion: nix does everything stack would normally provide
<clever> turion: cabal files and cabal2nix
<clever> turion: i just avoid stack like the plague :P
<clever> Thra11: and this to simply switch to a given one
<clever> /nix/var/nix/profiles/system-500-link/bin/switch-to-configuration switch
<clever> Thra11: use this to find a given profile
<clever> [root@amd-nixos:~]# ls -l /nix/var/nix/profiles/
<clever> fresheye1: not clear what module has to be loaded
<clever> [clever@system76:~/apps/linux]$ cat /proc/config.gz | gunzip | grep -i MCE
<clever> CONFIG_X86_MCE=y
<clever> # CONFIG_X86_MCELOG_LEGACY is not set
<clever> fresheye1: check this doc file, in the linux github repo
<clever> Documentation/x86/x86_64/machinecheck:from /dev/mcelog. Normally mcelog should be run regularly from a cronjob.
<clever> arch/x86/kernel/cpu/mcheck/Makefile:obj-$(CONFIG_X86_MCELOG_LEGACY) += dev-mcelog.o
<clever> arch/x86/kernel/cpu/mcheck/dev-mcelog.c: * /dev/mcelog driver
<clever> yeah, you may need to load the right kernel module, *looks*
<clever> usually
<clever> fresheye1: --daemon makes it fork into the background
<clever> fresheye1: just leave it on and check it later after things fail at few times
<clever> fresheye1: did you try `journalctl -f -u mcelog` ?
<clever> fresheyeball: yep
<clever> then it will probably land in the journal
<clever> i linked how earlier
<clever> you need to enble it first
<clever> nothing in this area
<clever> fresheyeball: mcelog is next then
<clever> danbst: (super.nix.override { fromNix = true; }).overrideAttrs (...
<clever> danbst: you want .override
<clever> danbst: you also want to add this to the buildInputs
<clever> > autoreconfHook
<clever> danbst: so the pkgs.nix your overriding simply never had flex and bison
<clever> danbst: its not a problem of it (not) preversing them, its a matter of the dependencies have changed
<clever> danbst: you need to add flex and bison to the buildInputs
<clever> danbst: how is it "not working" ?
<clever> danbst: what error does it give?
<clever> danbst: you want super.nix, not nixpkgs.nix
<clever> danbst: should be the same as any other package, just .overrideAttrs in packageOverrides
<clever> fresheye1: you may need to switch to grub, or grab the memtest iso from the memtest website
<clever> fresheye1: memtester wont be able to test the memory fully

2019-07-22

<clever> fresheyeball: memtest86+?
<clever> selfsymmetric-mu: depends on if the kernel is in the cache or not, most are
<clever> selfsymmetric-mu: 88 #kernelPackages = pkgs.linuxPackages_latest;
<clever> fresheyeball: https://nixos.org/nixos/options.html#mcelog will also be able to decode the MCE's and say what exactly has done wrong
<clever> fresheyeball: look at the above wiki page, under causes
<clever> fresheyeball: MCE's and random serious errors
<clever> fresheyeball: either died, or its loose
<clever> fresheyeball: thats what it looks like
<clever> fresheyeball: you can also get a memtest iso and put it onto a usb or cdrom
<clever> fresheyeball: not easily
<clever> probably not
<clever> fresheyeball: does this machine have ECC ram?
<clever> fresheyeball: try running memtest on the machine
<clever> fresheyeball: i think it had a kernel-side segfault, while in a segfault handler
<clever> fresheyeball: need to sign in to see it
<clever> selfsymmetric-mu: the new `nix` command will sort of do it, but uses \r to overwrite the line every time a line is printed
<clever> selfsymmetric-mu: mostly not implemented
<clever> fresheyeball: did it print more error?
<clever> selfsymmetric-mu: dont think thats possible, but you can run `nix-store -l /nix/store/foo` to dump the logs for something after the fact
<clever> fresheyeball: ctrl+alt+f1
<clever> fresheyeball: not sure, if you repeat things from a text console, what happens?
<clever> fresheyeball: how much ram on the machine?
<clever> nilsirl[m]: cant remember what i was doing to fix it
<clever> nilsirl[m]: that breaks cc-wrapper
<clever> nilsirl[m]: scons has some "handy" utils to make the build env pure, and unsets all env vars it doesnt understand
<clever> pbb: you should also be able to do several on one line
<clever> pbb: it can use callPackage and import ../.. {} to load the nixpkgs its sitting inside
<clever> pbb: ${toString ./.} gets you the dir the nix file was in
<clever> pbb: you can then use buildInputs to get whatever you need (purely) and shellHook to run things impurely, and `exit 0` at the end to stop the shell from actually opening
<clever> pbb: i like having update.nix files with a shellHook, where you just run `nix-shell update.nix`
<clever> pbb: nix-shell and nix-build could even share intermediate products!
<clever> pbb: then if foo.c matches a previously built thing, it builds instantly
<clever> pbb: what if gcc was replaced with a shell script, that would pre-process the c code, and remove all comments (like ccache), then it just did `nix-build gcc.nix --arg source ./foo.c`
<clever> pbb: another thing recursive nix can give you is a ccache replacement
<clever> vaibhavsagar: not sure what the original issue was then, enless your overlays are messing with lib
<clever> vaibhavsagar: that one is broken by the syntax error, but the overlays shouldnt impact other things, so it may be a false alarm, purify it and then see what happens next
<clever> vaibhavsagar: ah yeah, your `inherit (import <nixpkgs>{}) lib;`
<clever> vaibhavsagar: try the syntax error then, to see how its leaking in
<clever> vaibhavsagar: is it an overlay, or config.nix ?
<clever> vaibhavsagar: i would expect that to work, try putting a syntax error in an overlay from ~/.config/nixpkgs and then paste me the error it gives
<clever> vaibhavsagar: at every place you import nixpkgs?
<clever> vaibhavsagar: import <nixpkgs> { overlays = []; };
<clever> exarkun: is it actually running npm, or do the directions just say to run it?
<clever> exarkun: a replacement for npm
<clever> DariusTheMede: oops, tab complete is sometimes off
<clever> drakonis1: what happens with `self.my-random-fu-multivariate
<clever> iqubic: with xrandr and xfce, hotplug is fine
<clever> iqubic: i just plugged it in and enabled it in xfce4-display-settings
<clever> emily: you can also use normal haskell.lib.overrideCabal and configureFlags to pass any flag `cabal configure` accepts
<clever> emily: i dont think nix sets any special flags, so its the defaults for cabal (and it will obey the ghc-options: in the cabal file)

2019-07-21

<clever> samueldr: how did that work again...
<clever> basically, nothing refers to Paths_HTTP.HTTP_bindir, so just drop the entire value when linking
<clever> samueldr: i think the solution is dead code elimination, when linking pandoc
<clever> samueldr: so, because HTTP wanted to know its version, it accidentally depended on $out, and static linking is now useless!
<clever> but is only ever used for version
<clever> Network/HTTP/Base.hs:import qualified Paths_HTTP as Self (version)
<clever> Paths_HTTP is in Other-modules
<clever> nix-store -q --binding src /nix/store/q6s2k9rvi47w94ificmcws1ad0k2062g-HTTP-4000.3.14.drv
<clever> nix-store -q --deriver /nix/store/irclqml8xy3n8dvjg19hjgvy7zhdc3h2-HTTP-4000.3.14
<clever> to the source!
<clever> so, despite never using the bindir, it depends on its own $out, even after static linking
<clever> cabal auto-generated a Paths_HTTP.HTTP_bindir = "$out/bin"
<clever> aha
<clever> ths_HTTP.HTTP_bindir./nix/store/irclqml8xy3n8dvjg19hjgvy7zhdc3h2-HTTP-4000.3.14/bin
<clever> pandoc depends on this, which depends on ghc
<clever> => /nix/store/irclqml8xy3n8dvjg19hjgvy7zhdc3h2-HTTP-4000.3.14
<clever> it is a static haskell executable...
<clever> [clever@amd-nixos:~/apps/nixpkgs-master]$ nix why-depends /nix/store/dsh6szwrs21qv26p03y3wdyqhss1lwdc-pandoc-2.7.3 /nix/store/afl6f7zydqdfv78vgcf2vrdmpza9bbig-ghc-8.6.5-doc
<clever> /nix/store/afl6f7zydqdfv78vgcf2vrdmpza9bbig-ghc-8.6.5-doc
<clever> and yes, it depends on ghc
<clever> [clever@amd-nixos:~/apps/nixpkgs-master]$ nix-store -qR /nix/store/dsh6szwrs21qv26p03y3wdyqhss1lwdc-pandoc-2.7.3 | grep ghc
<clever> it was in hydra
<clever> copying path '/nix/store/dsh6szwrs21qv26p03y3wdyqhss1lwdc-pandoc-2.7.3' from 'http://nas.localnet:8081'...
<clever> [clever@amd-nixos:~/apps/nixpkgs-master]$ nix-build -A pandoc
<clever> samueldr: pkgs.pandoc?
<clever> samueldr: oops, ^^^
<clever> symphorien: justStaticExecutables makes things not depend on ghc
<clever> network namespaces cant be joined as easily
<clever> symphorien: i think tthats part of what android is using
<clever> but its also always the default gateway
<clever> and at no point do you get root, so you can run any vpn you want on android, securely
<clever> then you just read packets from that /dev/tun handle, and write them out the FD# you specially flagged
<clever> and the OS will specially flag it to ignore the default route, which goes into the /dev/tun handle you are given
<clever> the android vpn interface, requires that you run a special function on the FD# for the upstream connection
<clever> gchristensen: so you can have several sets of routes, and multiple default gateways, then flag a socket to use a certain one
<clever> gchristensen: there is also a kernel feature android uses, but ive not looked into yet, it can support multiple routing tables
<clever> gchristensen: wireguard would need to dynamically figure out the remote ip, and add a route entry at runtime, to ensure it still goes via the gateway
<clever> wg*
<clever> gchristensen: the main prolem is adding a route override, to force the wg peer to not go over wf
<clever> gchristensen: yep, havent done much with changing the default route
<clever> gchristensen: i need to go over your wireguard changes, and update tgt_service, it has similar bugs to what your wireguard recently had (which got fixed)
<clever> exarkun: yeah
<clever> exarkun: submodule options
<clever> hpfr[m]: ~/foo
<clever> nilsirl[m]: you need to set -I nixpkgs=/path/to/unstable
<clever> i should get off to bed, 5am now
<clever> Miyu-chan: ive not read that yet
<clever> ashkitten: and then you can somehow manually run yarn2nix, and commit the generated output
<clever> ashkitten: if you add hashes to your yarn.lock, then i think yarn2nix can use pkgs.fetchgit
<clever> ashkitten: it massively slows down a lot of nix tools
<clever> ashkitten: ah, hydra itself supports it, but the policy is to not allow IFD within nixpkgs itself
<clever> ashkitten: ive got it working just fine, what error do you get?
<clever> Netsu: does it behave differently if you only use $out ?
<clever> Netsu: what is the value of $custom at this point? where did it come from?
<clever> nh2: it should also be possible to use a dynamic ghc for Setup but a static one for building, like the cross-compile stuff
<clever> nh2++
<clever> Netsu: can you pastebin the nix exprs?
<clever> Netsu: if you make a $out/home/foo and add it to the contents of the docker image, it will wind up in /home/foo
<clever> Netsu: for example?
<clever> repeat
<clever> then i open another 10 tabs
<clever> then i run out of time and leave it for later
<clever> DigitalKiwi: because i dont want to save X forever, i want to read it and close it
<clever> DigitalKiwi: a plugin called vimium. T will let you search by the title of tabs
<clever> nh2: 2092 open right now
<clever> nh2: i have 32gig of ram, 64gig of swap, and i'm running out of both
<clever> nh2: youll also inherit my in-ability to close tabs
<clever> nh2: i dont know how i discovered that option, lol
<clever> nh2: this line of code will either run $curPhase (a bash function by the name in the var), or eval $curPhase, (a bash var, named after the contents of a bash var)
<clever> and `unpackPhase` will fail to behave correctly if the user DID override it
<clever> so `eval "$unpackPhase"` will fail if the user didnt override it
<clever> nh2: genericBuild deals with choosing which one to run, based on some internal priorities
<clever> nh2: phases can be both bash functions, or env vars of identical name
<clever> nh2: ah
<clever> nh2: what args did you run nix-shell with?
<clever> nh2: nix-shell should source setup.sh for you
<clever> gyroninja__: if using the initial stuff, you need to delete the old qemu disk image in the dir you launched it from
<clever> gyroninja__: you must set a password in the configuration.nix file, either with non-mutable users, or initial(hashed)password
<clever> nh2: you can also do `phases="compileBuildDriver" genericBuild` to run just one phase
<clever> nh2: and compileBuildDriverPhase has newlines in it, `eval $compileBuildDriverPhase` strips all of them and ruins it
<clever> nh2: runHook is part of setup.sh
<clever> nh2: when i nix-shell into .env, i typically do `cabal configure ; cabal build`, and since cabal-install isnt present, i replace cabal with `runhaskell Setup.hs`, nixpkgs builds it with normal ghc though
<clever> nh2: what is the exact error? which package is it?
<clever> nh2: if the build fails under normal nix-shell, then you can also use unpackPhase to make the source, and then just `runhaskell Setup.hs configure` then build
<clever> nh2: you need to figure out the right attrpath in the nixexpr that made it, and add .env to the end, and shell into that
<clever> nh2: nix-shell on the .drv wont give a usable shell, ive not yet looked into why
<clever> ivan: there isnt much point in having a localhost nix-serve in the binary cache list, so i would just try to remove that
<clever> and `sudo rm -rf ~/.cache/nix/binary-cache*` wont delete it from roots home
<clever> ivan: you may need to delete that file on other users too
<clever> ivan: as root, run `rm -rf ~/.cache/nix/binary-cache*` to make it forget
<clever> ivan: and a GC will hard-break things
<clever> ivan: once nix discovers that a binary cache has something, it will assume it still has it for up to 30 days
<clever> ivan: is that nix-serve? was garbage collection ran?
<clever> tA-: yeah, display-manager.service
<clever> tA-: { pkgs, lib, ... }:
<clever> iqubic: firewalls on each machine can slow it down
<clever> iqubic: this will take 52 mins to complete, go find some popcorn
<clever> tA-: im using xfce, and i think if i turn off the effects stuff, the tearing goes away, but i also loose the window preview during alt+tab
<clever> 0so you want `nmap -Pn 10.0.0.0/24`
<clever> iqubic: your on 10.0.0.0
<clever> nothing exists on 192.168.1.0
<clever> iqubic: you scanned the wrong network
<clever> iqubic: and what nmap command did you run?
<clever> iqubic: if you login and find the WAN settings, what do they say?
<clever> iqubic: the general status page to start with
<clever> iqubic: and what does a screenshot of the router status page say?
<clever> iqubic: what is the output of `ifconfig` and the nmap command you ran?
<clever> i find enter does it
<clever> ajs124: at least your not printing pdf's to pdf
<clever> gchristensen: i can now google cloud-print (bypassing cups entirely) from anywhere, and it comes out of his printer, despite the fact that he ran off with it :P
<clever> gchristensen: my dad found a used printer/scanner at a yard sale, and the http server within it let me link it to a google account

2019-07-20

<clever> iqubic: what does `file` say when ran on it?
<clever> infinisil: yeah
<clever> its a thunk, that will load&parse the given file later
<clever> `set = import ./foo.nix` for ex
<clever> infinisil: builtins.attrNames would force all the keys at once, before returning the names
<clever> infinisil: but the entire attrset could have been a thunk
<clever> rfold: you want pkgs.fetchgit
<clever> samueldr: https://github.com/NixOS/nixpkgs/pull/65133 could also use a look, and maybe a backport
<clever> samueldr: hydra is rooting all of those drv files, so i would expect it to already be running at optimal speed
<clever> samueldr: but if you dont GC, the next one is faster
<clever> samueldr: ive done it before, and part of the cost is the initial creation of ~20,000 .drv files
<clever> jcrd: bisecting nixpkgs once more! lol
<clever> _deepfire: an override should work, if you can insert it at the right stage
<clever> [clever@amd-nixos:~/apps/nixpkgs-master]$ nix-build nixos/release.nix -A tests.installer.lvm.x86_64-linux
<clever> jcrd: looking into https://hydra.nixos.org/build/96555098 ...
<clever> jcrd: the failures on the left are why nixos-unstable hasnt updated for ~48 hours
<clever> jcrd: https://howoldis.herokuapp.com/ click the hydra jobset for nixos-unstable on here
<clever> and the screensaver daemon is responsible for knowing when all blocks have been cleared, and managing the `xset dpms` level switch
<clever> every time i (un)pause a youtube video, it tries to talk to the screensaver over dbus, to block dpms
<clever> karetsu: i also notice this in my chromium stderr
<clever> [5628:6057:0720/162027.676438:ERROR:object_proxy.cc(619)] Failed to call method: org.freedesktop.ScreenSaver.UnInhibit: object_path= /org/freedesktop/ScreenSaver: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.ScreenSaver was not provided by any .service files
<clever> karetsu: yep
<clever> karetsu: i think xscreensaver acts as a daemon, that tracks which applications are trying to block dpms (youtube, mplayer, vlc), and if none are blocking, will re-enable it within xorg