2018-12-10

<clever> jomik: and then it terminated X while dwm was running normally!
<clever> jomik: oh, so waitPID wasnt set right, so the bash script failed to wait for dwm
<clever> jomik: the display manager should auto-create that file, with the current token, when starting X
<clever> not sure what the cause could be there
<clever> jomik: modify your nix file to run `dwm > /tmp/dwm-stdout 2>/tmp/dwm-stderr &
<clever> yep
<clever> jomik: thats what the context in a patch is for
<clever> jomik: yeah
<clever> "${./foo}" will also have context
<clever> ottidmes: only the magic strings with context, from "${foo}" are truely safe
<clever> ottidmes: even storepath like strings ("/nix/store/hash-foo" for ex) arent "safe"
<clever> that line forces it to instead install to $out
<clever> jomik: it tries to install to /usr/local/ by default
<clever> jomik: the nix sandbox also blocks access to such paths, which makes such errors a lot easier to find
<clever> jomik: if you quote the path, it will depend on if the build is local or remote, and if the user doing the build has read access to the thing
<clever> throw some () around it to make things right
<clever> not the result of applying a function to a set
<clever> and lists are wonky in nix, thats a list containing a function and an attrset
<clever> jomik: you would want overrideAttrs there
<clever> jomik: on lines 7, 16 and 25, change dwm to dwm-git, and then it should work in imports
<clever> jomik: if you copy it, you just need to rename a few things in it, and then it should work
<clever> > pkgs.lib
<clever> `lib/default.nix` in nixpkgs
<clever> jomik: pkgs.lib, which came from line 1 of that file
<clever> Rovanion: yeah, one step to make a single dir with 3 .service files
<clever> Rovanion: and if you want to clean it up, write another nix file, that imports nixos, and does a buildEnv over the 3 .unit's
<clever> Rovanion: you may also want to build grafana and alertmanager.service files as well
<clever> and if prometheus makes any nixos-y assumtions, things can fail
<clever> the firewall part of the config will be entirely ignored
<clever> Rovanion: this will generate a result/prometheus.service file, that you can then configure systemd to use
<clever> nix-build '<nixpkgs/nixos>' -I nixos-config=./configuration.nix -A 'config.systemd.units."prometheus.service".unit'
<clever> Rovanion: heh, i just answered almost exactly that question on google hangouts
<clever> it will even inform nix about that, and allow nix to build arm packages
<clever> and then you can just magically run armv6 and armv7 binaries
<clever> Baughn: this is a file you can toss into imports, which will let you qemu-user.arm = true;
<clever> Baughn: if any module is missing both .config and .options, it will automatically wrap the entire module in a config = { ... };
<clever> Baughn: even configuration.nix is a nixos module
<clever> and then just add it to imports, and set it like any other option
<clever> Baughn: why not just define a new option, baughn.users = [ "foo" ];
<clever> Baughn: so it has to scan all of the imports, recursively, before it knows what pkgs is
<clever> Baughn: config.nixpkgs.pkgs can change the pkgs tree
<clever> Baughn: imports cant depend on pkgs
<clever> Taneb: but you can also do `nixops create ... -I nixpkgs=foo` or `nixops modify ... -I nixpkgs=foo` to bake a -I arg into the state file, and it will persist to all deploys
<clever> acowley: it should work
<clever> Taneb: by default, whatever <nixpkgs> maps to in NIX_PATH
<clever> qqlq: using `nixops deploy -I nixpkgs=...` you can change the nixpkgs version used, see if some older ones work, maybe bisect it
<clever> qqlq: might be a bug due to changes in either nixpkgs or nixops
<clever> qqlq: is your nix file setting anything related to that?
<clever> qqlq: what is line 63 of that default.nix file?
<clever> but sadly, sudoedit only updates the file when you exit the editor, so you cant just spam save and retry things, you must fully quit the editor
<clever> thats what sudoedit is for
<clever> and then the editor gives permission warnings every time its ran without root
<clever> you wind up with root owning the state files in the wrong $HOME
<clever> also of note, `sudo nano` is generally a bad idea
<clever> if it works, you can look into how it works and adapt the code to your app
<clever> steam-run is just an fhs env helper, that includes all of the deps of steam based games
<clever> Guanin: have you tried steam-run yet?
<clever> Izorkin: you need () around the elemtns in the list
<clever> Guanin: you need to `phases="unpack" genericBuild` i believe
<clever> Guanin: `unpackPhase` always runs the function by that name, it wont eval $unpackPhase
<clever> boogiewoogie: somebody else mentioned that yesterday
<clever> :D
<clever> tazjin: pkgconfig will never work when installed, due to its requirement on setup hooks
<clever> d

2018-12-09

<clever> ah, differing context probably
<clever> Mic92: did you try fetchpatch?

2018-12-07

<clever> oh, nice
<clever> aanderse: but ive not tested that, and dont know what side-effects may occur
<clever> aanderse: the only solution i can see is to `nixops export`, rename it in the json, and `nixops import`, then it will think it always had that name
<clever> and you can still choose to either have a /boot partition, or a /boot directory on the / partition
<clever> the bios boot partition is not the /boot partition
<clever> etu: if you make a bios boot partition (1mb, no fs, never mounted), then grub can do a legacy install just fine on gpt

2018-12-06

<clever> there is no way to query the context of strings
<clever> tilpner: nothing from the nix side can really work, because of foo = "${hello}/bin/hello";
<clever> tilpner: `nix show-derivation /nix/store/foo.drv`
<clever> hakujin: the diff is more readable with colors still intact, but there is no real easy way to copy them
<clever> tilpner: yeah
<clever> hakujin: check to see if there is any other differences
<clever> hakujin: if any part of the source changes, the storepath for the .cabal file will change, and it has to at least re-run cabal2nix
<clever> tilpner: not really, nix only knows the runtime closure by grepping the output
<clever> hakujin: its using filterSource to do that already, but it doesnt work if the input src is already in the nix store
<clever> hakujin: if those paths are not fixed-output derivations, then it will depend on the hashes of its inputs, not the contents of its outputs
<clever> and that import can come from a different hostid
<clever> yeah, if you export the pool properly, it can be imported without a force
<clever> samueldr: normally, channels take care of all of this for you
<clever> but also, that eval had 134 new failures
<clever> yeah
<clever> you want the most recent eval to have zero pending jobs
<clever> WhittlesJr: the last eval to finish is the one with the worst caching, since it has just started building things in it
<clever> its in the /topic of #nix-tools
<clever> a replacement for both stack2nix and cabal2nix
<clever> fendor: its a replacement that angerman has been working on
<clever> there is also nix-tools from the #nix-tools channel
<clever> yeah
<clever> fendor: i think stackage2nix just converts an entire stackage snapshot, but stack2nix will obey any overrides in your stack.yaml

2018-12-05

<clever> typetetris: all commands in nix have that support
<clever> typetetris: with nix2, it will auto-detect NIX_REMOTE based on if it has write access to /nix/store/
<clever> ejpcmac: not-os may be a better option then, its nix based, but not nixos
<clever> you would be better off just using a package override to set nano = null;

2018-12-04

<clever> iqubic: yes
<clever> but ''strings'' will strip all common indent from each line, so the resulting default.pa will look good, and the nix file can still be indented nicely
<clever> nix allows it with both "strings" and ''strings''
<clever> yes
<clever> '';
<clever> load-module module-loopback sink=inputs
<clever> load-module module-null-sink sink_name=inputs
<clever> hardware.pulseaudio.extraConfig = ''
<clever> then put them in that order, inside the '' string
<clever> iqubic: its just 2 lines, with `load-module module-null-sink sink_name=inputs` and `load-module module-loopback sink=inputs`
<clever> iqubic: just set hardware.pulseaudio.extraConfig = '' ... '';
<clever> hardware.pulseaudio.extraConfig for example, just shoves a string at the end
<clever> iqubic: if you can fit it into that template, you can just set the config flags its using
<clever> samueldr: lol
<clever> gchristensen: also, you can just put haskell right into nix, https://github.com/input-output-hk/cardano-sl/blob/develop/scripts/test/yamlValidation.nix#L3
<clever> gchristensen: https://imgur.com/a/nM6Ctah is my first thought, lol
<clever> schopp0r: you want override, not overrideDerivation
<clever> schopp0r: gcc8stdenv.mkDerivation ....

2018-12-03

<clever> attente[m]: you need to put other packages in the -p list, to see them
<clever> attente[m]: `nix-shell -p pkgconfig`
<clever> attente[m]: nix-shell handles all of those vars
<clever> last i looked, it was some random linux tests
<clever> c0bw3b_: is source available?
<clever> now its relative to the nix file that needs it
<clever> dmj`: ./foo.txt
<clever> shouldnt be any others though...
<clever> azazel: `nix-env -i opensc` will search for a package with `opensc` in .name
<clever> azazel: and its likely channels that are to blame, what does `nix-channel --list` show as both root and non-root
<clever> azazel: if you install those extra things via environment.systemPackages, it will be more likely to come from the same nixpkgs set and not have issues
<clever> the GC may eat the build before you can rebuild into it
<clever> jackdk: yeah, you may also want that, depends on your GC setup
<clever> jackdk: a better option, is to patch this to use `nix build` https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/installer/tools/nixos-rebuild.sh#L140-L161
<clever> jackdk: if you dont mind it being a 3 step process, do `nixos-rebuild dry-run`, find its .drv file, `nix build /nix/store/foo.drv` and when its done, go back to normal `nixos-rebuild`
<clever> then its probably done that step, and checking the binary caches, which involves 100's of small http requests
<clever> tejing: just keep waiting
<clever> tejing: thats when its parsing all of the nix expressions

