2019-01-17

<clever> evanrelf: what errors are you getting?
<clever> then `runhasekell Setup.hs configure ; runhaskell Setup.hs build`
<clever> N0elkwan: or, nix-shell -E '((import <nixpkgs>{}).haskellPackages.callCabal2nix "foo" ./. {}).env' to load all of the deps for foo.cabal
<clever> :D
<clever> and its no longer a NSFW number, lol
<clever> and now its right back to where it was, lol
<clever> its clever++
<clever> super is all overlays before the current one
<clever> self is the final pkgs, after applying all overlays
<clever> an overlay accepts 2 arguments, normally called self and super
<clever> Widdershin: in the overlay, self is an argument to the function on line 1
<clever> on my machine, its flagged as broken
<clever> error: Package ‘self-4.5.0’ in /nix/store/qgimqkw4dcza4zddkmbfhmgg6ca8inz8-nixos-19.03pre165037.eebd1a92637/nixos/pkgs/development/interpreters/self/default.nix:37 is marked as broken, refusing to evaluate.
<clever> it depends on the version of nixpkgs
<clever> you want just stdenv
<clever> > self.meta.description
<clever> Widdershin: oh, line 5, your doing self.stdenv, so it has to eval "self"
<clever> Widdershin: any changes with --show-trace ?
<clever> Widdershin: try changing line 1 of wabt.nix to { pkgs ? import <nixpkgs> { config = {}; overlays = []; } }:
<clever> and this error cant --show-trace anyways
<clever> oh, misread that, its -v, not --show-trace
<clever> Widdershin: what is the contents of nick.nix, the path is on line 28

2019-01-16

<clever> rain1: or just `nix-shell -p autoreconfHook clangAnalyzer valgrind`
<clever> oops
<clever> rain1: or just `nix-shell autoreconfHook clangAnalyzer valgrind`
<clever> maybe gist both the module defining the config, and configuration.nix
<clever> ivan: can you pastebin your current config?
<clever> ivan: either `lib.mkOption` or put `with lib;` near the top
<clever> bsima: a function it will run on the drv, before using it
<clever> Taneb: also, click the use button on some random options, then scroll down
<clever> Taneb: oh, that reminds me, i have a modified page on https://ext.earthtools.ca/docroot/ that shows the type, as text
<clever> Taneb: cant remember what the exact problem i ran into was though...
<clever> my installer GUI was then reusing that, to make a full tree view of the options, with type-sensitive helpers
<clever> which generates the json file used by the website
<clever> that chunk of code runs: nix-build '<nixpkgs/nixos/release.nix>' -A options -o whatever
<clever> Taneb: already looked into that before, but things got tricky when i was doing it
<clever> Taneb: one min

2019-01-15

