2018-03-18

<clever> ah
<clever> where was lib.platforms defined...
<clever> i think so
<clever> hdd light is solid on, no reply to arp
<clever> hmmm, my desktop locked up in the middle of a ghc rebuild, and after reset, it locked up in the middle of nixos-rebuild
<clever> 4gig of userland memory in 32bit!
<clever> could that allow that range to be used by userland??
<clever> the spectre/meltdown changes, require that the 3-4gig range isnt mapped anymore
<clever> i also just had a random thought
<clever> then a hard-coded limit for 32bit makes sense
<clever> ah
<clever> is this process or thread parallism?
<clever> sphalerite: that sounds good, maybe replace the 8 with something based on free -g
<clever> yeah, no recursive nix
<clever> sphalerite: --cores or nix.conf build-cores?, or patch it to scale-back $NIX_BUILD_CORES based on ram?
<clever> Lisanna: fixed-output derivations can only have 1 output
<clever> symphorien: yep
<clever> though its its own output, so nix can gc that
<clever> parallism and timestamps
<clever> Lisanna: that will very likely break --repeat
<clever> sphalerite: oh, that may help with the trouble i had doing exec 2>&1 | tee logfile
<clever> Lisanna: there is already `nix-store -l` and `nix log`
<clever> which lets others mutate the whole set without changing it
<clever> it also adds an overrideScope function to the whole set, so overrides can insert changes between what packages returns, and what self has
<clever> so i can just depend on other custom packages, the same way i would if they where in nixpkgs
<clever> and callPackage can find all of those things
<clever> and the self on 13, will contain all of the packages that packages returns, and a callPackage function
<clever> dbe: packages is defined on line 13
<clever> getting an example...
<clever> and if it has several components, i may switch over to newScope
<clever> dbe: i usually start my project as: with import <nixpkgs> {}; stdenv.mkDerivation { name = "name"; src = ./.; }
<clever> heh, already been hired for my nix skillz :P
<clever> in this case, i need to generate a self-signed cert at runtime
<clever> and its still dynamic and depending on the right glibc
<clever> so without any recompile of openssl, i can just ditch the junk i dont need
<clever> that can be applied to almost any derivation, as long as you understand the subset of files you need to keep
<clever> the perl scripts are just gone
<clever> unlmtd: this bit of code for example, nukes the openssl dependency on perl
<clever> as would just stripping some of the derivations
<clever> musl could probably make it smaller
<clever> unlmtd: not-os
<clever> i just virtualisation.virtualbox.host.enable = true; and then i can run VirtualBox and launch things
<clever> kandinski: yes
<clever> if you load it in nix repl you should see a tarball attribute
<clever> nixops is weird and doesnt let you just override the src
<clever> yeah, it does some things to generate a tarball with the docs pre-generated
<clever> any invocation of nix-env or nix-build can be translated into raw nix, and return the path as a value
<clever> environment.systemPackages = [ ((import /path/to/nixops/release.nix {}).build.x86_64-linux) ];
<clever> unlmtd: if you want the same in nixos's configuration.nix, ((import /path/to/nixops/release.nix {}).build.x86_64-linux)
<clever> unlmtd: heh, was trying to find the time i said that, which was on march 3rd, but i found another from today
<clever> 2018-03-18 05:37:20< sphalerite> unlmtd: `nix-env -f release.nix -iA build.x86_64-linux` or just `nix-env -i ./result` after building it
<clever> unlmtd: one min
<clever> and some inputs got changed
<clever> clefru: but from your diff, i can see that the test was moved to a different phase
<clever> clefru: there is also the nix-diff tool, which helps diff them much better
<clever> in that case, it was a minor path issue in grub.conf, and it could still boot if you just hit e and edit the config slightly
<clever> then everybody running nixpkgs-unstable on nixos found that it ceased to boot :P
<clever> about a year back, grub config generation was broken, and nixos-unstable refused to update, as it should have
<clever> while the nixpkgs-* channels dont check nixos
<clever> the nixos-* channels also wait for tests that ensure it cant brick a nixos machine
<clever> this links to the subset of tests for each channel
<clever> for the -small channels, its a smaller subset of tests, and it doesnt wait for it to try, so it updates faster
<clever> for most channels, the requirement is that a small subset of tests pass, and hydra has at least tried everything (pass or fail)
<clever> and the python packages arent part of the requirement for a channel to update
<clever> and if you `systemctl restart firewall.service`, nixos will undo all changes and reset it back to defaults
<clever> re-running it with -D instead of -A will undo
<clever> that will block all backwards going to port 80, on the input of your machine
<clever> as an example: iptables -t filter -A INPUT -p tcp --dport 80 -j DROP
<clever> robstr_: yes, but you can also manually change the state at runtime
<clever> robstr_: iptables
<clever> oh, there is also `nix show-derivation /nix/store/g85g3rb5cyzlcjganh41f7yb1dj8gd5l-hello-2.10.drv`
<clever> clefru: --option binary-caches ""
<clever> clefru: grep sandbox /etc/nix/nix.conf
<clever> what about the nix sandbox?
<clever> nix copy doesnt behave the same as nix-copy-closure!
<clever> dang, nvm
<clever> [clever@amd-nixos:~]$ nix copy --to local?root=/tmp/fakeroot /nix/store/g85g3rb5cyzlcjganh41f7yb1dj8gd5l-hello-2.10.drv
<clever> let me demo something that will be handy
<clever> yeah, all i can think of is nix-diff
<clever> clefru: and if you do the same?
<clever> that will disable any overrides you have, so its purely what nixpkgs defined and nothing else
<clever> nix-build --arg config '{}' --arg overlays '[]' ...
<clever> something that can sometimes help
<clever> /nix/store/fmvi0fhiwgz0l80j2k2d0gxfdjcgq45f-python3.6-pycurl-7.19.5.1 is not on the binary cache
<clever> 404
<clever> $ curl cache.nixos.org/fmvi0fhiwgz0l80j2k2d0gxfdjcgq45f.narinfo
<clever> so there is no way to know what rev it was based on
<clever> and there is the bug i reported above, if you modify even 1 file, the git revision is entirely lost
<clever> git work trees share a single .git and use the .git file to point to it
<clever> LnL: the .git is a file, not a directory
<clever> LnL: commitIdFromGitRepo also breaks with git work trees
<clever> LnL: it would probably need builtins.fetchGit, and even that has some issues, which ive reported
<clever> though it doesnt really work on git repos
<clever> [clever@amd-nixos:~]$ nix-instantiate ~/apps/nixpkgs --eval -A lib.nixpkgsVersion
<clever> "18.09pre-git"
<clever> tilpner: there is also nix-instantiate --eval '<nixpkgs>' -A lib.nixpkgsVersion
<clever> yep
<clever> callPackage adds an .override function to everything it loads
<clever> .override
<clever> thats already been callPackage'd
<clever> _null_: how did you run callPackage?
<clever> disasm: sent a PM as well
<clever> disasm: only thing i can see as an issue in your PR is the lack of enableParallelBuilding = true;, its only using 1 core when i test the build
<clever> but i have no idea how deterministic pixz is, and i havent been able to get build-repeat to work on nix
<clever> the biggest difference is runtime (5m vs 1m20) and output size (118mb vs 129mb)
<clever> disasm: one piece of input i'm looking for, is if i should keep the default at xz, or change the default to pixz
<clever> i'll have a deeper look
<clever> already skimmed over your description
<clever> disasm: heh, we opened PR's within 7 seconds of eachother

