2021-02-01

<clever> if you just want something built, dont use develop, use build!
<clever> clone the same repo on the linux end
<clever> ssh into linux, and run the same command
<clever> so it should only be ran on a linux system
<clever> `nix develop` gives you a shell suitable for running the linux->linux compiler
<clever> siraben: why are you trying to develop with the wrong arch?
<clever> yeah, flakes tend to import <nixpkgs> repeatedly, for each arch for you, and then make a set of each arch
<clever> which <nixpkgs> is
<clever> siraben: --arg system only works if your pointing it to a function in the form of { system, ... }:
<clever> Ericson2314: how much do you know about multi-lib?
<clever> s1341: ive not done any android-native stuff, simplest answer is to just go static
<clever> thats what git is for
<clever> i need it to start on a given rev, but still allow updating the rev like normal
<clever> immae: i think i'll just keep editing flake.lock by hand, thats worked so far
<clever> immae: what if i'm converting a project from niv to flake, and nixpkgs master is broken, so i want flake.lock to start on a specific rev, and then figure it out later?
<clever> immae: is there a way to set the nixpkgs input to a given rev?
<clever> siraben: if everything else has already been downloaded, then rebuilding wont involve any query to the cache
<clever> siraben: if you add `allowSubstitutes = false;` to a given derivation, nix will not search for that one thing on the caches
<clever> and also...
<clever> `--option substituters ''` could also be used
<clever> Mic92: the relevant PR: https://github.com/NixOS/nixpkgs/pull/111321
<clever> yeah
<clever> when you -Lfoo, it wont search foo/<suffix>, i think
<clever> Mic92: my guess, is that ld and gcc search something like /usr/lib/<suffix> automatically, and all of the buildInputs and -L magic on nix is the problem
<clever> because multilib builds both hard and soft at the same time, and then picks the right one at link time
<clever> Mic92: the complex bit, is that the multi-lib enable flag, conflicts with --with-float=soft
<clever> Mic92: let me prepare a pastebin...
<clever> gcc already has some internal logic to pick the right one, and to do things right, ld needs to respect the same logic
<clever> Mic92: the complex bit, is that where the linker should search, depends on the -march and --float? options
<clever> Mic92: the gcc is already able to produce both arm and thumb code, its just a matter of pre-compiled bits (newlib and crtbegin) being pre-built in both forms
<clever> Mic92: i'm not sure how i would tell gcc to be thumb-only by default...
<clever> prior to my changes, gcc was linking an arm32 crtbegin.o and an arm32 newlib, so it failed hard on startup
<clever> Mic92: its a thumb-only soft-float cpu, and it uses the newlib(c) that the host toolchain provides
<clever> Mic92: compiling for the new RP2040 that the raspberry pi team released
<clever> Mic92: gcc itself is able to find things like the right crtbegin.o, but ld isnt dynamically changing its own search path
<clever> Mic92: so i have to manually force the right variant of newlib, and thats not very flexible...
<clever> export NIX_LDFLAGS_arm_none_eabi="-L${pkgsCross.arm-embedded.stdenv.cc.libc}/arm-none-eabi/lib/thumb/v6-m/nofp $NIX_LDFLAGS_arm_none_eabi"
<clever> but the ld wrappers in nixpkgs arent searching the right dirs for newlib
<clever> Mic92: ive patched the arm-embedded cross stuff, to create a multilib build (thumb+arm, soft+hard), and newlib automatically went multilib as well
<clever> Mic92: do you know much about gcc and multilib?
<clever> s1341: not sure, ive not used that one
<clever> s1341: pkgsCross.aarch64-android-prebuilt

2021-01-31