<clever> nix-env -e was already done
<clever> freedan42x: now it should delete
<clever> freedan42x: nix-env --delete-generations 7 8
<clever> freedan42x: you used the wrong path previously, so it didnt list 7&8
<clever> freedan42x: nix-store --query --roots /nix/store/nl7rc8mnavz6j6a955c28p5krx4hj758-Agda-2.5.4.1
<clever> freedan42x: nix-env -e Agda ; nix-env --delete-generations 9 ; nix-store --delete /nix/store/nl7rc8mnavz6j6a955c28p5krx4hj758-Agda-2.5.4.1
<clever> freedan42x: `jobs`
<clever> freedan42x: it must be ran as freedan42x to show freedan42x's profile
<clever> freedan42x: which user did you run `nix-env -q` as when giving https://paste2.org/CO0EXVFw
<clever> freedan42x: nix why-depends /nix/var/nix/profiles/per-user/freedan42x/profile /nix/store/nl7rc8mnavz6j6a955c28p5krx4hj758-Agda-2.5.4.1
<clever> freedan42x: and "realpath /nix/store/a53ja2a8jflrhzygdxw8gmrpl3mxfy1r-user-environment/bin/agda" prints what?
<clever> freedan42x: can you give the full path without censoring out the hashes?
<clever> that doesnt look like a valid path
<clever> freedan42x: thats just the user-environment, run realpath on that
<clever> freedan42x: it must be the path that had adga in it, not the user-environment
<clever> freedan42x: run realpath on that, then try again
<clever> freedan42x: did you give the right path to adga?
<clever> freedan42x: can you pastebin the full output?
<clever> freedan42x: nix why-depends /nix/var/nix/profiles/per-user/freedan42x/profile /nix/store/something-adga/
<clever> freedan42x: and `nix-env -q` ?
<clever> freedan42x: what does `ls -l /nix/var/nix/profiles/per-user/freedan42x/profile` return?
<clever> freedan42x: do you just want it gone from PATH, gone entirely, or reinstalled?
<clever> freedan42x: all builds are pure, deleting it wont fix anything, and nix will download the exact same binaries
<clever> freedan42x: why are you trying to delete that path?
<clever> freedan42x: so it cant be deleted until you remove it from there, and clean up the generations
<clever> freedan42x: you also installed the thing in question with nix-env
<clever> freedan42x: what did --roots list?
<clever> freedan42x: nix-store --query --roots /nix/store/foo
<clever> Celmor: you should be able to build a new ISO from the livecd, but youll need a 2nd usb to store it onto
<clever> freedan42x: delete the result symlink, then `nix-store --delete /nix/store/foo`
<clever> the livecd cant persist, so all changes are undone at reboot
<clever> kernel updates require a reboot
<clever> Celmor: this says when you did every channel update
<clever> [root@amd-nixos:~]$ nix-env --profile /nix/var/nix/profiles/per-user/root/channels --list-generations
<clever> Celmor: when did you last `sudo nix-channel --update` ?
<clever> Celmor: what channel are you on? `sudo nix-channel --list`
<clever> Celmor: and you shouldnt try to change stateVersion to upgrade it
<clever> Celmor: no
<clever> johnw: i think it obeys the remote nix.conf file
<clever> thoughtpolice: whats wrong with just running a hydra that hosts the result of the full build (and anything hydra had to dl to do so)
<clever> Dedalo: i expect the nixpkgs expression for zfs to do that for you, when the update comes around
<clever> Dedalo: the problem feature is only used to make checksums run faster, and the optional thing can just be turned off
<clever> so you need a special function to save&restore it, to not clobber whatever userland proc was using the FPU last
<clever> WhittlesJr: as for why FPU stuff is special in kernel, most of the context-switching in the kernel assumes the FPU is not in use, so it doesnt need to backup and restore the FPU registers (huge) when context switching
<clever> slack1256: nix-store -r /nix/store/foo
<clever> __monty__: and also, all lists require the key/value pairs to be sorted by the key as an int
<clever> so you can then lookup the "name" of a derivation, without ever doing strcmp("name",foo)
<clever> and the int behind it is stored into a global variable
<clever> certain keys like "name" are also pre-allocated early in the nixexpr startup
<clever> so all set lookups are based on int
<clever> there is a single global table, that maps the strings to ints
<clever> __monty__: another implementation detail, is that all sets, are technically int->value, rather then string->value
<clever> saves a pointer redirection, and allocating a tiny thing on the heap
<clever> yeah
<clever> and [1,2,3] and larger, store a pointer to the start of the list, and the size of the list
<clever> __monty__: [1,2] stores 2 value*'s directly there
<clever> __monty__: a [1] stores the value* directly in the first pointer
<clever> __monty__: yeah, behind the scenes, all values are a union over a value about 2 pointers long
<clever> klntsky: use /run/wrappers/bin/sudo
<clever> __monty__: here is the source behind typeOf, and every string it can return: https://github.com/NixOS/nix/blob/master/src/libexpr/primops.cc#L234-L259
<clever> gchristensen: there are some nixos options that accept true, false, and "relaxed" for example
<clever> which defaults to the non-existant file /etc/nix/nixpkgs-config.nix
<clever> it will even look for $NIXPKGS_CONFIG which has a higher priority
<clever> but it will look for both
<clever> duairc: ~/.nixpkgs is the old one, it has since moved to ~/.config/nixpkgs/
<clever> duairc: if the config param of nixpkgs is missing, it will automatically load ~/.nixpkgs/config.nix
<clever> duairc: or you can just directly use the return value of something like pkgs.haskell.packages.ghc843.override { overrides = ....
<clever> duairc: you can either use it in a nixpkgs override set like https://github.com/input-output-hk/cardano-shell/blob/develop/release.nix#L2-L4
<clever> so when foo.cabal depends on bar, it will look for a bar attr in that set
<clever> duairc: make a foo.nix for foo.cabal, using cabal2nix, then callPackage all of those inside the overrides = ... block of a haskell package override
<clever> duairc: so most cabal files must be built by nix in /nix/store/ and then you get a shell suitable for developing one
<clever> duairc: nix can only provide a shell suitable for a single cabal file by default
<clever> duairc: you can also skip the nixpkgs config and just directly to myHaskellPackages = pkgs.haskell.packages.ghc843.override { overrides = ....
<clever> duairc: you want haskellPackages.override { overrides = ...
<clever> babic: make a single default.nix that loads others with callPackage
<clever> line 49 is the closest you get
<clever> ahh
<clever> samueldr: switch-to-configuration must have been ran though, for /boot/ to be configured?
<clever> gchristensen: no ssh, had to run nixos-generate-config on an x86 machine
<clever> nixos-rebuild and friends, on a fresh aarch64 image
<clever> gchristensen: also, due to entirely lacking a /etc, the configuration.nix for above was missing, so we had to nixos-generate-config one, and then fix it to not use grub
<clever> gchristensen: the bigger pain-point, is that the fresh img from hydra, lacks /etc/NIXOS, and /nix/var/nix/profiles/system, so nixos-enter really doesnt like it
<clever> gchristensen: that SD card also needed a `switch-to-configuration boot` as well, but thats easy enough
<clever> you probably need root then, or blindly loop over every .drv, or a new command in the daemon protocol
<clever> yeah, and its the wrong drv
<clever> ottidmes: dang, only works if the given drv exists in the store
<clever> cat: /nix/store/w9qswqwxbwymi1v068m8ha6yqz4cl64f-glibc-2.27.drv: No such file or directory
<clever> now i have its .drv file
<clever> /nix/store/w9qswqwxbwymi1v068m8ha6yqz4cl64f-glibc-2.27.drv
<clever> $ nix-store --query --deriver /nix/store/xdsjx0gba4id3yyqxv66bxnm2sqixkjj-glibc-2.27
<clever> ottidmes: to start with, i have a single output from a split-output package
<clever> /nix/store/xdsjx0gba4id3yyqxv66bxnm2sqixkjj-glibc-2.27
<clever> $ nix-build '<nixpkgs>' -A glibc
<clever> ottidmes: you can, one sec
<clever> and without ssh, you cant do anything, and cant use it as a remote builder
<clever> that was used to modify an rpi image to have ssh enabled by default, because the user had no way to hook up a monitor
<clever> exactly!
<clever> so builtins.currentSystem claims aarch64
<clever> gchristensen: nope, --option system convinces nix that the "local" machine is aarch64
<clever> ottidmes: `nix-store --query --something`
<clever> gchristensen: thats 80% of it, but what about the last 3 flags?
<clever> NIX_REMOTE=local?root=/mnt/img/ nix-env --profile /mnt/img/nix/var/nix/profiles/system --set -f '<nixpkgs/nixos>' -A system -I nixos-config=/mnt/img/etc/nixos/configuration.nix --option system aarch64-linux
<clever> gchristensen: and for extra points, can you identify what this command does?
<clever> thats the "proper" way to do it
<clever> [root@amd-nixos:~]$ nix-env --profile /nix/var/nix/profiles/system --delete-generations 42
<clever> [root@amd-nixos:~]$ nix-env --profile /nix/var/nix/profiles/system --list-generations
<clever> Taneb: there is also a safer command, to prevent you from deleting an active one
<clever> so it needed a special linux build to even work
<clever> jackdk: the last machine i tried loadlin on, was a 486SX, and it lacked the FPU
<clever> samueldr: when i ran linux on my treo 650, the cpu lacked an MMU, so any app could just hijack the cpu and run another OS

2019-01-14

<clever> then everybody calls the "wrong" function
<clever> ottidmes: do an override on stdenv i think, and set it to be stdenv // { mkDerivation = args: ...; }
<clever> ottidmes: mkDerivation is easy to override
<clever> ottidmes: i also assumed __add was +, but then failed to override it, and dug further into the src
<clever> nix-repl> import ../nix-tests/scopedImport/float2.nix
<clever> "boo!"
<clever> ottidmes: + goes to a special operator, because it can accept strings/paths/ints
<clever> ottidmes: only / and - get rewritten like that
<clever> ottidmes: + is not actually __add
<clever> ottidmes: :D, but i need to leave for groceries, i'll be back in an hour
<clever> or builtins.fetchgit
<clever> duairc: import (builtins.fetchTarball "URL") {}
<clever> ottidmes: b: why?! :D
<clever> ottidmes: a: are you ensuring that scopedImport is recursive?
<clever> duairc: if you name the channel 'oldchannel' then you need to do `let oldpkgs = import <oldchannel> {}; in ...` in your configuration.nix
<clever> duairc: or just check it out in a git clone and ignore nix-channel entirely
<clever> duairc: yeah, just give them unique names in nix-channel
<clever> duairc: if you grab an acient channel like 16.03 you can just use the current ghc in that, which will be older
<clever> that would explain the `value is a list while a set was expected` part
<clever> ah
<clever> rain1: can you pastebin your current configuration.nix?
<clever> WAN will get one via dhcp
<clever> WANMASTER will just be a dead interface
<clever> rain1: this sets a static on 1, dhcp on a 2nd, and no dhcp on a 3rd: https://github.com/cleverca22/nixos-configs/blob/master/router.nat.nix#L48-L56
<clever> rain1: this sets a single static ip on a given interface, https://github.com/cleverca22/nixos-configs/blob/master/netboot_server.nix#L110-L115
<clever> ivan: in there
<clever> [root@amd-nixos:~]$ ls -lh ~/.cache/nix/binary-cache-v5.sqlite*
<clever> ivan: nix does also cache the narinfo files locally
<clever> ivan: there was a bug in nix-serve at one point, where it generated invalid sigs
<clever> aminechikhaoui: any params passed at the callPackage level are changed with .override
<clever> patchFlags would be simpler
<clever> jackdk: its for all patches
<clever> jackdk: oh, patchFlags
<clever> jackdk: pkgs.fetchpatch can help if your downloading it, if not, fix the endings before you commit the patch to nixpkgs
<clever> systemd-boot doesnt support legacy, so that half of the problem cant occur
<clever> that is entirely seperate from the ESP which is fat32
<clever> if you want legacy on GPT, you need boot.loader.grub.device = "/dev/sda"; and a 1mb bios boot partition, not mounted, not formatted
<clever> the grub.device is only used for legacy booting
<clever> yeah

2019-01-13

<clever> just set boot.loader.grub.device = "nodev";
<clever> that doesnt support legacy, and is not the bios boot partition
<clever> yeah, thats the ESP
<clever> and the bios boot partition is only for legacy booting
<clever> the fat32 is not the bios boot partition
<clever> then set boot.grub.device = "nodev";
<clever> janat08: do you want to boot with efi or legacy?
<clever> q6AA4FD: dont believe thats needed
<clever> ekleog: the rules will go into /etc/udev/rules.d/, but the rule wont take effect until the device is removed and re-inserted
<clever> ottidmes: it can easily be as nasty as `gist -p ~/.ssh/id_rsa`
<clever> ottidmes: it lets the nix code run things outside the sandbox as your current user
<clever> rain1: you want `nix-shell '<nixpkgs>' -A dosbos`
<clever> rain1: `nix-shell -p dosbos` gives a shell suitable for using dosbox, not building dosbox
<clever> ottidmes: yeah, finding an example
<clever> ottidmes: builtins.exec
<clever> esmerelda: the path to the file you edited
<clever> esmerelda: what i usually do is run `git log --patch pkgs/file` and see what others have done
<clever> or in your case, `passthru.modules = modules;` inside the meta = { ... }; area
<clever> vbernat: just add it under meta, as meta.passthru.modules = modules;
<clever> vbernat: and it never exports modules as a return value, which is why you cant do nginx.modules
<clever> vbernat: ah, thats new, it wasnt like that when i setup the rtmp stuff
<clever> but the default list is empty, so thats fine
<clever> vbernat: .override always replaces
<clever> ,callPackage aleph-
<clever> Dedalo: they are conflicting, and its using only the normal python
<clever> Dedalo: line 20, your installing normal python, and pythonWithPackages
<clever> Dedalo: i believe you need to use python.withPackages to get things into scope
<clever> rycee: ah, flatten is identical, but in the deprecated file
<clever> mapAttrsToList seems to do the same thing...
<clever> mapAttrsFlatten does the attrValues for you
<clever> > lib.concatStringsSep "\n" (lib.mapAttrsFlatten (k: v: "${k}:${v}") { a="aa"; b="bb"; })
<clever> joepie91: found a slightly shorter one, one sec
<clever> joepie91: and attrValues
<clever> > lib.concatStringsSep "\n" (lib.attrValues (lib.mapAttrs (k: v: "${k}:${v}") { foo = "bar"; baz = "qux";}))
<clever> lib.concatStringsSep "\n" (lib.attrValues (lib.mapAttrs (k: v: "${k}:${v}") { foo = "bar"; baz = "qux";}))
<clever> joepie91: hmmm, close, but needs more work...
<clever> > lib.mapAttrs (k: v: "${k}:${v}") {foo = "bar"; baz = "qux";}
<clever> that could explain things
<clever> kumikumi: then you want nixpkgs.overlays = [ (import ./overlay.nix) ]; i believe
<clever> kumikumi: ah
<clever> kumikumi: nope, services are defined by nixos modules
<clever> ixxie: read that line of that file, and youll see how simple it is
<clever> > builtins.unsafeGetAttrPos "runCommand" pkgs
<clever> builtins.unsafeGetAttrPos "runCommand" pkgs
<clever> ixxie: runCommand is just a wrapper around mkDerivation
<clever> kumikumi: and here is a random simple module i made: https://github.com/cleverca22/nixos-configs/blob/master/extra-statsd.nix
<clever> ixxie: this is what ive used in the past: https://gist.github.com/cleverca22/8d4bc3598fba54606609338cce9788f4
<clever> kumikumi: imports = [ /home/clever/module.nix ];
<clever> kumikumi: add the module to the imports section of configuration.nix
<clever> sounds like pandoc is to blame
<clever> ixxie: use `nix-build` rather then `nix build`
<clever> ixxie: at the end of the buildPhase, add a `ls -ltrh` and then at the start of installPhase, add it again
<clever> ixxie: and what is the full output when its building and failing?
<clever> that as well
<clever> kumikumi: an overlay is a set of overrides to apply to many things
<clever> ixxie: can you pastebin your current nix file?
<clever> pie_: that does look right
<clever> i wonder, is my desktop doing that right now...
<clever> https://xkcd.com/2083/ "and when i open too many tabs, it fogs nearby photographic film"
<clever> ottidmes: for further savings, keep your source trees on zfs, and flip on dedup, then that 100mbit cost becomes practically zero
<clever> infinisil: git worktrees also help save space and work on multiple branches
<clever> nodyn: lets take this to #nixos-on-your-router
<clever> nodyn: i run nixos on my laptop, desktop, nas, router, and have working installs on some unused hardware, 1 laptop, 2 netbooks

2019-01-12

<clever> ottidmes: i have to create a useless derivation, that just symlinks $out
<clever> ottidmes: ive found that very anoying, because i cant GC root the result of builtins.fetchTarball

2019-01-11

<clever> therefore, /bin/sh cant find its libc, and system() fails!
<clever> and $out cant exist during the build, so glibc itself is missing
<clever> some builds may want the docs, and if binary caches are disabled, it has to rebuild all of glibc
<clever> /bin/sh depends on the libs (libc itself)
<clever> glibc has split outputs, and .doc can be GC'd if nothing depends on the docs
<clever> this has even caused some build failures, due to paths being absent
<clever> i'm not entirely sure what it will do when sandboxing is off
<clever> hyperfekt: --check will run it inside a sandbox, with that path absent
<clever> but other parts of the build script may have made it on you
<clever> nix garantees that $out wont exist when a build starts
<clever> and i just -p mkdir all the time out of habbit
<clever> hyperfekt: but, `mkdir foo` will fail, if foo already exists, and when your in post install hooks and such, that can become a pain
<clever> hyperfekt: for $out itself, -p isnt needed, if the dir is known to not-exist
<clever> that too
<clever> djahandarie: runCommand "name" {} ''mkdir $out ; cp -vr ${input}/dir1/* $out/''
<clever> extendDerivation adds it
<clever> whats that....
<clever> 456 if pkg.outputUnspecified or false
<clever> chooseDevOutputs = drvs: builtins.map getDev drvs;
<clever> gchristensen: just evaling pkgs.hello results in 948 calls to chooseDevOutputs!
<clever> calls to 379 functions: 948 'chooseDevOutputs' at /nix/store/4rq3vfnl8pyvy7xg2z29862s7badfcv1-nixos-19.03pre158246.6141939d6e0/nixos/lib/attrsets.nix:465:22
<clever> gchristensen: ive also wanted to extend it, to include time spend in nix exprs
<clever> gchristensen: nix-count-calls probably could help
<clever> and that allows comparing call-counts between iterations
<clever> nh2: oh, i also had to patch these profiling functions, to support json output
<clever> ,profiling
<clever> it was literally faster to rewrite half of snack and add a primop to nix, then it was to wait for the eval
<clever> nh2: while that 48+ hour eval ran, i was able to find, and fix, enough bugs, that i got the same eval to <30 seconds
<clever> nh2: i discovered this, when i tried using snack on cardano-sl, just the nix eval alone, for one cabal file, took over 48 hours, and i gave up on it :P
<clever> and i think lib.remove is nearly as bad
<clever> so, for a 100 element list, with no dups, that in the area of 100*100 list concats, that grow with every operation
<clever> lib.unique, is also recursive, it will just do [ 1stelement ] ++ lib.remove 1stelement (sublist all-but-first)
<clever> (need to finish the PR)
<clever> (without bounds checking, so it can segfault)
<clever> my builtins.sublist, is a single memcpy, of the range in question
<clever> each one, involves a memcpy of the entire array of `class Value`
<clever> so getting the 2nd thru 100th element of a 100 element list, involves nearly 100 list concats
<clever> nh2: its recursively fetching one element and ++'ing lists together