2019-08-26

<clever> its not mounted yet the file is still there???
<clever> on the server or client?
<clever> fresheyeball: what if you umount the ntfs and ls again?
<clever> fresheyeball: and if you ls on the server, can you see it?
<clever> fresheyeball: touch again?
<clever> fresheyeball: is something currently in that dir?, you shouldnt have to umount
<clever> fresheyeball: add no_root_squash to the options, then root on the client is also root on the server
<clever> fresheyeball: as root?
<clever> fresheyeball: what if you create a file in that directory?
<clever> fresheyeball: sure
<clever> fresheyeball: try restarting nfs-server.service ?
<clever> 3260 is tgtd, ignore that
<clever> fresheyeball: and netstat confirms, i do have open connections on that port, between machines doing nfs mounts
<clever> fresheyeball: 2049 is part of nfs
<clever> fresheyeball: all of the ports are clearly laid out in the nixos module!
<clever> fresheyeball: strange, i dont have those listed in my firewall config
<clever> [root@nas:~]# netstat -anp | grep rpc
<clever> tcp6 0 0 :::9125 :::* LISTEN 2884/statsd_exporte
<clever> tcp6 0 0 :::35555 :::* LISTEN 2932/rpc.statd
<clever> tcp 0 0 0.0.0.0:2049 0.0.0.0:* LISTEN -
<clever> tcp 0 0 0.0.0.0:20048 0.0.0.0:* LISTEN 2933/rpc.mountd
<clever> [root@nas:~]# netstat -anp | grep LIST
<clever> ldlework: windows be funky :P

2019-08-25