<clever> if most lines have 3, but 2 lines have 6, then the resulting string will have 3 spaces on those 2 lines
<clever> or more
<clever> just that every line needs the same indent
<clever> so the nix code can be multi-line, and nicely indented, but the string itself wont leak that extra indent
<clever> if all lines in the string have 4 spaces of indent, nix removes 4 spaces from every line
<clever> the only special thing, is the ''strings''
<clever> indent means nothing to the syntax, its the same as a space or newline
<clever> correct
<clever> for nearly everything else, it just needs at least 1 (or sometimes even none) whitespace (space or newline)
<clever> one is a side-effect of allowing http://example.com without quotes, the other is a function
<clever> > x: y
<clever> > x:y
<clever> only in a few places
<clever> nope, {} are always a set of key/value pairs
<clever> `with set; []` is an expression that returns a list
<clever> itai: throw some parens on it, (with pkgs; [foo]) ++ (with bar; [baz])
<clever> this is a list, where foo will try to be found in pkgs first
<clever> with pkgs; [ foo ]
<clever> thats not a valid set
<clever> a set must contain key=value; pairs
<clever> (but the value could be a set, a list, or any other type)
<clever> that expression returns a single value
<clever> itai: the `with pkgs;` must be followed by exactly one expression, and it only effects the parsing of that expr
<clever> rollback would make that much simpler
<clever> but even if you can mount it fine, knowing what you need to undo isnt easy
<clever> immae: the most common is just when the boot firmware/kernel on the sd card is broken, so you need to put the rootfs into another machine to repair it
<clever> immae: in the case of the rpi, there are many levels of bricking
<clever> immae: its usually a case of some critical app getting into a bad state, and there is no undo button in apt
<clever> immae: its mostly the rollback option allowing you to undo almost anything
<clever> bifunc2: i think the same thing, every time i see an rpi user trying to fix the machine after apt-get upgrade bricked it
<clever> ambroisie: it should all be in the manual
<clever> then filter, set->list, and map functions can further manipulate it
<clever> ambroisie: builtins.readDir returns a set listing all files and dirs in a given dir

2021-01-30

<clever> esotericnonsense: nix-env also has priority over most other sources
<clever> esotericnonsense: simple answer, never install busybox, it overrides a lot of things, generally causing problems
<clever> nly: you want something like: nix-shell -E 'with import <nixpkgs> {}; linux.overrideDerivation (drv: { nativeBuildInputs = drv.nativeBuildInputs ++ [ ncurses pkgconfig ]; })'
<clever> nly: you cant mix -A and -p, they do different things
<clever> nly: nix-build '<nixpkgs>' -A linux.src -o linux.tar.xz, if you havent changed the default in configuration.nix
<clever> pie_: ive not tried doing any proxy stuff with it
<clever> SomeoneSerge: that shell script basically just downloads a tarball of a /nix/store that already has nix installed
<clever> wnklmnn: its in the mime-type setup of the http server, which maps extensions to mime types

2021-01-29

<clever> colemickens: nix-store -r /nix/store/foo --add-root result --indirect, is how i do things
<clever> bqv: it might have been grub1, it was back around 2005, but most of those commands still work the same way, and the overall design
<clever> and there is almost no way to detect that from within linux
<clever> systemd-boot is just a giant sack of magic, you can permanently override the default boot option by just hitting the wrong key at the boot menu
<clever> so i know all of the internals of grub
<clever> back when i was getting into linux, i also read man and info pages, cover to cover
<clever> bqv: i prefer grub, its far more configurable and debuggable
<clever> i have used boot in the past, to install nixos over another distro
<clever> the whole point of `result/bin/switch-to-configuration boot`, is to make whatever is in result the default
<clever> systemd-boot is being impure by looking at profiles, and then randomly deciding "uh, no, ima do something different"
<clever> id say grub is more pure, its doing exactly what it was told to do, make whatever is in result the default
<clever> and just doesnt do as it was told :P
<clever> if the one you gave it cant be found, it silently uses the latest
<clever> for systemd-boot, it searches all generations of the system profile, and flags the one you gave it as default
<clever> for grub, it just blindly says "ok, sure" and makes whatever storepath you said, the default
<clever> but grub doesnt care, so you can just `result/bin/switch-to-configuration boot` and skip the generation entirely
<clever> `switch-to-configuration boot` with systemd, will only work if that build is in the system profile (which nixos-rebuild does, i believe)
<clever> there are also some quirks/bugs there
<clever> chreekat[m]: sandbox wont let you follow absolute links that escape /nix/store
<clever> yep
<clever> the naming style for the .nar.xz varies depending on what uploads it, but the .narinfo contains the relative path
<clever> ocharles: /nix/store/hffygyhn30m35g1142zj14bzqp6fgv11-ghc-8.10.1 would be stored as hffygyhn30m35g1142zj14bzqp6fgv11.narinfo
<clever> the .narinfo will contain the relative path of the .nar.xz
<clever> .narinfo and .nar.xz i believe
<clever> it just shoves the entire 1.5gig into a single std::string, and then goes at it
<clever> it took a while to figure out what it was even doing, lol
<clever> ive investigated it before, because hydra was pinning one thread to 100% cpu, and making ZERO syscalls
<clever> ocharles: but if you open `top`, switch to thread view (H), and then toggle `c` mode, you can see part of the storepath in the name of the thread
<clever> ocharles: i believe the compression is done before uploading, and it doesnt report progress
<clever> aforemny: so you can just `nix-build '<nixpkgs>' -A tests.cross.gcc.hello`
<clever> nix-repl> tests.cross
<clever> { gcc = { ... }; llvm = { ... }; override = { ... }; overrideDerivation = «lambda @ /home/clever/apps/nixpkgs/lib/customisation.nix:84:32»; }
<clever> [clever@amd-nixos:~/apps/nixpkgs]$ nix repl .
<clever> aforemny: that callPackage is already being done
<clever> cross = callPackage ./cross {};
<clever> [clever@amd-nixos:~/apps/nixpkgs/pkgs/test]$ cat default.nix
<clever> aforemny: also
<clever> oops, nix-build not shell
<clever> aforemny: nix-shell -E 'with import ./. {}; callPackage ./pkgs/test/cross {}'

