2019-02-26

<clever> nixpkgs is also setup as an alias to the nixos channel
<clever> kyren: <nixos> refers to a channel called nixos, so it will return the entire nixpkgs set
<clever> kyren: you can also symlink configuration.nix to the real cfg, using a relative link
<clever> kyren: you want '<nixos/nixos>'
<clever> wavewave: that may do it
<clever> samueldr: i only discovered it, because i was complaining about how startrek is just mia, then i could see it on the linux pc, but not on windows ....
<clever> samueldr: but then it detected it, and i had to disable v6 in the tablet, to even use netflix at all
<clever> samueldr: it originally didnt detect that, and i was able to watch the american lineup
<clever> samueldr: so netflix just turns itself off
<clever> samueldr: ive had reverse problems, my HE tunnel resulted in netflix thinking i'm in both canada and america at the same time
<clever> one of my old routers claimed v6 support, yet the ISP didnt, and the router refused to stop claiming v6 support
<clever> Dagger: i think the problem is more, that ISP's provide broken v6 support, that tricks linux into thinking it works
<clever> Dagger: the linux network stack is supposed to detect if you lack v6, and not use it

2019-02-25

<clever> ,cache wavewave
<clever> ar1a: http(s) server?
<clever> ar1a: you can set an ssh key to only allow scp
<clever> ar1a: keypairs
<clever> slack1256: every time it passes testing on hydra
<clever> ar1a: scp for just copying things then
<clever> ar1a: either scp or nfs is what i use mostly
<clever> samueldr: he did `nix-info -m`, which uses markdown and many lines
<clever> dgarzon: the default mode (with no params) is better for pasting to irc
<clever> that will create a wrapper script for python, that adds pyusb to the PYTHONPATH, then add that wrapper to $PATH for the service
<clever> ToxicFrog: systemd.services.<name>.path = [ (python36.withPackages (ps: [ ps.pyusb ])) ];
<clever> ToxicFrog: one sec
<clever> dgarzon: if you check the inputs tab on a hydra build, you can see what rev of nixpkgs it used
<clever> hyperfekt: and now it gets that default: https://github.com/NixOS/nixpkgs/blob/master/nixos/lib/eval-config.nix#L17
<clever> hyperfekt: you would need to import eval-modules.nix yourself
<clever> hyperfekt: the top-level module?
<clever> JonReed: there is also the wipefs command
<clever> ,-A rodarmor
<clever> ,-iA rodarmor
<clever> rodarmor: yeah, it should install, but -iA will be faster
<clever> NemesisD: but it hink you want concatStringsSep
<clever> NemesisD: yeah, that could work
<clever> sphalerite: only normal push
<clever> NemesisD: double-check `env`, it may already be an env var?
<clever> hyperfekt: basically, there is a path = ./../..; somewhere in nixpkgs
<clever> hyperfekt: and then imports the patched version?
<clever> hyperfekt: what if you apply a diff to "${pkgs.path}/nixos/services/databases/postgresql.nix" while also doing disabledModules = [ "services/databases/postgresql.nix" ];
<clever> hyperfekt: https://github.com/cleverca22/nixos-configs/blob/master/nas-hydra.nix#L30 this adds 2 packages to the systemd service for hydra, without patching the hydra module
<clever> hyperfekt: for most changes, you can do them without even changing the module file
<clever> hyperfekt: you can override modules without patching nixpkgs
<clever> pingveno: any unquoted path can be used in a nix file, and refer to any file that exists
<clever> betawaffle: but that adds even more cpu costs to things
<clever> betawaffle: zramSwap.enable can automate that
<clever> hyperfekt: why do you want to patch the nixpkgs?
<clever> betawaffle: motherboard maxes out at 32g
<clever> hyperfekt: and the tar's that are provided, include the git rev already
<clever> [root@system76:~]# cat .nix-defexpr/channels/nixos/.git-revision
<clever> 6141939d6e0a77c84905efd560c03c3032164ef1
<clever> hyperfekt: thats already what nix-channel does, it fetches the nixexprs.tar.xz, and then "installs" it into the channels profile with nix-env
<clever> ottidmes: restarting results in it trying to actively use all 76gig of "ram" at once
<clever> betawaffle: i have an extension called vimium, T lets me search all open tabs by name
<clever> betawaffle: good question!
<clever> hyperfekt: just wait till i'm not online, then everything breaks :P
<clever> just click "end process" on it, and you get the ram back, and can still refesh those tabs later to use them
<clever> ottidmes: for example, there is a proc for youtube, using 3.1gig of ram, and a 2nd youtube proc using 2.6gig
<clever> ottidmes: what ive noticed helps a lot more, is to open the chrome task manager, and then kill off processes
<clever> ottidmes: 32gig of ram, and 44gig of swap in use, lol
<clever> ottidmes: chromium, unstable
<clever> ottidmes: i have 1000+ tabs open, and its using 32gig of ram, and a decent chunk of swap
<clever> wolfmantjg1234[m: as long as you have no data on the drive, you could start pver from gparted
<clever> wolfmantjg1234[m: i would just run gparted, and use that to make the partitions
<clever> averell: you probably have a ./. or /path/to/nixpkgs that contains a .git
<clever> averell: what does this show near the bottom?
<clever> [root@system76:~]# du -hc --max=0 $(nix-store -qR $(nix-instantiate '<nixpkgs/nixos>' -A system)) | sort -h | tail
<clever> averell: hmmm, let me find a full cmd
<clever> averell: when you run `nixos-rebuild dry-run`, it will give you a .drv file
<clever> wolfmantjg1234[m: you gave parted 2 devices, you should only give it one device
<clever> wolfmantjg123: if you have a github account you can also `nix-env -iA nixos.gist` then `gist --login` and then `gist -p file.txt` to upload a file
<clever> ,paste wolfmantjg123
<clever> wolfmantjg123: can you pastebin the entire output, including the command you ran?
<clever> wolfmantjg123: what error did it print?
<clever> wolfmantjg123: what error does it throw??
<clever> lejonet: builtins.fetchGit "ssh://user@host/path/to/repo"
<clever> wolfmantjg123: you dont need to zero or format the USB, writing the disk image is enough
<clever> looks like the same package is listed a dozen times
<clever> i see the same, /nix/store/0264n0mp2z891f3spwnl3fi9b65bk8q6-shadow-4.6, /nix/store/0264n0mp2z891f3spwnl3fi9b65bk8q6-shadow-4.6
<clever> betawaffle: [root@amd-nixos:~]$ nix-instantiate --eval -E 'let pkgs = import <nixpkgs> {}; eval = import <nixpkgs/nixos> {}; in pkgs.lib.concatStringsSep ", " (map (x: x.name) eval.config.environment.systemPackages)'
<clever> betawaffle: one min
<clever> wolfmantjg123: you dont have to zero the usb before writing the image
<clever> betawaffle: nix-build '<nixpkgs>' -A hello ; ls -l result/bin/
<clever> wolfmantjg123: the iso is already bootable on usb, just dd it directly to the device
<clever> betawaffle: you can install nix-index, and then use nix-locate to search it
<clever> in my case, having come from gentoo and LFS, nixos was trivial to install
<clever> oddly, the nas passes on 1809, and the router passes on unstable, but neither is passing on both!
<clever> kreisys: it can also be unfree software, that hydra isnt allowed to cache
<clever> kreisys: anything that can build to completion, will be in the cache, anything that fails to build, will also fail for you
<clever> kreisys: cachix isnt part of the tested job, so the channel only requires that hydra has tried to build it
<clever> and now the path should be totally gone
<clever> dont use sudo with nix-store --delete
<clever> rcshm: then sudo is "using" vscode, so it cant be deleted
<clever> rcshm: did you use sudo?
<clever> you must reboot to clear that root
<clever> nix-env --profile /nix/var/nix/profiles/system --delete-generations 32 33 35
<clever> oops, one too many /'s
<clever> nix-env --profile /nix/var/nix/profiles/system/ --delete-generations 32 33 35
<clever> `nix-env --delete-generations 11` as the user `va` will get rid of the above one
<clever> rcshm: what does --query --roots report?
<clever> --repair-path can aldo delete&redownload, while rooted
<clever> if its not corrupt, then there is zero point in deleting and re-downloading
<clever> srhb: nix-store --verify-path can test it for corruption
<clever> matix: `nix copy` will delete things that are invalid and in the way
<clever> any copy that doesnt involve nix commands, will just result in a GC deleting the files
<clever> nDuff: `nix copy --from local?root=/mnt --all` i think will do what you want
<clever> nDuff: you want `nix copy`
<clever> ottidmes: looks like it
<clever> matix[m]: ahh, that would explain things
<clever> matix[m]: oh, that might be related to the 1st one i linked
<clever> matix[m]: wait, wrong one, thats a diff /etc bug
<clever> ldlework: i'm seeing a lot of 'no such file' and no unexpected argument
<clever> ldlework: what does --show-trace say?

2019-02-24

<clever> i try to squash my own PR's so it only has 1 commit
<clever> earldouglas: you may need to add an installPhase to the expression, like i did in daedalus
<clever> earldouglas: and you need to run yarn once outside of the sandbox, to create yarn.lock
<clever> earldouglas: just replace npm with yarn, and your done
<clever> siers: range creates a list of numbers, from 1 to 3, map then takes each, and `x: null` ignores the number and just nulls every row
<clever> > map (x: null) (lib.range 1 3)
<clever> so it defers it until later
<clever> b.x turns into an thunk containing an ExprSelect, which does a somewhat expensive map lookup
<clever> > builtins.removeAttrs
<clever> noonien: binfmt-misc is what allows that
<clever> noonien: `--option system X` will trick nix into thinking the current platform is X, and qemu-user allows it to actually run such binaries
<clever> noonien: use nix-build --option system aarch64-linux or armv7l
<clever> and then....
<clever> noonien: add this to your imports, and then set qemu-user.arm = true;, and rebuild-switch the host
<clever> noonien: qemu-user is probably simpler, one min
<clever> tilpner: it also cant be made with IFD, so you cant have nix build it on the fly
<clever> tilpner: thats almost always whats done with it, to save others the time spent generating
<clever> tilpner: you need to use -A to select your own package, or its going to try to build all of hackage
<clever> tilpner: that nix file contains all of hackage, with the changes defined in your stack.yaml
<clever> earldouglas: you want to use yarn2nix
<clever> spacekitteh[m]: currently eating
<clever> fenlomat: yeah
<clever> noonien: that will automatically run any derivation, to run inside qemu, as root
<clever> > vmTools.runInLinuxVM pkgs.hello
<clever> fenlomat: edit the kernel cmdline in grub by hitting e
<clever> nixos-rebuild or nixos-install are required to update them
<clever> fenlomat: the files its stored in are even less mutable, and nix will get very upset if you try to change them
<clever> fenlomat: then its fully booted, and bypasses all login prompts
<clever> fenlomat: another option, is to just boot the nixos with `init=/bin/sh` (and tell it to continue when it claims it doesnt exist)
<clever> fenlomat: because mutable users is false, nixos will undo the pw change on bootup
<clever> jonreeve[m]: yeah, thats fairly normal setup
<clever> flip them around the other way
<clever> jonreeve[m]: i think i got super and self backwads
<clever> fenlomat: you could just edit the configuration.nix, and then re-run nixos-install, and it will update the system for you
<clever> jonreeve[m]: updated the gist again
<clever> jonreeve[m]: that is not where you find haskell.lib
<clever> jonreeve[m]: haskellLib ? (import <nixpkgs> {}).haskellPackages
<clever> jonreeve[m]: one min...
<clever> fenlomat: you can also just re-run nixos-install, that is just a bash script that runs nixos-rebuild for you, inside a chroot
<clever> fenlomat: nixos-rebuild boot
<clever> noonien: --show-trace should say
<clever> jonreeve[m]: `super: x` defines a function, that takes 1 argument called super, and returns x
<clever> noonien: the lkl package only works on 64bit x86, and 64bit arm, so it wont work on 32bit arm
<clever> fenlomat: you cant do switch/test, only boot/build
<clever> siers: mkDerivation directly accepts platforms, and will move it to meta for you
<clever> > lkl.meta.description
<clever> siers: which meta field are you trying to set?
<clever> laas: if you want a specific gcc, use one of these stdenv's
<clever> 6766 gcc8Stdenv = overrideCC gccStdenv gcc8;
<clever> 6765 gcc7Stdenv = overrideCC gccStdenv gcc7;
<clever> laas: line 6754 of all-packages.nix, gcc is assigned to be gcc7
<clever> 6754 gcc = gcc7;
<clever> noonien: i was using this when testing something similar: nixpkgs.system = "armv7l-linux";
<clever> fenlomat: nixos-enter
<clever> noonien: you need to set nixpkgs.localSystem.system i think
<clever> ryantm: yeah
<clever> and for all other names, it generally goes to a channel by the same name
<clever> yeah, <nixpkgs> is mapped to the nixos channel by default
<clever> noonien: <nixos-unstable/nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix>
<clever> etu: TMPDIR, TEMP, and TMP also point to the same path
<clever> etu: thats the output of running `env` in a bare env (not even the stdenv is present)
<clever> etu: $NIX_BUILD_TOP i believe
<clever> so it would have to use weights, and prefer something with more of the inputs, but not force it
<clever> sphalerite: you would also obey max-jobs, and maybe try to keep things balanced
<clever> sphalerite: pipes-async is also busted on master
<clever> [clever@amd-nixos:~/apps/cachecache]$ nix-build https://github.com/nixos/nixpkgs/archive/master.tar.gz -A haskellPackages.pipes-async
<clever> sphalerite: i was thinking more to reduce how much you have to copy, to get the builder up to speed, but your issue also helps, if one of the builders happens to have a finished product
<clever> then you need to build something, which slave do you pick for the job?
<clever> sphalerite: lets say you have 2 build slaves, A has nothing in the store, B has 80% of some closure
<clever> sphalerite: something ive thought of, that would improve the perf of hydra
<clever> LnL: while checking for my issues, i found https://github.com/NixOS/nix/issues/2675#issuecomment-466742841
<clever> ive got a few issues open on that in nix
<clever> LnL: the gc root stuff has a lot of problems with local=
<clever> LnL: but i did just have an idea, what about local?root=/foo/, then its a full store (with GC) yet isolated from your secrets
<clever> but it lacks GC support, so it will grow costly
<clever> LnL: was just thinking of that, create a local cache, that can be hosted with static file hosting
<clever> teto: sure
<clever> but i dont have infinite storage for my personal hydra, so GC is a must
<clever> also better for security
<clever> LnL: we got around it by just switching to s3://, which cant GC
<clever> LnL: yeah, thats part of where iohk ran into trouble, hydra would GC something, and then for 30 days, anything using the cache would fail hard, because the cache says it exists, but it doesnt
<clever> ouch, 30 days!
<clever> > 2592000 / 3600 / 24
<clever> 1h and 720 hours
<clever> > 2592000 / 3600
<clever> narinfo-cache-positive-ttl = 2592000
<clever> narinfo-cache-negative-ttl = 3600
<clever> for negative hits, it caches it for a few hours i think
<clever> LnL: for positive cache hits, it caches it for days, which can be a problem
<clever> LnL: i setup `store-uri = file:///nix/store?secret-key=/etc/nix/keys/secret-key-file` and hydra didnt add `Sig:` to its narinfo files
<clever> nix.conf is already set to sign everything, so it should have already had a signature anyways
<clever> secret-key-files = /etc/nix/keys/secret-key-file
<clever> sphalerite: already started that, but i dont think hydra takes advantage of any nix2.0 features
<clever> i dont think its ever been signing things?
<clever> and i dont know how i managed to overlook this on my hydra for so long
<clever> 3am, and there is just so much to remember, easy to forget things sometimes
<clever> :D
<clever> that fixed path-info
<clever> [root@amd-nixos:~]$ rm -rf ~/.cache/nix/binary-cache-v6.sqlite*
<clever> sphalerite: *doh*, thats it
<clever> sphalerite: but this reports no signature
<clever> [root@amd-nixos:~]$ nix path-info --store https://hydra.angeldsis.com /nix/store/hwfaajd788v6djj04rc9ss8cfhyj21s2-timeit-2.0 --json | jq
<clever> sphalerite: i can see a sig: in here
<clever> sphalerite: related, i'm having some trouble with signatures on my binary cache
<clever> slack1256: https://gist.github.com/cleverca22/bc86f34cff2acb85d30de6051fa2c339 has random notes ive made about the new store URI's
<clever> slack1256: its just the name of a protocol within nix, for accessing remote stores
<clever> sphalerite: related, ive noticed that you can copy .drv files, even if you arent trusted, because the path is based on a hash of the contents, no trust is needed
<clever> teto: i think you want --option builders ssh://foo
<clever> teto: `--store ssh://foo` requires that $USER (the remote user by the same name as local) be trusted on the remote box, or it cant add things to its /nix/store/
<clever> ah, ive not tried that yet
<clever> kvm_intel 225280 0
<clever> vboxdrv 434176 2 vboxnetadp,vboxnetflt
<clever> [clever@system76:~/nixos-configs]$ lsmod | grep -i vbox
<clever> if your confortable with qemu, that also works great
<clever> i have noticed the gui has gotten worse after the latest update
<clever> no need to disable or reset things
<clever> but if you close the vbox vm, qemu-kvm instantly begins to work
<clever> if you start a vbox vm, then qemu-kvm will hard-fail on startup
<clever> Arahael: both kvm and virtualbox use the same cpu extensions, and while you can load both drivers at once, only one can be actively using those features
<clever> Arahael: of note, virtualbox doesnt use kvm, and partially conflicts with it
<clever> Arahael: i would use debian under virtualbox personally
<clever> Arahael: same, but ive not been into android since i switched to nixos
<clever> Arahael: probably, something like the steam-run chroot may help
<clever> Zer000: yep
<clever> Zer000: that happens if you mix qt versions in nix-env vs systemPackages, uninstall everything QT in `nix-env -q`, and add anything you want to keep to systemPackages
<clever> ive seen a haskell guy get ++c and c++ mixed up, and translated it to haskel the wrong way, and refused to understand the difference
<clever> lol
<clever> add it to the ticket on nixpkgs, i'm guessing setup-etc.pl is further confused by a symlink to a symlink
<clever> the nixpkgs one?
<clever> if they are missing from the config
<clever> kyren: setup-etc.pl will keep track of the symlinks it makes, and delete them when it next updates /etc/
<clever> but youll get more progress done per retry
<clever> that will make it build other things, and fail later on
<clever> ,cache ivan
<clever> kyren: setup-etc.pl is part of nixpkgs
<clever> kyren: hmmm, it could be either, it could be setup-etc.pl breaking things when handling relative links, or it could be a bug in nix, following relative links
<clever> ibrahims: i think its already in the latest channel, but i havent confirmed that
<clever> justanotheruser: config.nix
<clever> kyren: looks like something worth filing a bug against nixpkgs, but you can use my example as a work-around
<clever> ibrahims: it was broken in nixos-unstable for a few days, but has already been fixed
<clever> kyren: https://github.com/cleverca22/nixos-configs/blob/master/nixops-managed.nix#L12-L16 is how i do the same thing, and it doesnt have this issue
<clever> kyren: it sounds like a bug in nix, when following multiple relative symlinks
<clever> kyren: how did you configure /etc/nixpkgs ?
<clever> readlink("/etc/static/nixpkgs", "../../xp7gm5nq3r2m16cwhfk71kwqj4"..., 1024) = 119
<clever> readlink("/etc/nixpkgs", "static/nixpkgs", 1024) = 14
<clever> and then pastebin the logfile it creates
<clever> kyren: strace -o logfile -ff nix-shell -p hello -vvvv
<clever> kyren: what is the contents of /etc/nixpkgs/ ?
<clever> kyren: rm -rf ~/.cache/nix/tarballs/
<clever> kyren: looks like its working just fine, what exactly is the problem?
<clever> kyren: and also `echo $NIX_PATH`
<clever> kyren: can you pastebin the output of `nix-instantiate --find-file nixpkgs -vvvv` ?
<clever> kyren: you can also test it with nix-instantiate --find-file nixpkgs
<clever> you probably want NIX_PATH=nixpkgs=/etc/nixpkgs
<clever> kyren: just like -I/usr/include makes #include <foo.h> look at /usr/include/foo.h
<clever> kyren: NIX_PATH=/etc/nixpkgs means to look for <nixpkgs> at /etc/nixpkgs/nixpkgs
<clever> bpye: no real way to access stuff hidden in a let block, your only choice is to copy the code out

2019-02-23

<clever> and it will re-sign them with your gpg, because you lack the authors gpg
<clever> it will change the headers in the commits, to say you where rewriting history
<clever> ah, yeah
<clever> it can have trouble if merge conflicts exist
<clever> tilpner: thats the same as `git rebase origin/master`
<clever> yeah, mv is atomic, so its basically instant
<clever> adamantium: yeah, just ignore it till somebody else fixes it
<clever> adamantium: probably a bug in nixos then
<clever> and since its only a mv, you can undo anything thats important
<clever> i think you can also `echo /home > /etc/NIXOS_LUSTRATE` to make it not move /home, and similiar for other paths you care about
<clever> so it will practically be a fresh install
<clever> adamantium: if you create a /etc/NIXOS_LUSTRATE and reboot, then the initrd will move EVERYTHING in / to /old-root/
<clever> adamantium: oh, one other thing, let me find it
<clever> but youll likely want to not loose it
<clever> it can boot without one
<clever> configuration.nix is only ever used when you nixos-rebuild
<clever> so id recomend rename instead
<clever> that will also loose your configuration.nix