Skip to content

Instantly share code, notes, and snippets.

@lucperkins
Last active March 28, 2023 21:51
Show Gist options
  • Save lucperkins/3cf1d80e2f8280fcbdee8a48973b9d3e to your computer and use it in GitHub Desktop.
Save lucperkins/3cf1d80e2f8280fcbdee8a48973b9d3e to your computer and use it in GitHub Desktop.
{
mkNushellDerivation = {
nushell, # A Nushell package
name, # The name of the derivation
src, # The derivation's sources
system, # The host system
packages ? [], # Same as in stdenv
build ? "", # Same as in stdenv
}:
derivation {
inherit build name packages src system;
builder = "${nushell}/bin/nu";
args = [ ../nuenv/bootstrap.nu ];
# Attributes passed to the environment
# (prefaced with __nu_ to avoid naming collisions)
__nu_builder = ../nuenv/builder.nu;
__nu_nushell_version = nushell.version;
__nu_envFile = ./env.nu; # Helper functions
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment