Nix 2.7.0 released

Hi,

I’m pleased to announce the availability of Nix 2.7.0. It will be available from NixOS - Getting Nix / NixOS.

Here are the release notes:

  • Nix will now make some helpful suggestions when you mistype something on the command line. For instance, if you type nix build nixpkgs#thunderbrd, it will suggest thunderbird.

  • A number of “default” flake output attributes have been renamed. These are:

    • defaultPackage.<system>packages.<system>.default
    • defaultApps.<system>apps.<system>.default
    • defaultTemplatetemplates.default
    • defaultBundler.<system>bundlers.<system>.default
    • overlayoverlays.default
    • devShell.<system>devShells.<system>.default

    The old flake output attributes still work, but nix flake check will warn about them.

  • Breaking API change: nix bundle now supports bundlers of the form bundler.<system>.<name>= derivation: another-derivation;. This supports additional functionality to inspect evaluation information during bundling. A new repository has various bundlers implemented.

  • nix store ping now reports the version of the remote Nix daemon.

  • nix flake {init,new} now display information about which files have been created.

  • Templates can now define a welcomeText attribute, which is printed out by nix flake {init,new} --template <template>.

The next release is scheduled for 2022-04-18.

Thank you to all the contributors!

52 Likes

Cool !

Related PRs:

4 Likes

I forgot to add to the changelog with my PR, but this release also includes support for sourcehut flake input type (for referring to sourcehut repos).

It’s a minor feature when compared to the others, but here’s hoping it might be useful for some folks!

5 Likes

Wondering why we don’t have a simple git input type, that would behave the same for all git providers.

AFAIR we have a “simple” git input schema, though that requires a full clone of the repository, while github, gitlab, and other specialised ones can download/update/etc through the API and are therefore more bandwidth efficient.

Sadly github and gitlab do currently not support “pro” (GH) or self-hosted instances :frowning:

3 Likes

We do have a git type, but it’s kinda hard to remember and can’t determine the default branch if it’s not master. Here’s how it looks like with a srht git repo: git+https://git.sr.ht/~misterio/nix-colors?ref=main. Really verbose when compared to the shorthand.

The specialized types also have the advantage of being more bandwidth efficient (downloading tarballs and resolving refs).

And about self hosted instances, gitlab and sourcehut types do support them (with the host attribute), not sure about GH though.

1 Like

Oh, thats nice, though you say “attribute”, is there also a “URL” shorthand that would allow for gitlab:example.com/group/subgroup/project?

2 Likes

The type syntax is gitlab:<owner>/<repo>(/<rev-or-ref>)?(\?<params>)?. That means host should go into params.

So, it should look like this: gitlab:gnome/baobab?host=gitlab.gnome.org

1 Like

That’s a pity, we should leverage the “uniform” in URL more, and move the host to the front…

IIRC, the URL format even allows for optional host part.

gitlab:foo/bar would be like today, gitlab://example.com/foo/bar would use the example.com host.

Also I think that the ref should always be in the query, never in the path.

3 Likes

No announcement on NixOS - Blog → Announcements ? It’s currently the only place where I can receive notifications about Nix and NixOS updates (through RSS). (I wish there was some other way to receive notifications, like a mailing list, but alas, there’s none)

1 Like

There’s an RSS feed for the Discourse Announcements category (which includes non-official announcements).

1 Like

Do bundle outputs end up in the store?

1 Like

Yes, it becomes a symlink to a location in the store when calling the CLI. The bundler produces a derivation like any other that builds in the sandbox.

1 Like

+1

These posts are great and the videos are super useful, they should also go on NixOS - Blog → Announcements

1 Like
Hosted by Flying Circus.