2018-12-02

<clever> feep: have you tried just running nixos-unstable for the entire system yet?
<clever> feep: most list based options merge
<clever> __monty__: either tell samba to not bind (it works find without dns control for me), or set samba to a diff port
<clever> feep: possibly
<clever> 0.0.0.0 is the wildcard, it always covers all IP's
<clever> and just never have nixos-generate-config help you again
<clever> and at that point, it might as well be merged into configuration.nix
<clever> which will destroy your changes
<clever> its a seperate file, so you can re-run nixos-generate-config, to remake it, to match the current hardware
<clever> if you make any changes to hardware-configuration.nix, then your defeating the point of keeping it a seperate file
<clever> nothing says it has to be in hardware-configuration.nix
<clever> nope
<clever> before the main attrset it returns
<clever> let foo = bar; in { ... }
<clever> a let block
<clever> and just forces a 32bit version of that set
<clever> feep: pkgsi686Linux exists in all package sets
<clever> feep: thats tricky, you may need to just unstable.pkgsi686_linux.linuxPackages_latest.nvidia_x11.out
<clever> its pulling in the non-current version, and breaking it
<clever> config.boot.kernelPackages.nvidia_x11
<clever> feep: asciinema lets you record "text" based videos, with ansi color intact
<clever> feep: run `nix why-depends /run/current-system /nix/store/foo` on the "wrong" nvidia version
<clever> schmittlauch[m]: if somebody doesnt restart it manually, it will get ran again when something in nixpkgs changes, because most tests include a full copy of nixpkgs
<clever> feep: if it did, a reboot would clear it up
<clever> feep: use nix why-depends on /run/current-system to see how the "wrong" nvidia is depended on
<clever> schmittlauch[m]: all tests must pass, and all jobs in the set must have at least tried
<clever> feep: bumblebee is using boot.kernelPackages to configure what versions it uses
<clever> schmittlauch[m]: several tests are failing on hydra
<clever> schmittlauch[m]: http://howoldis.herokuapp.com/
<clever> liminal18: that just looks like some invalid bash, try just removing it
<clever> liminal18: havent seen that error before
<clever> liminal18: those warnings happen every time i start steam
<clever> jw358: it might simply be broken on that version, try a nix-channel --update
<clever> jw358: that is a syntax error inside the python package, do you have any overrides against python?
<clever> liminal18: i am playing a game in steam, right at this instant, on nixos
<clever> jw358: can you pastebin all of those errors?
<clever> jw358: yeah, that should just work
<clever> ,locate nix-prefetch-github
<clever> yeah, that should do it
<clever> dramforever: builtins.attrValues
<clever> and unlike the other buildEnv ideas, it will be seperate entries in `nix-env -q` and you can still add/remove a single package if you want to deviate and go imperative for a day
<clever> then nix-env will install every package in the set
<clever> if you give nix-env an attrset, via nix-env -iA nixpkgs.mystuff, and setting mystuff = { inherit (pkgs) hello; }; in config.nix
<clever> none of this would have happened if `sudo nix-channel --list` showed a channel!
<clever> just blame apple for having wonky sudo settings :P
<clever> nix-env will recreate it as you -iA things
<clever> __monty__: that also deleted all generations of your nix-env, so thats toast
<clever> ottidmes: yeah
<clever> but couldnt see it because of sudo being wonky
<clever> you likely always had a channel, on root
<clever> __monty__: you may have deleted the wrong thing, did you delete profile or .nix-profile at any point?
<clever> -iA, what package are you trying to install?
<clever> __monty__: -q is normal, you just dont have anything installed yet
<clever> yeah
<clever> try nix-store --verify --repair
<clever> and nix doesnt like that
<clever> you may have also deleted something in /nix/store by accident
<clever> __monty__: you need to run nix-channel --update, as root
<clever> __monty__: and `ls -l /nix/store/1qjgg5c5mq8id4a8x0gwyhr3xnkzk5r3-user-environment` ?
<clever> __monty__: ls -lh /nix/var/nix/profiles/per-user/root/channels/
<clever> ottidmes: yeah
<clever> __monty__: ls -lh /nix/var/nix/profiles/per-user/root/channels ; sudo -i and cat ~/.nix-channels
<clever> ottidmes: your nixos dns server can go directly to the root dns servers for .
<clever> ottidmes: you can also choose to run your own caching dns in nixos, examples are in my router.nat.nix file
<clever> __monty__: it should look like this
<clever> lrwxrwxrwx 1 clever users 44 Oct 29 2017 /home/clever/.nix-defexpr/channels_root -> /nix/var/nix/profiles/per-user/root/channels
<clever> __monty__: the one in /nix isnt called .nix-defexpr
<clever> __monty__: your channels_root is missing now
<clever> __monty__: it should work, what does `ls -l ~/.nix-defexpr/*/* output?
<clever> ottidmes: if you run `dig google.com @192.168.0.1` does it get a reply?
<clever> ottidmes: is .0.1 running a proper nameserver? what does and doesnt work? can the phone ping an IP on the lan? can it ping an IP on the internet?, is it failing dns?
<clever> lol :)
<clever> either channel works
<clever> but darwin doesnt change HOME
<clever> on nearly every os sudo exists on, it sets the right $HOME when you `sudo foo`
<clever> or fix the silly defaults in /etc/sudoers
<clever> yeah
<clever> so you will want to get rid of the link under .nix-defexpr/channels, not channels_root
<clever> the non-root user should have zero channels
<clever> yeah
<clever> you either need to fix NIX_PATH, or make root the only user with a channel, as it was after the install finished
<clever> __monty__: thats because the default NIX_PATH expects a single channel on root, which you have now deleted
<clever> __monty__: the target of _channels or channels_root, will be another symlink called channels, deleting that and its own target, channels-1-link should remove it entirely
<clever> but there is also a bug, if no channels are setup, --update wont do anything, so there is no way to remove the last channel
<clever> __monty__: channels_root is roots channels, its managed by nix-channel ran as root
<clever> and its best to just have a single channel on root most of the time, or root wont be able to use nix-env
<clever> each user has its own set of channels, and --update is needed on the right user, after any --add or --remove, to re-sync things
<clever> __monty__: you must also run --update after --remove
<clever> __monty__: you must use `sudo -i` then `nix-channel --list`
<clever> __monty__: sudo sets the wrong $HOME on mac
<clever> s2mitrov: is it failing to boot the installer, or did you finish the install, and then it fails booting the hdd?
<clever> s2mitrov: Input/output error sounds more like a corrupt FS, did you umount properly when the install was done?

2018-12-01

<clever> Peaker: looking...
<clever> Peaker: how are you trying to build it?
<clever> Peaker: i dont see anything special
<clever> the problem, is that Setup.hs (and Cabal) depend on base/text, so a fresh ghc must include those to even be able to build a simple package
<clever> infinisil: all things packaged in ghc itself (dua to cabal depending on it) are null
<clever> Peaker: base is part of the ghc package, it cant be removed
<clever> it can also give weird errors like that
<clever> > stdenv.mkDerivation { name = ""; }
<clever> ottidmes: yeah, $out must never have any whitespace in it
<clever> > stdenv.mkDerivation { name = "foo bar"; }
<clever> $ ldd result/bin/init not a dynamic executable
<clever> result/bin/init: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped
<clever> + :
<clever> ld-options -static
<clever> ghc-options: -static
<clever> you could also put them in the cabal file
<clever> and if cabal is in play, both need a --ghc-option= as well
<clever> i think -static is for ghc itself, and -optl=-static is telling ghc to pass -static to ld
<clever> jophish: i needed -optl=-static -static for raw ghc
<clever> it aint static!
<clever> jophish: as i said, ldd should fail on static binaries
<clever> jophish: what does `file` say about it?
<clever> jophish: ldd fails hard on static files!
<clever> for every key in the set, it will replace @key@ in the bash script with the value, then put the result into $out/nix-support/setup-hook
<clever> nh2: makeSetupHook takes an attrset (passed to substitute all), and a bash script
<clever> /home/clever/apps/nixpkgs/pkgs/top-level/all-packages.nix: makeSetupHook { } ../build-support/setup-hooks/breakpoint-hook.sh;
<clever> nh2: yeah, it only helps at nix-build time, but its also more generic and can run on any binary
<clever> and then nix will run it at the end of a build
<clever> nh2: it can then append to things like the fixupPhaseHooks array
<clever> nh2: if you put a derivation with a $out/nix-support/setup-hook into the buildInputs, it will be sourced at the start of a derivation
<clever> nh2: you might also want to look into nix setup hooks
<clever> worldofpeace: i would just bake export PATH=${lib.makeBinPath [ coreutils ]}:$PATH right into the script, if possible
<clever> so its not a ghc feature, just a linker flag ghc is turning on
<clever> and a quick google found your issue on phabricator, its a linker option!
<clever> angerman: no results at all on linux, with 861
<clever> [nix-shell:~]$ ghc --show-options | grep strip
<clever> heh
<clever> already exists?, darwin only or all platforms?
<clever> are there also linker flags to just entirely drop dynlibs your not actually referencing?
<clever> vaibhavsagar: then youll at least know when you did install nix
<clever> vaibhavsagar: mostly, just the first generation that nix turns up on, and the timestamp of that from --list-generations
<clever> but i would just use /etc/hosts then
<clever> ottidmes: but if your running bind on a laptop for some private stuff, you may not want people on the current hotel wifi to be snooping your records
<clever> ottidmes: yeah, mostly attacks over wan are a threat, like reflection based dos attacks
<clever> vaibhavsagar: even if it has been removed
<clever> vaibhavsagar: this will reveal what generation you added nix in
<clever> ls -l /nix/var/nix/profiles/default*/bin/nix/
<clever> vaibhavsagar: one sec
<clever> when ran as root, yes
<clever> vaibhavsagar: `nix-env --list-generations` should give timestamps
<clever> this is why you should never install nix with nix-env when on nixos
<clever> that has priority over the system one
<clever> vaibhavsagar: you installed nix, with nix-env, as root
<clever> vaibhavsagar: what about `type nix` ?
<clever> ToxicFrog: that has also broken steam at one point, because the libGL on nixos was linked to N+1, but steam packaged N inside the FHS sandbox
<clever> vaibhavsagar: what about nix eval '(import <nixpkgs/nixos> {}).pkgs.nixStable.version'
<clever> ottidmes: services.bind.listenOn
<clever> ottidmes: bind should also support setting an interface to bind to
<clever> vaibhavsagar: changing it will break the very thing its meant to fix
<clever> vaibhavsagar: it should not be changed
<clever> vaibhavsagar: did you read the comment above that?
<clever> vaibhavsagar: do any overrides exist in your configuration.nix?
<clever> vaibhavsagar: when you run `nix-channel --list` as each user, what does each give?