2018-03-17

<clever> i used gosmore many years ago
<clever> go away windows, nobody wants you :P
<clever> symphorien: you could also just throw a prePatch hook in, to dos2unix the entire project!
<clever> so i can see all the unprintable things!
<clever> it also renders tabs, and spaces at the end of lines
<clever> symphorien: i have my vim configured to render the \r's if the file is mixed
<clever> symphorien: ahh, yeah, things get ugly fast when half the tool uses \n and half uses \r\n
<clever> michas_: nix-build -E 'with import <nixpkgs> {}; hello.overrideAttrs (drv: { src = /home/clever/hello; })'
<clever> michas_: if you just want nix to build it, you can unpack it somewhere, and do an override with src = /path/to/source;
<clever> the version of patch may have changed
<clever> may also need to add --p1, i suspect setting it at all overrides that default
<clever> symphorien: patchFlags = "--binary";
<clever> symphorien: sometimes its hard to know what keywords you even need to google
<clever> michas_: nix-build '<nixpkgs>' -A hello.src
<clever> ottidmes: yeah, that does seem like something that could be split out
<clever> ottidmes: so line 116 of 2 is what includes it
<clever> ottidmes: the nixos-rebuild manpage is inside the nixos-manpages package, which is apparently part of the manual
<clever> 5: ./nixos/doc/manual/default.nix: manpages = runCommand "nixos-manpages"
<clever> 4: [clever@amd-nixos:~/apps/nixpkgs]$ grep -r --color nixos-manpages .
<clever> 3: lrwxrwxrwx 1 root root 89 Dec 31 1969 /run/current-system/sw/share/man/man8/nixos-rebuild.8 -> /nix/store/3apl72d0jqizv407vv2rp384y98zffkm-nixos-manpages/share/man/man8/nixos-rebuild.8
<clever> 1:
<clever> ah, and your changing the NIX_PATH to find it?
<clever> only the nixos modules listed in nixpkgs/nixos/modules
<clever> disasm: i think it doesnt take the imports of configuration.nix into account
<clever> ottidmes: but there is no easy way to make the javascript load the new json
<clever> ottidmes: that one uses an options.json that can be generated from nix
<clever> nixos-help is just a bash script to launch this path in a browser
<clever> exec "$browser" /nix/store/m855d35jfrh69b19vwdby84lvslchyj9-nixos-manual/share/doc/nixos/index.html
<clever> tazjin: nixpkgs should never download things while evaluating the packages
<clever> tazjin: copy it over to nixpkgs and fix the src=
<clever> ertes: nix-shell accepts a lot of the same params as nix-instantiate, so you can just call it directly
<clever> qknight: you need to do it at the bash level, like preConfigure = "export HOME=$TMPDIR";
<clever> obadz: `nix why-depends` and `du --max=0 -hc $(nix-store -qR result) | sort -h`
<clever> boomshroom: i think they can be anythwere
<clever> not sure
<clever> ottidmes: yeah, they may be symlinks to the same file
<clever> ottidmes: and if you run realpath on both?
<clever> fl3: yeah
<clever> fl3: that library is in gnome2.gtk
<clever> gnome2.gtk.out 0 s /nix/store/rdwslb6cywp40dm9rv6aqgapfjcyrzpm-gtk+-2.24.31/lib/libgtk-x11-2.0.so.0
<clever> [clever@amd-nixos:~]$ nix-locate libgtk-x11-2
<clever> fl3: try nix-shell -p gtk2
<clever> and wont that bash script now run itself and create a fork-bomb?
<clever> was bspwm already in systemPackages for another reason?
<clever> ah, yeah, systemPackages is a buildEnv
<clever> ottidmes: i think meta.priority only works inside buildEnv
<clever> it tests if your nix is the right version, then imports impure.nix
<clever> thats the default.nix for nixpkgs
<clever> but the example i gave above, jsut returns an empty set, {}
<clever> and if the repo had actual packages, it could return them
<clever> it should just be in the root of the repo
<clever> and apple/default.nix doesnt have defaults for these params, so the import fails
<clever> { config, lib, ... }:
<clever> so now you have an apple channel, that is based on the result of import <nixos-hardware/apple/default.nix> {}
<clever> and it finds nixos-hardware/apple/default.nox
<clever> because nixos-hardware/default.nix doesnt exist, it goes one level deeper
<clever> that name is then added to nix-env, so you can nix-env -iA <name>.hello
<clever> and nix-env will recursively search ~/.nix-defexpr/ until it either finds a <name>/default.nix or a <name>.nix
<clever> when you added that channel, it created ~/.nix-defexpr/channels/nixos-hardware
<clever> but those are nixos modules, that expect a config argument
<clever> it then tries to load every single one of those, and treat its default.nix as a channel
<clever> called 4810t, n990, apple, asus ....
<clever> due to the layout of nixos-hardware, and the lack of a default.nix at the root, nix-env thinks you have 15 channels
<clever> yeah
<clever> i suspect it will be fixed by just adding a default.nix in the root of the project, that contains { ... }: {}
<clever> but -iA nixos.hello tells it to use the hello package in the nixos channel, so it can skip nixos-hardware entirely
<clever> it also wastes a ton of ram and cpu reading every package under the sun
<clever> and it fails when loading the nixos-hardware channel
<clever> the problem, is that -i will search the .name attribute of every package, on every channel
<clever> fl3: -iA will still work, and its better anyways
<clever> !-A
<clever> fl3: ah, i suspect those directions just break nix-env -qa, and nobody noticed
<clever> fl3: it sounds more like your default.nix is a nixos module, so it makes sense why it fails
<clever> fl3: nix-env expects the default.nix in a channel to have default arguments, and to return a package set
<clever> coconnor: for nix1 its /nix/var/nix/binary-cache-v3.sqlite*
<clever> coconnor: nix will recreate it automatically any time its missing
<clever> fl3: what command did you run, and can you gist the file you ran it on?
<clever> coconnor: if you delete that path, it will have to re-query every .narinfo, and discover that things arent there anymore
<clever> coconnor: the client uses this database to keep track of the .narinfo so it doesnt have to re-query it
<clever> ~/.cache/nix/binary-cache-v5.sqlite*
<clever> coconnor: yeah, is the client nix1 or nix2?
<clever> coconnor: you likely ran a garbage collection and deleted that path
<clever> coconnor: which binary cache?
<clever> ottidmes: yeah, you cant use mylib for imports, thats the main restriction
<clever> then you can { config, pkgs, lib, mylib, ... }:
<clever> ottidmes: if you want something custom you could do _module.args.mylib = ...
<clever> ottidmes: ahh, yeah
<clever> ottidmes: that should just work if you { config, pkgs, lib, ... }: and maybe with lib;
<clever> ottidmes: what are you trying to do?
<clever> so pkgs cant depend on the result of config
<clever> it needs to scan all imports recursively, to find nixpkgs.config, to create pkgs
<clever> coconnor: i think that only applies to the imports attribute
<clever> so they have to be in a "single directory"
<clever> i think the problem, is that ghc cant accept multiple flags for where to find deps?
<clever> for c based compilers, nixos just appends -I flags to an env var, and the gcc wrapper forces those in, so an app is free to clear $CFLAGS and still get the cflags
<clever> which is very different from how nixos handles gcc/clang
<clever> it will also buildEnv all of the libraries, and their deps, into a single directory
<clever> then runs the real ghc
<clever> coconnor: ghcWithPackages creates a bash script that sets export NIX_GHCPKG='/nix/store/0pv3ghl8087f0dhw9k7475299n8hqfii-ghc-8.2.2-with-packages/bin/ghc-pkg' and a few other vars
<clever> ghc is a weird exception, due to how it works in nix
<clever> so its more suited to just run a program, and not build things
<clever> the biggest difference i can see, is that `nix run` doesnt get normal compile-time packages or handle setup hooks
<clever> coconnor: that wont include a ghc, and ghc wont be modified to look for it
<clever> mpickering: where it splits the string at the .'s and calls functions at every step
<clever> mpickering: i suspect its doing the same fun stuff as -A with nix-build and nix-env
<clever> mpickering: pkgs, nixpkgs, and nixos all fail
<clever> slack1256: but it dosnt import nixpkgs on its own
<clever> slack1256: the parens convince it that its an expression and not an attr path
<clever> slack1256: ghc-pkg list now shows lens
<clever> slack1256: its more verbose then i was expecting, but this appears to be working
<clever> $ nix run '(with import <nixpkgs> {}; haskellPackages.ghcWithPackages (p: with p; [ lens ]))'
<clever> error: undefined variable 'haskellPackages' at (string):1:2
<clever> $ nix run '(haskellPackages.ghcWithPackages (p: with p; [ lens ]))'
<clever> infinisil: ah, i see
<clever> ottidmes: its also at pkgs.lib
<clever> infinisil: yeah, id have to look at what other distros do to know what can hapen there
<clever> infinisil: ah, then they are going out of their way to source it twice, and make the 2nd one a no-op, lol
<clever> yep
<clever> infinisil: if it runs anything like a window manager or another progream in the background
<clever> infinisil: nixos already sources .xprofile, before it runs .xsession
<clever> infinisil: if what you said is true, things will get very buggy
<clever> fl3: as root
<clever> fl3: what does nix-channel --list report?
<clever> infinisil: 404, /etc/X11/xkb not found
<clever> ertes: but i also ran into trouble last night doing just that, i dont think tryEval can catch the foo.bar error when foo = null;
<clever> ertes: i dont think so, have to mix deepSeq for that
<clever> ertes: it will catch certain exceptions, and return success = false;
<clever> ertes: tryEval is more like catch
<clever> octe: ah, maybe nixos never enabled that support then
<clever> octe: i dont think linux supports the flags like sharenfs
<clever> octe: i just use plain exports
<clever> octe: oh, and i dont use sharenfs either
<clever> octe: i didnt touch the ports or firewall
<clever> so it did exactly what it should do
<clever> "\"" didnt return an error
<clever> ertes: tryEval is to catch errors, not eval strings
<clever> octe: i have no trouble with nfs and zfs
<clever> thats about the only way to do it, without putting the whole file in quotations
<clever> ertes: using pkgs.substituteAll, you can set var1 = f x; and then put @var1@ into the txt file
<clever> ertes: what exactly are you trying to do?
<clever> shell and a couple of others are already set by the stdenv
<clever> pkgs.substituteAll { name = "foo"; src = ./input.txt; var1 = "val1"; } will replace @var1@ in input.txt with val1
<clever> ertes: there is also an @nix@ on 218
<clever> ertes: yeah, one min
<clever> but you could also use programs.zsh.interactiveShellInit = "source grml";
<clever> yep
<clever> and that is what created /etc/zshrc
<clever> if you set programs.zsh.enable = true; then zsh.nix will set environment.etc."zshrc".text =
<clever> and 11
<clever> fl3: only configuration.nix can manage /etc/
<clever> but /etc/passwd is a normal writable file
<clever> fl3: if you ls -l /etc/zshrc youll see its a symlink
<clever> fl3: some things in /etc are writable, but packages that are installed cant just create files when installed
<clever> fendor: also, `ls -l result` is very different from `ls -l result/`
<clever> fendor: you can safely delete it
<clever> fendor: ahh, that one specifically is from `nixos-rebuild build`
<clever> fendor: nix-build creates a result symlink pointing to the result
<clever> fendor: ls -l result
<clever> fendor: thats a symlink with the name result
<clever> das_j: nixops does the nixos build on the local machine, then copies it to the remote one with nix-copy-closure
<clever> das_j: yeah, thats how its typically done
<clever> das_j: it needs that to know where the remote machines even are
<clever> das_j: the local machine
<clever> fendor: create a symlink from .nix-profile to /nix/var/nix/profiles/per-user/$USER/profile
<clever> das_j: nixops uses a state file to keep track of what machines have been deployed
<clever> fendor: you need to own your per-user directory
<clever> drwxrwxrwt 8 root root 8 Jun 18 2016 /nix/var/nix/profiles/per-user/
<clever> drwxr-xr-x 3 clever users 21 Mar 8 19:26 /nix/var/nix/profiles/per-user/clever
<clever> fendor: yeah, thats wrong, try just `rm ~/.nix-profile` and then install something with nix-env again
<clever> das_j: yes
<clever> can you paste the exact output of the ls command?
<clever> but if you fix the symlink, nix will notice your using those things
<clever> no idea
<clever> lrwxrwxrwx 1 clever users 45 Oct 11 2015 .nix-profile -> /nix/var/nix/profiles/per-user/clever/profile
<clever> fendor: .nix-profile should point into /nix