2018-04-03

<clever> Turion: possibly
<clever> Turion: its meant to track what version you originally installed, so non-compatible changes in nixos can be worked around
<clever> Turion: it must never be changed
<clever> Turion: that would break the very thing its meant to fix
<clever> Guest29: when did you last do a nix-channel --update as root?
<clever> Guest29: ive been setting it to nix.package = pkgs.nixUnstable; but there should also be a nixStable2 now
<clever> and the channels refuse to update when certain important things are broken
<clever> Turion: unstable is based on master, where every single pr goes, and it will break more often
<clever> Turion: 18.03 is a branch that will only be receiving fixes and important upgrades, so it breaks less often
<clever> you would need to import an unpatched nixpkgs, then use a derivation to apply the patch to a copy of nixpkgs, then import-from-derivation that result
<clever> jluttine: if you add .patch to a URL for a commit, github gives it to you in patch form, but applying that patch to nixpkgs isnt so simple
<clever> Turion: all users inherit roots nix-env packages, but systemd doesnt
<clever> postgresql has 2 different incompatible changes it has gone thru
<clever> Turion: it would only work for root
<clever> Turion: you need to set the nix.package entry in configuration.nix to properly update it
<clever> Turion: that still wont change the daemon that systemd runs
<clever> Guest29: never
<clever> yeah
<clever> and if the process running has +w to /nix/store, it just bypasses the daemon and forks out the same worker the daemon would have made
<clever> elvishjerricco: then nix-store -r asks the daemon to build those drv files
<clever> elvishjerricco: nearly everything nix-instantiate does is client side, and it generates a tree of .drv files (which it has to forward to the daemon to put in the store)
<clever> elvishjerricco: and also, some of the 2.0 features need a 2.0 daemon, and fail with weird errors
<clever> elvishjerricco: it also causes other fun problems, somebody in here has 1.11 installed with nix-env, but 2.0 as the daemon, so NIX_REMOTE was no longer setup, which broke the 1.11 nix
<clever> elvishjerricco: right
<clever> you must change it via nix.package in configuration.nix, and any attempt at installing it with nix-env will just cause problems
<clever> Turion: nix-env cant change the nix version on nixos

2018-04-02

<clever> lostman: you need to also manually include the cache.nixos.org key
<clever> orbekk: not at the moment
<clever> orbekk: this reveals the exact file&line that pkgs.makeWrapper was assigned at
<clever> nix-repl> builtins.unsafeGetAttrPos "makeWrapper" pkgs
<clever> { column = 3; file = "/nix/store/vylxsj58k3w71jn3j11xd45s9b71qbkw-nixos-18.03pre130932.cc4677c36ee/nixos/pkgs/top-level/all-packages.nix"; line = 329; }
<clever> orbekk: there is also builtins.unsafeGetAttrPos which tells you where an attr was defined
<clever> deltasquared: cant remember the name
<clever> orbekk: i think there is a magic attribute you can put in a set, that makes it act like a function
<clever> and the nix libc has to be compatible with the opengl libs
<clever> deltasquared: and the drivers have to be compatible with the xorg side of things
<clever> deltasquared: it depends on which GPU you have
<clever> deltasquared: nix-build -E 'with import <nixpkgs> {}; callPackage ./. {}'
<clever> telent: fixup phase
<clever> ah, so the inner nix-shell was pure, which caused it to not find the mac locales
<clever> jqq: that allows doing a pure build based on the stack.yaml
<clever> rather then an impure nix-shell build
<clever> jqq: have you heard of stack2nix?
<clever> and stack --nix calls nix-shell already
<clever> nix-shell leaks a lot of things
<clever> you might also need glibcLocales in the inputs
<clever> jqq: try running locale from nix-build?
<clever> semilattice: though that would require an override to every single derivation, causing new issues
<clever> other then the supported feature stuff
<clever> none that i know of
<clever> semilattice: its not likely that the owner is at play
<clever> semilattice: all packages installed with nix are owned by root
<clever> that sounds sane
<clever> would need to check the source to see what it does with that vlaue
<clever> maybe
<clever> i think
<clever> "-DFALLBACK_DATA_DIRS=${libGL.driverLink}/share:/usr/local/share:/usr/share"
<clever> oh, i see, different suffix depending on the prefix
<clever> check to see if it has an env var to configure it to look elsewhere
<clever> yeah, nix-env manages .nix-profile
<clever> ahh
<clever> and if you nix-env -i it, what path does it try to open?
<clever> which path is it trying to open?
<clever> yep
<clever> rotaerk: strace, and other debug logs may explain that
<clever> that can work even if the profile is in the wrong place
<clever> its possible that your .nix-profile had never been right, and this is the first time you did a GC?
<clever> that can be done with just nix-env -iA nixpkgs.nixStable2 i believe
<clever> Tritlo: also, scripts exist that just auto-install and configure everything
<clever> Tritlo: try using nix-channel --remove and --add to remove that nixpkgs-18.03-darwin channel, then re-add it with just the name nixpkgs, then --update
<clever> and then inside each of those?
<clever> what do you have in ~/.nix-defexpr/ ?
<clever> that means you need to add a channel
<clever> Tritlo: the profile link is supposed to point to a numbered profile link, which then points into the store
<clever> lrwxrwxrwx 1 clever users 16 Mar 29 02:17 /nix/var/nix/profiles/per-user/clever/profile -> profile-373-link
<clever> rotaerk: i just sat down and devoured it :P
<clever> /path/to/bin/nix-env -i /nix/store/path
<clever> Tritlo: you will need to use the absolute path to nix, to install nix
<clever> Tritlo: nix.sh is supposed to be source'd by your .bashrc
<clever> Tritlo: nix-env will auto-create that when you install something
<clever> you can just add librarySystemDepends near line 41
<clever> rotaerk: librarySystemDepends
<clever> try using overrideCabal instead, and ...
<clever> that override doesnt modify .env
<clever> ah, but your using nix-shell on .env?
<clever> or not wont know those things are in-use
<clever> Tritlo: it must point to an entry under this profiles directory
<clever> lrwxrwxrwx 1 clever users 45 Oct 11 2015 .nix-profile -> /nix/var/nix/profiles/per-user/clever/profile
<clever> Tritlo: thats not what it should have been pointing to
<clever> Tritlo: what does .nix-profile point to?
<clever> rotaerk: can you gist your full default.nix file?
<clever> rotaerk: or add it to your buildInputs
<clever> rotaerk: nix-shell -p vulkan-loader
<clever> samueldr: i would expect at least nix itself to eval, so it can upgrade, but he used -i, which tries to eval everything
<clever> Tritlo: ^^^
<clever> !-A