2021-01-28

<clever> lovesegfault: only writeShellScriptBin knows for sure that its a shell script
<clever> lovesegfault: that wont work if i do `writeScriptBin "name" "#!${python}/bin/python"` though
<clever> lovesegfault: i generally do `export PATH=${lib.makeBinPath [ hello ]:$PATH` in my writeScriptBin
<clever> i was using nixops
<clever> maybe, ive not used that one directly
<clever> noonien: i have successfully used this to cross-compile a whole nixos to armv7
<clever> noonien: one sec
<clever> levels: run nix-prefetch-url on the url
<clever> lol
<clever> unix timestamp 0 cant be used, because some programs treat 0 as an error
<clever> bqv: it should be 1970, not 1980
<clever> bqv: time is an impurity, nix eliminates all traces of it from a build

2021-01-27

<clever> mpickering: basically, its using some fun magic to be able to merge the .options and .config that every module returns, and then pass the merged result back into every module
<clever> mpickering: the module system is doing some fun fixed-point stuff, where you are receiving your own return value as an argument
<clever> mpickering: yep
<clever> mpickering: misc/nixpkgs.nix will apply those overlays as it loads its neighboring nixpkgs copy
<clever> mpickering: nixpkgs.overlays
<clever> mpickering: by default, it gets nixpkgs from ../../.. (the root of a nixpkgs, that the nixos/default.nix came from)
<clever> mpickering: _module.args lets any module add args that get passed to every module
<clever> one min

2021-01-24

