Skip to content

Instantly share code, notes, and snippets.

@matthewbauer
Last active February 26, 2019 22:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthewbauer/04b5213e5a28b5a15a777163280d9e76 to your computer and use it in GitHub Desktop.
Save matthewbauer/04b5213e5a28b5a15a777163280d9e76 to your computer and use it in GitHub Desktop.
channel changing
let mapAttrs = f: set: builtins.listToAttrs (
map (attr: { name = attr; value = f attr set.${attr}; })
(builtins.attrNames set));
channels = {
aardvark = "13.10";
baboon = "14.04";
caterpillar = "14.12";
dingo = "15.09";
emu = "16.03";
flounder = "16.09";
gorilla = "17.03";
hummingbird = "17.09";
impala = "18.03";
jellyfish = "18.09";
koi = "19.03";
# loris = "19.09";
};
in mapAttrs (n: v:
(import (builtins.fetchTarball "https://nixos.org/channels/nixos-${v}/nixexprs.tar.xz") {}).pkgs)
channels
> $(nix-build channels.nix -A aardvark.hello)/bin/hello
hello: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
aborted
> $(nix-build channels.nix -A baboon.hello)/bin/hello
hello: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
aborted
> $(nix-build channels.nix -A caterpillar.hello)/bin/hello
hello: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
aborted
> $(nix-build channels.nix -A dingo.hello)/bin/hello
Hello, world!
> $(nix-build channels.nix -A emu.hello)/bin/hello
Hello, world!
> $(nix-build channels.nix -A flounder.hello)/bin/hello
Hello, world!
> $(nix-build channels.nix -A gorilla.hello)/bin/hello
Hello, world!
> $(nix-build channels.nix -A hummingbird.hello)/bin/hello
Hello, world!
> $(nix-build channels.nix -A impala.hello)/bin/hello
Hello, world!
> $(nix-build channels.nix -A jellyfish.hello)/bin/hello
Hello, world!
> $(nix-build channels.nix -A koi.hello)/bin/hello
Hello, world!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment