···13131414For other versions such as daily builds (beta and nightly),
1515use either `rustup` from nixpkgs (which will manage the rust installation in your home directory),
1616-or use Mozilla's [Rust nightlies overlay](#using-the-rust-nightlies-overlay).
1616+or use a community maintained [Rust overlay](#using-community-rust-overlays).
17171818## Compiling Rust applications with Cargo {#compiling-rust-applications-with-cargo}
1919···411411412412`rustPlatform` provides the following hooks to automate Cargo builds:
413413414414-* `cargoSetupHook`: configure Cargo to use depenencies vendored
414414+* `cargoSetupHook`: configure Cargo to use dependencies vendored
415415 through `fetchCargoTarball`. This hook uses the `cargoDeps`
416416 environment variable to find the vendored dependencies. If a project
417417 already vendors its dependencies, the variable `cargoVendorDir` can
···672672`defaultCrateOverrides` package in nixpkgs itself.
673673674674Starting from that file, one can add more overrides, to add features
675675-or build inputs by overriding the hello crate in a seperate file.
675675+or build inputs by overriding the hello crate in a separate file.
676676677677```nix
678678with import <nixpkgs> {};
···871871872872To see that you are using nightly.
873873874874-## Using the Rust nightlies overlay {#using-the-rust-nightlies-overlay}
874874+## Using community Rust overlays {#using-community-rust-overlays}
875875876876-Mozilla provides an overlay for nixpkgs to bring a nightly version of Rust into scope.
877877-This overlay can _also_ be used to install recent unstable or stable versions
878878-of Rust, if desired.
876876+There are two community maintained approaches to Rust toolchain management:
877877+- [oxalica's Rust overlay](https://github.com/oxalica/rust-overlay)
878878+- [fenix](https://github.com/nix-community/fenix)
879879880880-### Rust overlay installation {#rust-overlay-installation}
880880+Oxalica's overlay allows you to select a particular Rust version and components.
881881+See [their documentation](https://github.com/oxalica/rust-overlay#rust-overlay) for more
882882+detailed usage.
881883882882-You can use this overlay by either changing your local nixpkgs configuration,
883883-or by adding the overlay declaratively in a nix expression, e.g. in `configuration.nix`.
884884-For more information see [the manual on installing overlays](#sec-overlays-install).
884884+Fenix is an alternative to `rustup` and can also be used as an overlay.
885885886886-#### Imperative rust overlay installation {#imperative-rust-overlay-installation}
886886+Both Oxalica's overlay and fenix better integrate with nix and cache optimizations.
887887+Because of this and ergonomics, either of those community projects
888888+should be preferred to the Mozilla's Rust overlay (nixpkgs-mozilla).
887889888888-Clone [nixpkgs-mozilla](https://github.com/mozilla/nixpkgs-mozilla),
889889-and create a symbolic link to the file
890890-[rust-overlay.nix](https://github.com/mozilla/nixpkgs-mozilla/blob/master/rust-overlay.nix)
891891-in the `~/.config/nixpkgs/overlays` directory.
890890+### How to select a specific rustc and toolchain version {#how-to-select-a-specific-rustc-and-toolchain-version}
892891893893-```ShellSession
894894-$ git clone https://github.com/mozilla/nixpkgs-mozilla.git
895895-$ mkdir -p ~/.config/nixpkgs/overlays
896896-$ ln -s $(pwd)/nixpkgs-mozilla/rust-overlay.nix ~/.config/nixpkgs/overlays/rust-overlay.nix
892892+You can consume the oxalica overlay and use it to grab a specific Rust toolchain version.
893893+Here is an example `shell.nix` showing how to grab the current stable toolchain:
894894+```nix
895895+{ pkgs ? import <nixpkgs> {
896896+ overlays = [
897897+ (import (fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"))
898898+ ];
899899+ }
900900+}:
901901+pkgs.mkShell {
902902+ nativeBuildInputs = with pkgs; [
903903+ pkg-config
904904+ rust-bin.stable.latest.minimal
905905+ ];
906906+}
897907```
898908899899-### Declarative rust overlay installation {#declarative-rust-overlay-installation}
909909+You can try this out by:
910910+1. Saving that to `shell.nix`
911911+2. Executing `nix-shell --pure --command 'rustc --version'`
900912901901-Add the following to your `configuration.nix`, `home-configuration.nix`, `shell.nix`, or similar:
913913+As of writing, this prints out `rustc 1.56.0 (09c42c458 2021-10-18)`.
914914+915915+### How to use an overlay toolchain in a derivation {#how-to-use-an-overlay-toolchain-in-a-derivation}
902916917917+You can also use an overlay's Rust toolchain with `buildRustPackage`.
918918+The below snippet demonstrates invoking `buildRustPackage` with an oxalica overlay selected Rust toolchain:
903919```nix
904904-{ pkgs ? import <nixpkgs> {
905905- overlays = [
906906- (import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz))
907907- # Further overlays go here
908908- ];
909909- };
920920+with import <nixpkgs> {
921921+ overlays = [
922922+ (import (fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"))
923923+ ];
910924};
911911-```
912925913913-Note that this will fetch the latest overlay version when rebuilding your system.
926926+rustPlatform.buildRustPackage rec {
927927+ pname = "ripgrep";
928928+ version = "12.1.1";
929929+ nativeBuildInputs = [
930930+ rust-bin.stable.latest.minimal
931931+ ];
914932915915-### Rust overlay usage {#rust-overlay-usage}
933933+ src = fetchFromGitHub {
934934+ owner = "BurntSushi";
935935+ repo = "ripgrep";
936936+ rev = version;
937937+ sha256 = "1hqps7l5qrjh9f914r5i6kmcz6f1yb951nv4lby0cjnp5l253kps";
938938+ };
916939917917-The overlay contains attribute sets corresponding to different versions of the rust toolchain, such as:
940940+ cargoSha256 = "03wf9r2csi6jpa7v5sw5lpxkrk4wfzwmzx7k3991q3bdjzcwnnwp";
918941919919-* `latest.rustChannels.stable`
920920-* `latest.rustChannels.nightly`
921921-* a function `rustChannelOf`, called as `(rustChannelOf { date = "2018-04-11"; channel = "nightly"; })`, or...
922922-* `(nixpkgs.rustChannelOf { rustToolchain = ./rust-toolchain; })` if you have a local `rust-toolchain` file (see https://github.com/mozilla/nixpkgs-mozilla#using-in-nix-expressions for an example)
942942+ meta = with lib; {
943943+ description = "A fast line-oriented regex search tool, similar to ag and ack";
944944+ homepage = "https://github.com/BurntSushi/ripgrep";
945945+ license = licenses.unlicense;
946946+ maintainers = [ maintainers.tailhook ];
947947+ };
948948+}
949949+```
923950924924-Each of these contain packages such as `rust`, which contains your usual rust development tools with the respective toolchain chosen.
925925-For example, you might want to add `latest.rustChannels.stable.rust` to the list of packages in your configuration.
951951+Follow the below steps to try that snippet.
952952+1. create a new directory
953953+1. save the above snippet as `default.nix` in that directory
954954+1. cd into that directory and run `nix-build`
926955927927-Imperatively, the latest stable version can be installed with the following command:
956956+### Rust overlay installation {#rust-overlay-installation}
928957929929-```ShellSession
930930-$ nix-env -Ai nixpkgs.latest.rustChannels.stable.rust
931931-```
958958+You can use this overlay by either changing your local nixpkgs configuration,
959959+or by adding the overlay declaratively in a nix expression, e.g. in `configuration.nix`.
960960+For more information see [the manual on installing overlays](#sec-overlays-install).
932961933933-Or using the attribute with nix-shell:
962962+### Declarative Rust overlay installation {#declarative-rust-overlay-installation}
934963935935-```ShellSession
936936-$ nix-shell -p nixpkgs.latest.rustChannels.stable.rust
937937-```
964964+This snippet shows how to use oxalica's Rust overlay.
965965+Add the following to your `configuration.nix`, `home-configuration.nix`, `shell.nix`, or similar:
938966939939-Substitute the `nixpkgs` prefix with `nixos` on NixOS.
940940-To install the beta or nightly channel, "stable" should be substituted by
941941-"nightly" or "beta", or
942942-use the function provided by this overlay to pull a version based on a
943943-build date.
967967+```nix
968968+{ pkgs ? import <nixpkgs> {
969969+ overlays = [
970970+ (import (builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"))
971971+ # Further overlays go here
972972+ ];
973973+ };
974974+};
975975+```
944976945945-The overlay automatically updates itself as it uses the same source as
946946-[rustup](https://www.rustup.rs/).
977977+Note that this will fetch the latest overlay version when rebuilding your system.
···5858## NixOS Boot Entries {#sect-nixos-gc-boot-entries}
59596060If your `/boot` partition runs out of space, after clearing old profiles
6161-you must rebuild your system with `nixos-rebuild` to update the `/boot`
6262-partition and clear space.
6161+you must rebuild your system with `nixos-rebuild boot` or `nixos-rebuild
6262+switch` to update the `/boot` partition and clear space.
···6464 <para>
6565 If your <literal>/boot</literal> partition runs out of space,
6666 after clearing old profiles you must rebuild your system with
6767- <literal>nixos-rebuild</literal> to update the
6767+ <literal>nixos-rebuild boot</literal> or
6868+ <literal>nixos-rebuild switch</literal> to update the
6869 <literal>/boot</literal> partition and clear space.
6970 </para>
7071 </section>
···413413 <link linkend="opt-hardware.rasdaemon.enable">hardware.rasdaemon</link>.
414414 </para>
415415 </listitem>
416416+ <listitem>
417417+ <para>
418418+ <literal>code-server</literal>-module now available
419419+ </para>
420420+ </listitem>
416421 </itemizedlist>
417422 </section>
418423 <section xml:id="sec-release-21.11-incompatibilities">
···17391744 While existing accounts continue to work, users may want to
17401745 remove and re-register their account in the client to enjoy a
17411746 better user experience and benefit from this change.
17471747+ </para>
17481748+ </listitem>
17491749+ <listitem>
17501750+ <para>
17511751+ A new option
17521752+ <literal>services.prometheus.enableReload</literal> has been
17531753+ added which can be enabled to reload the prometheus service
17541754+ when its config file changes instead of restarting.
17421755 </para>
17431756 </listitem>
17441757 <listitem>
+4
nixos/doc/manual/release-notes/rl-2111.section.md
···124124125125- [rasdaemon](https://github.com/mchehab/rasdaemon), a hardware error logging daemon. Available as [hardware.rasdaemon](#opt-hardware.rasdaemon.enable).
126126127127+- `code-server`-module now available
128128+127129## Backward Incompatibilities {#sec-release-21.11-incompatibilities}
128130129131- The `services.wakeonlan` option was removed, and replaced with `networking.interfaces.<name>.wakeOnLan`.
···492494 - custom OVMF package (e.g.: `pkgs.OVMFFull` with HTTP, CSM and Secure Boot support) ([`virtualisation.libvirtd.qemu.ovmf.package`](options.html#opt-virtualisation.libvirtd.qemu.ovmf.package)).
493495494496- The `cawbird` Twitter client now uses its own API keys to count as different application than upstream builds. This is done to evade application-level rate limiting. While existing accounts continue to work, users may want to remove and re-register their account in the client to enjoy a better user experience and benefit from this change.
497497+498498+- A new option `services.prometheus.enableReload` has been added which can be enabled to reload the prometheus service when its config file changes instead of restarting.
495499496500- Dokuwiki now supports caddy! However
497501 - the nginx option has been removed, in the new configuration, please use the `dokuwiki.webserver = "nginx"` instead.
···138138# Rewrite /etc/.clean.
139139close CLEAN;
140140write_file("/etc/.clean", map { "$_\n" } @copied);
141141+142142+# Create /etc/NIXOS tag if not exists.
143143+# When /etc is not on a persistent filesystem, it will be wiped after reboot,
144144+# so we need to check and re-create it during activation.
145145+open TAG, ">>/etc/NIXOS";
146146+close TAG;
···11# Arguments that this derivation gets when it is created with `callPackage`
22{ stdenv
33, lib
44-, symlinkJoin
54, makeWrapper
55+, symlinkJoin
66, yt-dlp
77}:
88···1010mpv:
11111212let
1313- # arguments to the function (called `wrapMpv` in all-packages.nix)
1313+ # arguments to the function (exposed as `wrapMpv` in all-packages.nix)
1414 wrapper = {
1515 extraMakeWrapperArgs ? [],
1616 youtubeSupport ? true,
···11+{ lib, stdenv, fetchFromGitHub, cmake, libcxxCmakeModule ? false }:
22+33+stdenv.mkDerivation rec {
44+ pname = "cpptoml";
55+ version = "0.4.0";
66+77+ src = fetchFromGitHub {
88+ owner = "skystrife";
99+ repo = "cpptoml";
1010+ rev = "fededad7169e538ca47e11a9ee9251bc361a9a65";
1111+ sha256 = "0zlgdlk9nsskmr8xc2ajm6mn1x5wz82ssx9w88s02icz71mcihrx";
1212+ };
1313+1414+ nativeBuildInputs = [ cmake ];
1515+1616+ cmakeFlags = [
1717+ # If this package is built with clang it will attempt to
1818+ # use libcxx via the Cmake find_package interface.
1919+ # The default libcxx stdenv in llvmPackages doesn't provide
2020+ # this and so will fail.
2121+ "-DENABLE_LIBCXX=${if libcxxCmakeModule then "ON" else "OFF"}"
2222+ "-DCPPTOML_BUILD_EXAMPLES=OFF"
2323+ ];
2424+2525+ outputs = [ "out" ];
2626+2727+ meta = with lib; {
2828+ description = "C++ TOML configuration library";
2929+ homepage = "https://github.com/skystrife/cpptoml";
3030+ license = licenses.mit;
3131+ maintainers = with maintainers; [ photex ];
3232+ platforms = platforms.all;
3333+ };
3434+}
+1-1
pkgs/development/libraries/glibc/common.nix
···198198 BASH_SHELL = "/bin/sh";
199199200200 # Used by libgcc, elf-header, and others to determine ABI
201201- passthru = { inherit version; };
201201+ passthru = { inherit version; minorRelease = version; };
202202}
203203204204// (removeAttrs args [ "withLinuxHeaders" "withGd" ]) //
+38
pkgs/development/libraries/glibc/mtrace.nix
···11+{ glibc, perl }:
22+33+# Small wrapper which only exposes `mtrace(3)` from `glibc`. This can't be placed
44+# into `glibc` itself because it depends on Perl which would mean that the final
55+# `glibc` inside a stdenv bootstrap has a dependency `glibc -> perl -> bootstrap tools`,
66+# so this is now in its own package that isn't used for bootstrapping.
77+#
88+# `glibc` needs to be overridden here because it's still needed to `./configure` the source in order
99+# to have a build environment where we can call the needed make target.
1010+1111+glibc.overrideAttrs ({ meta ? {}, ... }: {
1212+ pname = "glibc-mtrace";
1313+1414+ buildPhase = ''
1515+ runHook preBuild
1616+1717+ mkdir malloc
1818+ make -C ../glibc-${glibc.minorRelease}/malloc objdir=`pwd` `pwd`/malloc/mtrace;
1919+2020+ runHook postBuild
2121+ '';
2222+2323+ installPhase = ''
2424+ mkdir -p $out/bin
2525+ mv malloc/mtrace $out/bin/
2626+ '';
2727+2828+ # Perl interpreter used for `mtrace`.
2929+ buildInputs = [ perl ];
3030+3131+ # Reset a few things declared by `pkgs.glibc`.
3232+ outputs = [ "out" ];
3333+ separateDebugInfo = false;
3434+3535+ meta = meta // {
3636+ description = "Perl script used to interpret and provide human readable output of the trace log contained in the file mtracedata, whose contents were produced by mtrace(3).";
3737+ };
3838+})
···11+{ lib
22+, buildGoPackage
33+, fetchFromGitHub
44+}:
55+66+buildGoPackage rec {
77+ pname = "go-mk";
88+ version = "0.pre+date=2015-03-24";
99+1010+ src = fetchFromGitHub {
1111+ owner = "dcjones";
1212+ repo = "mk";
1313+ rev = "73d1b31466c16d0a13a220e5fad7cd8ef6d984d1";
1414+ hash = "sha256-fk2Qd3LDMx+RapKi1M9yCuxpS0IB6xlbEWW+H6t94AI=";
1515+ };
1616+1717+ goPackagePath = "github.com/dcjones/mk";
1818+1919+ meta = with lib; {
2020+ inherit (src.meta) homepage;
2121+ description = "A reboot of Plan9's mk, written in Go";
2222+ longDescription = ''
2323+ Mk is a reboot of the Plan 9 mk command, which itself is a successor to
2424+ make. This tool is for anyone who loves make, but hates all its stupid
2525+ bullshit.
2626+ '';
2727+ license = licenses.bsd2;
2828+ maintainers = with maintainers; [ AndersonTorres ];
2929+ platforms = platforms.unix;
3030+ };
3131+}
···1313let
1414 # Get as close as possible as the `package.json` required version.
1515 # This is what drives omnisharp.
1616- rtDepsSrcsFromJson = builtins.fromJSON (builtins.readFile ./rt-deps-bin-srcs.json);
1616+ rtDepsSrcsFromJson = lib.importJSON ./rt-deps-bin-srcs.json;
17171818 rtDepsBinSrcs = builtins.mapAttrs (k: v:
1919 let
···55, fetchurl
66, ffmpeg
77, freetype
88+, icu66
99+, krb5
810, lib
911, makeWrapper
1012, stdenv
1111-, zlib
1313+, openssl
1214}:
1315stdenv.mkDerivation rec {
1416 pname = "roon-server";
1515- version = "1.8-831";
1717+ version = "1.8-846";
16181719 src =
1820 let
···2022 in
2123 fetchurl {
2224 url = "http://download.roonlabs.com/builds/RoonServer_linuxx64_${urlVersion}.tar.bz2";
2323- sha256 = "sha256-SeMSC7K6DV7rVr1w/SqMnLvipoWbypS/gJnSZmpfXZk=";
2525+ sha256 = "sha256-BoHvODaAcK5b4/syOm3vpOTpq9ETovpWKUqG+UGr2e0=";
2426 };
25272628 buildInputs = [
2729 alsa-lib
2828- alsa-utils
2929- cifs-utils
3030- ffmpeg
3130 freetype
3232- zlib
3131+ krb5
3232+ stdenv.cc.cc.lib
3333 ];
34343535 nativeBuildInputs = [ autoPatchelfHook makeWrapper ];
36363737- installPhase = ''
3838- runHook preInstall
3939- mkdir -p $out
4040- mv * $out
4141- runHook postInstall
4242- '';
3737+ propagatedBuildInputs = [ alsa-utils cifs-utils ffmpeg ];
43384444- postFixup =
3939+ installPhase =
4540 let
4646- linkFix = bin: ''
4747- sed -i '/ulimit/d' ${bin}
4848- sed -i '/ln -sf/d' ${bin}
4949- ln -sf $out/RoonMono/bin/mono-sgen $out/RoonMono/bin/${builtins.baseNameOf bin}
5050- '';
5151- wrapFix = bin: ''
5252- wrapProgram ${bin} --prefix PATH : ${lib.makeBinPath [ alsa-utils cifs-utils ffmpeg ]}
4141+ # NB: While this might seem like odd behavior, it's what Roon expects. The
4242+ # tarball distribution provides scripts that do a bunch of nonsense on top
4343+ # of what wrapBin is doing here, so consider it the lesser of two evils.
4444+ # I didn't bother checking whether the symlinks are really necessary, but
4545+ # I wouldn't put it past Roon to have custom code based on the binary
4646+ # name, so we're playing it safe.
4747+ wrapBin = binPath: ''
4848+ (
4949+ binDir="$(dirname "${binPath}")"
5050+ binName="$(basename "${binPath}")"
5151+ dotnetDir="$out/RoonDotnet"
5252+5353+ ln -sf "$dotnetDir/dotnet" "$dotnetDir/$binName"
5454+ rm "${binPath}"
5555+ makeWrapper "$dotnetDir/$binName" "${binPath}" \
5656+ --add-flags "$binDir/$binName.dll" \
5757+ --argv0 "$binName" \
5858+ --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ icu66 openssl ]}" \
5959+ --prefix PATH : "$dotnetDir" \
6060+ --run "cd $binDir" \
6161+ --set DOTNET_ROOT "$dotnetDir"
6262+ )
5363 '';
5464 in
5565 ''
5656- ${linkFix "$out/Appliance/RAATServer"}
5757- ${linkFix "$out/Appliance/RoonAppliance"}
5858- ${linkFix "$out/Server/RoonServer"}
6666+ runHook preInstall
6767+ mkdir -p $out
6868+ mv * $out
6969+7070+ rm $out/check.sh
7171+ rm $out/start.sh
7272+ rm $out/VERSION
7373+7474+ ${wrapBin "$out/Appliance/RAATServer"}
7575+ ${wrapBin "$out/Appliance/RoonAppliance"}
7676+ ${wrapBin "$out/Server/RoonServer"}
7777+7878+ mkdir -p $out/bin
7979+ makeWrapper "$out/Server/RoonServer" "$out/bin/RoonServer" --run "cd $out"
8080+8181+ # This is unused and depends on an ancient version of lttng-ust, so we
8282+ # just patch it out
8383+ patchelf --remove-needed liblttng-ust.so.0 $out/RoonDotnet/shared/Microsoft.NETCore.App/5.0.0/libcoreclrtraceptprovider.so
59846060- sed -i '/which avconv/c\ WHICH_AVCONV=1' $out/check.sh
6161- sed -i '/^check_ulimit/d' $out/check.sh
6262- ${wrapFix "$out/check.sh"}
6363- ${wrapFix "$out/start.sh"}
8585+ runHook postInstall
6486 '';
65876688 meta = with lib; {
+1-1
pkgs/servers/web-apps/hedgedoc/default.nix
···1313}:
14141515let
1616- pinData = (builtins.fromJSON (builtins.readFile ./pin.json));
1616+ pinData = lib.importJSON ./pin.json;
17171818 # we need a different version than the one already available in nixpkgs
1919 esbuild-hedgedoc = buildGoModule rec {