<clever> thats normal
<clever> superloach: systemd-boot has the same requirements about where you mount efi-system
<clever> invra85: boot.loader.efi.efiSysMountPoint = "/boot/efi"; lets you mount it to /boot/efi instead
<clever> invra85: yes
<clever> invra85: /boot by default
<clever> invra85: and you must re-run nixos-generate-config if you change what is mounted
<clever> invra85: you must mount the efi system partition to /boot before you run nixos-install
<clever> invra85: nixos-generate-config will pre-fill hardware-configuration.nix for you
<clever> invra85: the fileSystems key in (hardware-)configuration.nix
<clever> JaakkoLuttinen[m: run nixos-option on the option name
<clever> invra85: yeah
<clever> that disables the legacy path
<clever> invra85: then you must set boot.loader.grub.devices = [ "nodev" ];
<clever> invra85: if you want to boot via legacy bios on gpt, you must create a bios boot partition, 1mb, not formatted, not mounted

2021-01-23

<clever> so you need to update the channel first, then nixops deploy
<clever> by default, nixops uses whatever <nixpkgs> maps to
<clever> garionion: auto-upgrade simply runs nixos-rebuild, which builds whatever is in /etc/nixos
<clever> garionion: is /boot mounted correctly when you deploy? is auto-upgrade disabled?

2021-01-21

<clever> lol
<clever> lol
<clever> personally, i just delete it, and merge the contents into configuration.nix
<clever> so you can re-run it at any time
<clever> matthewcroughan: hardware-configuration.nix should (in general) only contain what nixos-generate-config put in there
<clever> ,channels

2021-01-20

<clever> Nevoic: pretty sure unstable has updated in the last 2 months
<clever> Nevoic: not sure, ive not done android in a while
<clever> Nevoic: you could also use something like niv, to pin your shell.nix to a specific nixpkgs rev, and it wont update on its own
<clever> Nevoic: yep
<clever> ,unstable Nevoic
<clever> Nevoic: after you add an unstable channel, you can import <unstable> instead
<clever> Nevoic: after you add an unstable channel, you can import <unstable> instead
<clever> ,unstable Nevoic
<clever> Nevoic: yeah, it wont be in the 20.09 channel, thats a snapshot from what was in nixpkgs, back in sept
<clever> Nevoic: it was added 2 months ago, perhaps your nixpkgs is older?
<clever> Nevoic: i think that error is a different one, not the android_sdk.accept_license one
<clever> Nevoic: i would expect it to just work
<clever> i would expect that to just work
<clever> development/mobile/androidenv/default.nix:, licenseAccepted ? config.android_sdk.accept_license or false
<clever> development/mobile/androidenv/compose-android-packages.nix: by setting nixpkgs config option 'android_sdk.accept_license = true;'
<clever> those would behave identically
<clever> Nevoic: how did you set config.android_sdk.accept_license ?
<clever> s/packet/package/
<clever> if you want to change something, you must apply an override to the package that made it
<clever> once a given packet is installed to /nix/store, it is permanently read-only
<clever> what do you want to modify?
<clever> Nevoic: thats what shellHook is for
<clever> Nevoic: nix-shell doesnt run the phases, so the hook never runs
<clever> DigitalKiwi: i think there was a reboot --force --force? which skips the whole shutdown process and just does the syscall

2021-01-19

<clever> hugolgst: upstream probably deleted the file
<clever> energizer: if you run it on the .drv instead, you get the full build-time closure
<clever> energizer: that will only show the runtime deps i think
<clever> a lot of #!'s for bash, point to the x86 bash
<clever> proper cross has some minor issues when building full nixos
<clever> or build machines
<clever> that relies on binfmt
<clever> but if its proper cross, it wont have as much cache coverage, but it will compile faster
<clever> if you use binfmt, then it can use the caches
<clever> noonien: this will do a proper cross-compile, it works great
<clever> > pkgsCross.aarch64-multiplatform.hello
<clever> technically
<clever> noonien: binfmt isnt cross
<clever> noonien: pi1 or newer? 32 or 64bit?
<clever> noonien: i do

2021-01-18

<clever> ,locate libaccurl.so
<clever> but if you never do that, you can just shuffle the files around and use whatever layout you want
<clever> the idea being that you can just re-run nixos-generate-config at any time to update it, like after mounting a new disk
<clever> matthewcroughan: hardware-configuration.nix is meant to be what nixos-generate-config can create on the spot, from just analyzing the hw

2021-01-16

<clever> matthewcroughan: config.txt i think? or nixpkgs.config in nixos
<clever> pbb: yeah, it wont let stdenv.mkDerivation even return the drv
<clever> remexre: and $src is read-only, you have to patch the copy in . after the unpackPhase
<clever> inquisitiv3: yes
<clever> remexre: /usr/bin/env wont exist in a build sandbox, but the patchShebangs function will replace that with absolute paths to the real binary
<clever> superherointj: but if you do <nixpkgs/foo>, it will also check that the given directory actually has a /foo sub-dir
<clever> superherointj: if you do <nixpkgs>/foo, it will use the first nixpkgs it can find in $NIX_PATH, even if /foo isnt there
<clever> superherointj: <nixpkgs/pkgs/misc/hexchat-themes> would be better, then it picks a dir that actually has that path

2021-01-12

<clever> ZaraChimera: ^
<clever> ,locate
<clever> ZaraChimera: check the man page for nix-channel, you can just give a name and url at the same time
<clever> jasom: not sure that one exists...
<clever> jasom: /etc/fonts/fonts.conf i think
<clever> yeah
<clever> so `-f '<nixpkgs>'` would probably work
<clever> by default, <nixpkgs> maps to the channel named nixos on root
<clever> correct
<clever> root's channels are available to every user
<clever> it isnt
<clever> ,stateVersion
<clever> there is no point in having nixos-20.09 on both users
<clever> `nix-channel --remove nixos ; nix-channel --update`
<clever> youll want to delete it from $user
<clever> each user has their own list of channels, and you can cause a collision if both $user and root have the same name
<clever> ZaraChimera: compare `nix-channel --list` and `sudo nix-channel --list`

2021-01-11

<clever> yeah, that should work too
<clever> bit messy, but it works
<clever> and then i extract just those values, and listToAttrs them
<clever> noonien: the value of each k/v pair, is now { name = "a"; value = { f = 1; } }
<clever> > :p builtins.listToAttrs (lib.attrValues (lib.mapAttrs' (k: v: { name = k; value = { name = k; value = { f=v; }; }; }) { a = 1; b = 2; c = 3; }))
<clever> noonien: typing...

2021-01-10

<clever> not sure, gchristensen may know more
<clever> hydra did do that at one time
<clever> and then it gets pushed to master
<clever> haskell fixes usually go into the haskell-updates branch, and then somebody runs hackage2nix to update the nix files
<clever> itai33[m]: which package?
<clever> yeah, sounds like everything is cached perfectly for mpd
<clever> itai33[m]: when you do `nix-build '<nixpkgs>' -A mpd --dry-run`, does it say its building anything, or is it all fetched?
<clever> itai33[m]: what dependencies is it downloading, to compile what?
<clever> then the path is in the cache
<clever> itai33[m]: `nix-build '<nixpkgs>' -A hello --dry-run`
<clever> itai33[m]: the --dry-run cmd will tell you
<clever> itai33[m]: or just `nix-build '<nixpkgs>' -A hello --dry-run`
<clever> itai33[m]: open `nix repl '<nixpkgs>'` and then eval `"${hello}"`
<clever> V: nixos-unstable can sometimes be newer then nixpkgs-unstable, when darwin CI fails
<clever> betawaffle: then check the consituens tab
<clever> betawaffle: click on the "hydra job for tests" link https://status.nixos.org/
<clever> V: i dont think its supported on the repl
<clever> V: if you run `nix repl repl.nix`, with this file, it will load a flake
<clever> [clever@amd-nixos:~/apps/rpi/rpi-tools]$ cat /home/clever/iohk/bitte/repl.nix
<clever> builtins.getFlake (toString ./.)
<clever> noonien: this example file also breaks nixos-rebuild by messing up <nixos-config>, in this case so you cant break a nixops system
<clever> so the env var doesnt have to update for the changes to take effect
<clever> noonien: what i typically did, was i point nixPath to a static location like /run/current-systems/nixpkgs, then i modify that symlink
<clever> ah, but that needs to be documented more then
<clever> cole-h: so its basically the latest nixos-unstable? and you have no way to reproduce the build that you had yesterday?
<clever> thats where i prefer channels, since i have control over that
<clever> will it randomly pick a new version when the TTL expires?
<clever> but which version of nixpkgs is it?
<clever> its a pretty basic package that uses stdenv
<clever> you could also just throw develop at hello?
<clever> try just `nix-build '<nixpkgs>' -A stdenv` and `ls -l result/`
<clever> and `nix-shell -p stdenv` isnt adding what you thought it was adding
<clever> so there is nothing to add to the path
<clever> its probably that stdenv has no $out/bin
<clever> ive not played with the `nix develop` and `nix shell` utils yet
<clever> cole-h: that likely gives you an env suitable for building the stdenv, not using it
<clever> cole-h: gcc, binutils, make, tar, xz, gzip, bzip
<clever> samueldr: the bash level quotes will keep it intact in the argv, and then nix will () it, so it doesnt get scrambled in a list
<clever> nix-shell -p 'hello.override (old: src = ...; )'
<clever> the C++ code you linked, also wraps each argv element in (), so you can do:
<clever> `nix-shell -p` is also valid, with no elements in the list

2021-01-09

<clever> edcragg: the channel only updates after CI has completed things
<clever> bqv: write better nix
<clever> bqv: yeah

2021-01-08

<clever> leo60228: pkgs.runCommand "nop" {} "mkdir $out"
<clever> hugolgst: nixos-generate-config auto-generates the file
<clever> mtreca: oh, and builtins.readFile cant take wildcards
<clever> (ruins performance of the nix eval/build)
<clever> this will instead depend on it at runtime, and just source it
<clever> mtreca: programs.bash.initExtra = ''source ${pkgs.emacsPackages.vterm}/emacs/site-lisp/elpa/vterm-*/etc/emacs-vterm-bash.sh'';
<clever> mtreca: that causes it to build vterm at eval time, which ruins performance

2021-01-07

<clever> eacameron: boot.binfmt.emulatedSystems