<clever> (because i turned off auto-mount, lol)
<clever> fresheyeball: try mounting by hand first, i do `mount c2d:/media/videos/4tb/ /media/videos/4tb/ -v` all the time
<clever> fresheyeball: and you then have a normal zone file to map names to ip's
<clever> fresheyeball: line 144 sets the search domain to localnet, so i can now `ping laptop`
<clever> fresheyeball: line 103 creates a private .localnet TLD, so i can do things like `ping laptop.localnet`
<clever> c: use the ip
<clever> b: setup a local dns search domain
<clever> a: setup /etc/hosts with the name/ip
<clever> then youll either need to:
<clever> can `ping goldwater` find it?
<clever> fresheyeball: you may also want to read mountpoint=path in `man exports`
<clever> can you link that section of the manual?
<clever> but you dont have a /spruce, you have a /mnt/spruce
<clever> /mnt/spruce 192.168.1.10(rw,nohide,insecure,no_subtree_check)
<clever> as in, the spruce dir in /
<clever> that grabs /spruce from the server
<clever> device = "goldwater:/spruce";
<clever> oh, wait, i think i see your problem
<clever> it tends to un-mount things while i'm using them, causing all kinds of problems
<clever> oh, and ive had major pains with the systemd automount junk
<clever> if it was wrong, it would fail to mount
<clever> shouldnt matter
<clever> the no_subtree_check means that it should just recursively share everything
<clever> since it has to restart to load the new cfg
<clever> removing lines 21-23 would also serve as a simple way of forcing the nfs server to restart
<clever> and if you reboot, its likely to fail the same way again
<clever> rebooting the server may be worse, because the nfs process has to start after mounting the ntfs
<clever> /mnt is exported already
<clever> fresheyeball: you can also omit lines 21-23 of the exports file
<clever> fresheyeball: try restarting the nfs server process?
<clever> fresheyeball: does your ip match /mnt or /mnt/spruce in the exports block?
<clever> yeah, i would expect that config to just work
<clever> fresheyeball: bind mounting is just to alias things, like a symlink, but at a lower level
<clever> iggi_: yep
<clever> you can then run ./result ./game, to test patching it, impurely, without nix-shell
<clever> that will generate a shell script, that patches one binary
<clever> you can also just grab the default.nix in that gist, replace zlib with a thing, and run nix-build on it
<clever> iggi_: you want --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)"
<clever> iggi_: one min
<clever> m1crOman: its basically a protection for when your pool is a block device on the lan, and multiple hosts could access it at once
<clever> m1crOman: but if you export, that is cleared, allowing anybody to import
<clever> m1crOman: basically, you need force if the hostid that is currently importing, doesnt match the hostid that last imported it
<clever> if you properly export it, then you dont need to force import
<clever> m1crOman: you must export the pool when done with it: https://github.com/cleverca22/nix-tests/blob/master/kexec/justdoit.nix#L135
<clever> m1crOman: one minute
<clever> ldlework: youll want to remove them with nix-env -e :P
<clever> so you installed every single-character thing in nixpkgs!
<clever> `-i .` is a regex to match any single character
<clever> you want nix-env -f . -i
<clever> and it will search <nixpks> for matching packages
<clever> ldlework: -i takes a regex
<clever> ldlework: oh, wait
<clever> ldlework: what is the contents of default.nix?
<clever> ldlework: what did nix-env -i output?
<clever> ldlework: do you see it in nix-env -q ?
<clever> ldlework: so you want to do `man systemd.service` and `man systemd.exec`
<clever> ldlework: all of `systemd.services.<name>.serviceConfig` is just directly jammed into the .service file with not type-checking
<clever> ldlework: any debug flags you can enable, or sprinkle prints thru the code?
<clever> zfnmxt: there is a systemd target you can do something with (i forget what), which will cause systemd to restart it for you
<clever> then you nix-build -A wrapper
<clever> default.nix could also return an attribute set, containing: the deps, the real build, and the script
<clever> yeah
<clever> writeShellScriptBin "name" "${something}/bin/dotnet run ${yourthing}/TheDll.dll"
<clever> ldlework: so you call it from the nix file, and pass it the other derivation as a string
<clever> ldlework: its a nix function
<clever> ldlework: writeShellScriptBin or writeScriptBin
<clever> vvbb[m]: run nix-env -iA on the same package again
<clever> vika_nezrimaya: https://imgur.com/XUwWWbP
<clever> ldlework: the "" told it to open ""
<clever> vika_nezrimaya: the top half of a floor fan is just jammed into the shelving unit, above the open case, lol
<clever> vika_nezrimaya: i thought it might be related to the summer heat, and stuck an extra fan in it (tech support gore style!) but its still happening
<clever> vika_nezrimaya: yeah, some things do fail every now and then
<clever> ldlework: cp --no-preserve=mode -r
<clever> ldlework: cp preserves the permissions, one minute
<clever> the problem is that it tends to happen in bursts, sometimes back to back, so it keeps re-breaking
<clever> vika_nezrimaya: but it recovers after ~30 seconds
<clever> vika_nezrimaya: both the lan and wan cards are failing, so either the router looses internet, or the house looses the router, lol
<clever> and lately, the network card has been having eratic hanging issues
<clever> the cpu's are pretty old, and its not dual core, its dual socket!
<clever> Aug 25 17:58:42 router kernel: e1000 0000:04:02.1 enp4s2f1: Detected Tx Unit Hang
<clever> model name : Intel(R) Xeon(TM) CPU 3.20GHz
<clever> then i fixed it
<clever> vika_nezrimaya: its actually an old machine from my dads work, that had the power supply fail, so it was replaced
<clever> vika_nezrimaya: a 2U server with a pair of xeon cpu's (dual socket) and 8gig of ecc ram
<clever> vika_nezrimaya: nas.nix and router.nix take the place of configuration.nix
<clever> vika_nezrimaya: https://github.com/cleverca22/nixos-configs/blob/master/deployments/house.nix is an example of how i deploy to my nas and router
<clever> vika_nezrimaya: next fun step is deploying to it with nixops and the none backend
<clever> but if you only run make yourself in the shell, then you can just do only `make` in `nix-shell`
<clever> vvbb[m]: if qtcreator is going to be running `make`, then you need to run it within nix-shell
<clever> vvbb[m]: the makefile also has to use $CFLAGS when building things
<clever> vvbb[m]: then put CFLAGS=$(pkg-config --cflags cairo) into your Makefile
<clever> vvbb[m]: create a default.nix with these contents: with import <nixpkgs> {}; stdenv.mkDerivation { name = "name"; buildInputs = [ cairo pkgconfig ]; }
<clever> yeah
<clever> and the compiler toolchain for producing compatible binaries
<clever> but if you have a static ELF file that fits the cpu arch, you dont care
<clever> angerman: the NDK is basically the libraries you link to (which live in /system/lib) and the headers for those libraries
<clever> you can ignore the entire android NDK issue
<clever> angerman: since that would open up android fairly easily
<clever> angerman: id be interested in static arm builds
<clever> dang thats some high lag
<clever> ,
<clever> ldlework: grep nixpkgs for `etc/ssl/certs/ca-bundle.crt`
<clever> trust*
<clever> ldlework: the sandbox is stopping openssl from finding the default ca cert list, you have to set an env var to tell it who to tust
<clever> ldlework: and this tweet explains my secret :P
<clever> 2019-08-19 14:55:57 < pie_> Profpatsch: sigfig confirms why clever is so good v
<clever> 2019-08-19 14:55:59 < pie_> https://twitter.com/sigfig/status/1163194784225333250
<clever> cant remember the exact one, but if you grep nixpkgs for that string, youll find other examples
<clever> ldlework: some env var has to be set to ${cacert}/etc/ssl/certs/ca-bundle.crt
<clever> turion: and `runhaskell Setup.hs configure --enable-tests`
<clever> turion: runhaskell Setup.hs test
<clever> ldlework: oh, ssl, one minute
<clever> ldlework: you must figure out how to force it to stop doing that
<clever> ldlework: i think its trying to query the package db, to know what the latest version is, and if it can just use what its finding on disk, or has to update
<clever> and then, `ghci -c "runhaskell Setup.hs repl"` to pull up ghci
<clever> `runhaskell Setup.hs repl` is then `cabal repl`
<clever> `runhaskell Setup.hs` is identical to `cabal`, but will get the right version
<clever> then you dont have to remember how it works, you just `cd foo ; nix-shell`
<clever> but its simpler to just make a `(import ../.).foo.env` in `foo/shell.nix`
<clever> then nix-shell ../shell.nix --argstr project foo
<clever> { project }: (import ./.).${project}.env
<clever> you could
<clever> and then a shell.nix goes into each subdir
<clever> turion: the default.nix goes in the root dir, and loads all of the cabal files, like i showed
<clever> then your shell.nix for each subdir, would be something like: (import ../.).foo.env
<clever> turion: repeat the foo=...; for each directory with a cabal file
<clever> turion: with import <nixpkgs> {}; haskellPackages.override { overrides = hsuper: hself: { foo = hself.callCabal2nix "foo" ./foo {}; }; }
<clever> turion: ah, youll want to cabal2nix each one
<clever> assuming default.nix is the result of loading the cabal2nix output
<clever> turion: (import ./. {}).env
<clever> ldlework: the hash is telling nix that the output is unchanging
<clever> ldlework: yeah, if any part of the fixed-output drv changes, you need to zero out a few digits of the hash, and get the new one
<clever> ldlework: youll need to find a way to convince it to build without network access
<clever> ldlework: why is it trying to modify its own source?
<clever> ldlework: and dont use *
<clever> ldlework: -r already does that
<clever> ldlework: why are you using --parents?
<clever> iqubic`: to be a default nix expression
<clever> ldlework: at least for that version of mono
<clever> ldlework: probably a bug in nix then, but if the hash is right and the same, then it works
<clever> jollyjester: did you include the output of pkg-config in the args of cc?
<clever> ldlework: 10 times!
<clever> iqubic`: every single thing you put in mkDerivation becomes an env var
<clever> iqubic`: yes
<clever> jollyjester: i just showed you how
<clever> ptival[m]: or possibly that
<clever> ptival[m]: you must use `SHELL=/run/current-system/sw/bin/bash nix-shell` without --command
<clever> ptival[m]: `--command bash` is at fault, that opens a new shell that lacks the functions
<clever> -I/nix/store/2wqfsqcph8r1g2azmbzzy78hcmfdaai0-cairo-1.16.0-dev/include/cairo -I/nix/store/2kil756l9k1gx79i6faaqdiwn013j67s-freetype-2.10.0-dev/include/freetype2 -I/nix/store/2kil756l9k1gx79i6faaqdiwn013j67s-freetype-2.10.0-dev/include
<clever> [nix-shell:~]$ pkg-config --cflags cairo
<clever> [clever@amd-nixos:~]$ nix-shell -p cairo pkgconfig
<clever> so you must use pkgconfig to "discover" the right -I path
<clever> which breaks nix :P
<clever> jollyjester: to solve the same problem nix solves
<clever> jollyjester: the cairo devs decided to put the headers in $out/include/cairo/cairo.h
<clever> ldlework: yeah, if you dont delete result, nix-collect-garbage wont be able to delete /nix/store/3h6w6dbai6ph3mm8rzrqy330cxf2lgkf-disinfo-dependencies
<clever> ldlework: do that now
<clever> iqubic`: variable = "value";
<clever> ldlework: did you delete the result symlink and nix-collect-garbage?
<clever> sphalerite: ah, messing with nix-channel --add like you showed is probably the best option then
<clever> sphalerite: -I nixpkgs=foo
<clever> sphalerite: does it need to be a channel?
<clever> ldlework: can you gist all of the nix files?
<clever> ldlework: thats why you have to split it into 2 pieces, download and build
<clever> ldlework: so nix is trusting your lie, and ignoring all changes
<clever> ldlework: then you set outputHash on the main build, which is a promise that the output will be the same as last time
<clever> ldlework: that you didnt make false assumptions about how reproducible it is
<clever> ldlework: make a change to the source code so it has to build again
<clever> ldlework: and-or delete result and run a GC
<clever> ldlework: youll want to make a change to the source as well
<clever> ldlework: now try building it with: --option repeat 9
<clever> iqubic`: 2019-08-25 13:05:41 < clever> ldlework: with import <nixpkgs> {}; stdenv.mkDerivation { name = "name"; buildInputs = [ mono ]; }
<clever> ptival[m]: try `SHELL=/run/current-system/sw/bin/bash nix-shell` ?
<clever> ldlework: lib.cleanSource
<clever> ptival[m]: do you have anything funky in ~/.bashrc ?
<clever> ptival[m]: nix-shell should run bash for you
<clever> ldlework: only if you can get mono to produce a bit-for-bit identical binary, for ANY version of mono
<clever> ldlework: just put that string inside buildPhase
<clever> ldlework: because you set buildPhase, it never runs preBuild
<clever> and your outputHashMode has to be recursive
<clever> yep
<clever> you can get the exact same thing with mkDerivation
<clever> mkShell is just training wheels :P
<clever> iqubic`: i just always use mkDerivation
<clever> and it needs to be bit-for-bit reproducible
<clever> and then copy them to $out
<clever> ldlework: somehow tell mono to download the deps, but not build anything
<clever> ldlework: you need to break `mono install` up into smaller steps
<clever> that derivation will return a path to those dependencies, which you can then use in a non-fixed drv, to build things
<clever> to download the dependencies and nothing else
<clever> ldlework: like that
<clever> > runCommand "foo.txt" { outputHashAlgo = "sha256"; outputHash = "0000000000000000000000000000000000000000000000000000"; outputHashMode = "flat"; buildInputs = [ curl ]; } "curl google.com > $out"
<clever> ,tofu
<clever> buildCommand is one method, pkgs.runCommand is another
<clever> after that, you can use any means you want to download things and put them in $out
<clever> that also impacts how it computes outputHash, but you can just tofu it
<clever> if outputHashMode == "flat", then $out must be a file, if its "recursive" then $out can be a file, symlink, or directory
<clever> if you set all 3, then you gain network access
<clever> ldlework: youll see 3 fields, outputHash, outputHashMode, and outputHashAlgo
<clever> ldlework: run `nix-instantiate '<nixpkgs>' -A hello.src` then run `nix show-derivation` on the drv file it produces
<clever> ldlework: a dedicated drv that only downloads, and declares the hash of $out
<clever> ldlework: fixed-output derivations
<clever> ldlework: pastebin the expr
<clever> ldlework: preBuild = "export HOME=$NIX_BUILD_TOP";
<clever> alexarice[m]: if its a nixos module, mkIf is your solution
<clever> s/or//
<clever> alexarice[m]: or depends on the context
<clever> ldlework: i dont think windows has any block devices in there
<clever> mightybyte: read lines 13 and 65
<clever> mightybyte: that reminds me of justdoit .....
<clever> ldlework: canada
<clever> ldlework: with import <nixpkgs> {}; stdenv.mkDerivation { name = "name"; buildInputs = [ mono ]; }
<clever> iqubic: by default, yes
<clever> surprisingly, i dont even have to patchelf things
<clever> ldlework: ive seen a couple bits of software, that give a .exe file for the "linux" binary, and it "just works" when i run mono on it
<clever> and then test if it also happens to work on shell
<clever> ldlework: nix-shell on the default.nix works for any c/c++ based project
<clever> ldlework: for most packages, default.nix can work by itself
<clever> ptival[m]: try again without --command
<clever> tilpner: more agreeing with you that its "too large" as in just eats a ton of disk space :P
<clever> ptival[m]: genericBuild is a bash function, and those dont get inherited when you run another sh
<clever> tilpner: the util to download the electron source, literally creates a 30gig directory
<clever> tilpner: less security related, a package to build electron, from source
<clever> angerman: id say start by opening a PR to `git cherry-pick` it into the release-19.03 branch, and then see who wants to merge it
<clever> yeah, both changes are good
<clever> since it doesnt make sense to have an alsoft option in services.pulseaudio
<clever> maybe move it to a proper programs.alsoft.driver = "alsa"; and then have pulseaudio set that option
<clever> so you dont have to force things
<clever> aanderse: a far simpler change is to pr pulseaudion.nix, to make that a proper option
<clever> its unused for a reason!
<clever> and then alsa picks the first unused device, whatever pulse happens to not have open, usually the one that isnt plugged in :P
<clever> alexarice[m]: the override is forcing the game to use alsa
<clever> 2019-08-25 11:24:25 < clever> lib.mkForce pkgs.writeText "alsoft.confi" "drivers=alsa";
<clever> and it used the first alsa device that pulse wasnt using
<clever> aanderse: sounds like its using alsa, and bypassed pulse entirely
<clever> aanderse: is the vu meter moving? is it on the right output? is it muted?
<clever> aanderse: if you run pavucontrol, do you see it on the playback tab?
<clever> ah
<clever> alexarice[m]: its already using loaOf
<clever> alexarice[m]: it needs to support a mode= and user=, because services like sshd and sudo get upset if the permissions are wrong
<clever> type = with types; loaOf (submodule (
<clever> aanderse: then you can use imports to load in a modified copy of it
<clever> aanderse: https://nixos.org/nixos/manual/index.html#sec-replace-modules use this to entirely nuke pulseaudio.nix from nixos
<clever> and then make-etc.sh complains
<clever> aanderse: so mkForce cant cant override things, and just inserts a 2nd element into the list
<clever> aanderse: i think i see the problem, behind the scenes, environment.etc."foo" turns into environment.etc = [ { name = "foo"; source = ...; } ];
<clever> aanderse: it called mkForce, with writeText as the 1st argument
<clever> aanderse: you forgot ()'s
<clever> lib.mkForce pkgs.writeText "alsoft.confi" "drivers=alsa";
<clever> aanderse: what is line 264?
<clever> attempt to call something which is not a function but a set, at /etc/nixos/configuration.nix:264:49
<clever> aanderse: one is setting text, the other is setting source, mkForge cant change it from source to text
<clever> aanderse: can you pastebin your full configuration.nix and the exact error?
<clever> and thats where you can bring `services.xserver.videoDrivers = "nvidia*"` into the mix
<clever> LouisDK: in the case of virtualbox, it will .override the package, to make it obey the nixos options in configuration.nix
<clever> LouisDK: you cant directly read services.xserver from default.nix, so it needs to be an argument to receive via .override
<clever> LouisDK: i would make a single mythtv default.nix, that has an option like withNvidia ? false in its args, and then callPackage it twice, with it set to true or false
<clever> still get an assertion in ghc, when on a mac
<clever> assertion failed at /private/var/root/michael/nixpkgs/pkgs/development/compilers/ghc/8.2.2-binary.nix:7:1
<clever> but i can also see qemu-user helping, to let you run template haskell for proper cross
<clever> qemu-user lets you cheat a bit
<clever> there was no proper cross in my setup, it was all "native", either on an aarch64 kernel, or qemu-user-aarch64
<clever> angerman: i tried native (and qemu) arm builds a few months ago, and thats when i discovered (with your help) that it lacks native codegen, and the llvm backend is a bit segfaulty under -j>1
<clever> angerman++