2018-04-01

<clever> tomberek: you would need to make a custom derivation that builds only the dtb's, and then modify the area of nixos that copies them into /boot/
<clever> depends heavily on how much duplicates you have in the files
<clever> it will hash every single file in the store, and hardlink the duplicates to eachother
<clever> that will dedup things
<clever> oh, also, nix-store --optimize
<clever> nix-env -p /path/to/profile --delete-generations 42
<clever> you can also delete just a single generation
<clever> but it can only delete system generations if its ran as root
<clever> -d will delete all unused generations for profiles you can write to
<clever> freeman42x]NixOS: by default, nix-collect-garbage wont delete old profiles
<clever> freeman42x]NixOS: run nix-store --query --roots on each one, and see what refers to them all
<clever> freeman42x]NixOS: --query --roots lets you see why it cant be deleted, and --delete lets you delete just that, without having a GC randomly delete other un-rooted things
<clever> freeman42x]NixOS: mostly
<clever> freeman42x]NixOS: ncdu -x /nix/store/, then try to nix-store --delete and nix-store --query --roots any fat paths
<clever> but you can also just give it a path to a file
<clever> if you give callPackage a path to a directory, it loads the default.nix within
<clever> whatever works for you
<clever> `with pkgs;` may have priority, but you can just give it some other name
<clever> yeah
<clever> and youll want to switch to pkgs.haskellPackages
<clever> { config, pkgs, ... }: let psc-package = haskell.lib.justStaticExecutables haskellPackages.callPackage foo {}; in { ....
<clever> put the let near the top of the file, before the 2nd {
<clever> let psc-package = haskell.lib.justStaticExecutables haskellPackages.callPackage ../development/compilers/purescript/psc-package { } in ...
<clever> also, that let block is completely wrong
<clever> you have to give the right path to your copy of the file
<clever> in a let block near where you want to use it
<clever> but you can use the nix i pasted to load another version of it
<clever> it will use whatever version is specified in that version of the file for your current nixpkgs
<clever> i-am-the-slime: its already in all-packages.nix, so you can just do pkgs.psc-package
<clever> 6252 (haskellPackages.callPackage ../development/compilers/purescript/psc-package { });
<clever> 6251 psc-package = haskell.lib.justStaticExecutables
<clever> monokrome: nixops can also provision ec2 instances and fully configure them automatically
<clever> and tweaking it some, so it runs u-boot instead
<clever> manually undo the changes to /boot with another system
<clever> and either way, you can just make a .zip backup of the /boot partition to undo things
<clever> bachp: if you use u-boot correctly, you will have rollbacks working fully
<clever> bachp: you would need to create a new bootloader, that does both tasks at once
<clever> so only one can exist at once
<clever> bachp: yeah, they all set the same field to manage the bootloader
<clever> it just generates a config file, and a pre-existing bootloade runs it
<clever> generic-extlinux-compatible doesnt configure any bootloader
<clever> exactly
<clever> if you already have firmware and u-boot in /boot, it will be able to use the extlinux config file
<clever> the rpi bootloader doesnt use any bootloader, it just drops a kernel in /boot/kernel.img, which the firmware loads
<clever> but sometimes, its just the stock firmware and it doesnt even have a bootloader
<clever> bachp: primarily just u-boot and nothing else
<clever> e
<clever> u-boot has to be installed seperately, and it then reads that config fil
<clever> all it does is generate a config file
<clever> the ext-linux bootloader isnt really a bootloader
<clever> bkchr[m]: the rpi bootloader also goes over every generation, and adds them to the bootloader config
<clever> bachp: screenshot?
<clever> bachp: how does it fail to boot?
<clever> bachp: what files are in /boot now?
<clever> the bootloader i just linked does exactly that
<clever> you want this option
<clever> bachp: no, nix can only ever write to /nix/store/
<clever> packet.net has real aarch64 machines that nixos is using
<clever> bkchr[m]: https://hydra.nixos.org/machines does list aarch64 vuild slaves
<clever> bkchr[m]: it took several hours just to run the configure script for perl
<clever> bkchr[m]: you could use this, but the performance isnt very good: https://github.com/cleverca22/nixos-configs/blob/master/qemu.nix#L25
<clever> bkchr[m]: it has to be able to execute aarch64 binaries to work
<clever> dhess: :D
<clever> curl cant cache things like a browser
<clever> dhess: try with curl -i
<clever> monokrome: yeah
<clever> nix-repl> python3.meta.position
<clever> "/nix/store/vylxsj58k3w71jn3j11xd45s9b71qbkw-nixos-18.03pre130932.cc4677c36ee/nixos/pkgs/development/interpreters/python/cpython/3.6/default.nix:193"
<clever> monokrome: the package is called python3
<clever> dhess: and you may need to restart nix-daemon after editing it
<clever> dhess: make sure you edit a file in /etc/nix, rather then the store entry the symlink points to
<clever> dhess: ah, if you removed a stuck mirror like that, youll want to restart hydra-queue-runner.service
<clever> dhess: big-parallel is needed to build a kernel
<clever> dhess: did you declare any features for your build slaves?
<clever> your welcome :)
<clever> dhess: let me see...
<clever> dhess: one of the attributes in here is the issue
<clever> dhess: yeah
<clever> nix1 and nix2 also handle NIX_REMOTE very differently
<clever> it might
<clever> which may fail further down the line
<clever> and treat "" as a valid value
<clever> some programs only check if its null to see if its set or not
<clever> while the second unsets it, causing the getenv() call in c to return null
<clever> the first sets it to an empty string
<clever> puffnfresh: NIX_REMOTE= and unset NIX_REMOTE can behave very differently
<clever> so it may only be needed for things 1.11 downloaded
<clever> yorick: i suspect copy-sigs may happen on any path realized with 2.0, but i havent confirmed it
<clever> yorick: copy-sigs also helps, to copy signatures from cache.nixos.org
<clever> yorick: and you need sign-paths to sign things that where made prior to the config being set right
<clever> yorick: if this is correctly set, nix-daemon will sign everything for you, and then the signatures live in /nix/var/nix/db/db.sqlite
<clever> secret-key-files = /etc/nix/signing.sec

2018-03-31

<clever> yorick: nix-serve isnt aware of 2.0 keeping signatures in the database, so that wont help any
<clever> yorick: all i did was look at the /etc/nix/nix.conf on my main machine, which runs 2.0
<clever> krey: all build-time tools are only used in nix-shell
<clever> lostman: the option was renamed to trusted-public-keys in 2.0
<clever> Lisanna: that also works
<clever> krey: id always do that inside a nix-shell -p python
<clever> lostman: the cache must be in nix.conf or you must be root to specify custom ones
<clever> lostman: non-root users cant specify their own binary caches
<clever> krey: why are you installing python?
<clever> krey: so just move things to another point in the list
<clever> krey: if your using -p, you cant set the priority that easily, but the priority is based on the order as well
<clever> krey: just dont install the things that cause it to duplicate up
<clever> krey: then its down to the priority, i also try to avoid causing duplicates like that
<clever> krey: are all of them installed?
<clever> Lisanna: is /boot correctly mounted when you do the nixops deploy?
<clever> Lisanna: the nixos generation menu is the bootloader
<clever> Lisanna: and then the bootloader scripts in nixos deal with copying it to /boot/
<clever> Lisanna: nix builds the bzimage, it would wind up in a place like /run/current-system/kernel
<clever> Lisanna: yeah, nixops is a bit of a pain when your not dealing with uniform install conditions
<clever> yeah
<clever> Guest57550: the .iso file was already a valid usb image, it just has to be written without any changes
<clever> Guest57550: that breaks the image
<clever> Guest57550: how did you make the usb disk bootable?
<clever> LnL: which config is that in?
<clever> __monty__: and i think it already relied on nscd in nixos, to get them loaded right
<clever> __monty__: ah, outside of nixos, not sure, the nix ld.so doesnt look in places like /usr/lib so the nss modules that the host os setup wont be found so easily
<clever> bbl
<clever> __monty__: i think it also relies on nscd
<clever> monokrome: yeah
<clever> it can be a bit confusing as to which one you need
<clever> and thats also in the nixpkgs manual
<clever> monokrome: you want .overrideAttrs
<clever> monokrome: if you want those overlays to apply to nixos, yes
<clever> yep
<clever> the same way it only obeys the config in nixpkgs.config
<clever> monokrome: nixos only obeys the overlays in nixpkgs.overlays
<clever> then nixos-rebuild switch
<clever> manually mount it, and re-run nixos-generate-config
<clever> you should also have ran it after mounting /boot during the installation
<clever> andrewrk: nixos-generate-config can be re-ran at pretty much any time, as long as all the FS's are mounted
<clever> andrewrk: nixos-generate-config will update hardware-configuration.nix based on what is currently mounted
<clever> samueldr: do you have multiple efi system partitions?
<clever> andrewrk: this file
<clever> [ # Include the results of the hardware scan.
<clever> ./hardware-configuration.nix
<clever> imports =
<clever> monokrome: its in the nixpkgs manual
<clever> monokrome: the whole point of overlays is so you dont have to fork it
<clever> monokrome: no
<clever> andrewrk: ive seen that happen if you have the wrong thing (or nothing) mounted to /boot
<clever> andrewrk: no real way to know, but nixos-rebuild will remake any that matter
<clever> systemd-boot doesnt
<clever> samueldr: grub has an option to stop the problem from happening
<clever> https://nixos.org/nixos/options.html#boot.loader.grub.configurationlimit
<clever> andrewrk: youll need to GC some old system profiles with nix-collect-garbage --delete-older-than, manually delete a few kernels from /boot, and re-run nixos-rebuild switch/boot
<clever> andrewrk: grub or systemd-boot?
<clever> Lisanna: i think nix just assumes the local machine supports all features
<clever> Lisanna: ive also seen it deadlock that way, thats why i dont use localhost as a remote system
<clever> python is already packaged in nix
<clever> what exactly are you trying to build?, and how is it trying to detect zlib?
<clever> what is the error it has?
<clever> nix-shell handles dev stuff automatically
<clever> yep
<clever> nix-build ../default.nix
<clever> but you can also give nix-build and nix-shell a path
<clever> nope
<clever> in the current directory
<clever> nix-build will internally do similar things while building things for you
<clever> so no mess left behind
<clever> and once you leave that shell, they are effectively gone
<clever> yep
<clever> and any nix tools will refuse to use those libraries
<clever> its not supposed to work like that, and will only work part of the time
<clever> ah, singular
<clever> !library
<clever> try this: ls -l /lib /bin /usr /usr/bin
<clever> nixos also doesnt have /lib
<clever> monokrome: nixos doesnt have a /usr/lib/
<clever> monokrome: and also, why are you trying to compile python?
<clever> monokrome: i cant rmember the right keyword for the bot, but installing libraries wont fix compile problems, nix doesnt work like that
<clever> !librarys
<clever> !libraries

2018-03-30

<clever> and if i accept, and try to reconnect, it just fails later with ls: cannot access 'phone': Transport endpoint is not connected
<clever> zybell_: mine fails like this when the phone asks for confirmation
<clever> LIBMTP_Get_Storage() failed:-1
<clever> and in my case, the phone popped up a confirmation to allow/deny the instant i plugged it in
<clever> ThatPako: it may need root to open the usb node
<clever> well, that explains why it doesnt accept any flags, lol
<clever> joepie91_to_go_: but nix-shell also tries to download a lot of dev-time things like gcc
<clever> joepie91_to_go_: yep
<clever> zybell_: modern phones never expose a block device,so you cant just mount them
<clever> all it did was add mtpfs to $PATH
<clever> ThatPako: nix 2.0 feature, you can get the same effect by just putting it in systemPackages
<clever> yeah, that would work
<clever> ThatPako: you have to run mtpfs to mount it
<clever> ThatPako: you need to use the mtp protocol instead, which is mostly handled via fuse helpers
<clever> ThatPako: modern phones dont use usb mass-storage, so you cant just mount the filesystem
<clever> zybell_: or just `udevadm monitor`