From 9912e355daa699368325aa6ac7557985f4e0dc27 Mon Sep 17 00:00:00 2001 From: Katharina Fey Date: Fri, 3 Sep 2021 21:36:57 +0200 Subject: [PATCH] libkookie: update base.nix shell to allow for empty userPackages --- infra/libkookie/shells/README.md | 22 +++++++++++++++------- infra/libkookie/shells/base.nix | 2 +- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/infra/libkookie/shells/README.md b/infra/libkookie/shells/README.md index 7191c63d487..a4e1a58d45e 100644 --- a/infra/libkookie/shells/README.md +++ b/infra/libkookie/shells/README.md @@ -1,4 +1,4 @@ -# nix builders +# Development shells To make development on NixOS slightly less excruciating, libkookie ships with a set of development shells. These are environments that @@ -12,18 +12,26 @@ other `shell.nix` files. ## How to use -Create a `shell.nix` for a project that you want to include. The tool -`msh` (Make SHell) is available to generate these based on common -defaults. Afterwards both `lorri` and `nix-shell` will be able to -pick up the required environment for development. +Create a `shell.nix` for a project that you want to include (and +optionally `.envrc` for lorri). The tool `msh` (Make SHell) is +available to generate these based on common defaults. Afterwards both +`lorri` and `nix-shell` will be able to pick up the required +environment for development. ```nix -{...}: import {} +{...}: import {} ``` The above snippet includes the basic Rust development toolchain. You can also provide a set of additional packages to install ```nix -{ pkgs, ... }: import { packages = [ pkgs.hello ]; } +import { + userPackages = (pkgs: [ pkgs.hello ]); +} ``` + +You can also include `` which will get the latest +nightly compiler with a complete toolchain. This feature is +implemented via the +[oxalica/rust-overlay](https://github.com/oxalica/rust-overlay/). diff --git a/infra/libkookie/shells/base.nix b/infra/libkookie/shells/base.nix index 231d0825c45..2ec0ab99dbf 100644 --- a/infra/libkookie/shells/base.nix +++ b/infra/libkookie/shells/base.nix @@ -1,4 +1,4 @@ -name: mkBuildInputs: { userPackages }: +name: mkBuildInputs: { userPackages ? _: [] }: with import {}; stdenv.mkDerivation { inherit name;