GithubHelp home page GithubHelp logo

bionode / biopkgs Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 2.0 3.72 MB

Custom Nix packages not yet available on NixOS/nixpkgs

Nix 97.35% Shell 0.94% R 0.04% Makefile 0.01% XSLT 0.17% Ruby 0.06% Perl 0.98% CSS 0.02% JavaScript 0.01% C 0.09% Java 0.01% Python 0.32%

biopkgs's Introduction

Pkgs

Nixpkgs personalized

This can be used as a Git submodule to pin nixpkgs to a particular release and add custom packages. It also allows to easily create Docker and Singularity containers.

Organization

This repo tries to be minimal and thus does not include packages definitions from NixOS/nixpkgs. Yet it follows the same folder structure so that customs packages added here can easily be copy pasted to a NixOS/nixpkgs fork to be included in the official nixpkgs release via pull requests. Custom packages added this way to the official Nix will be maintained there and removed from this repo.

New projects

Copy default.nix and shell.nix into the root of your new project and add this repo as a git submodule. Edit default.nix so that the pkgs property matches the relative location of all-packages.nix. Edit shell.nix so that the name and version are relevant to your project.

Usage

Edit shell.nix to adjust the name and version of your project to anything you want (optional).

Add dependencies

You can put any dependencies in the property buildInputs of the shell.nix file.

Change packages source

Edit nixsrc.json and change the property origin.rev (revision) to any Git commit hash of NixOS/nixpkgs that you would like to use. The version property is a meaningful human friendly string that represents the current source and is used for things like tagging Docker images. It can be anything you want, such as "17.09-beta" (a Nix release tag), "my-private-fork" or "lab-name". If you want you can also change the owner and repo to a GitHub fork of NixOS/nixpkgs. You can figure out the needed sha256 property by trying to run any command after the change and looking at the output error where it says output path ‘/nix/store/X’ has r:sha256 hash ‘Y’ when ‘Z’ was expected and replacing the sha256 property with the hash ‘Z’.

Commands

As script is provided to add easy to use commands to your shell. Just source ./nix in the root of this repository and you will be able to use the commands below:

Shell

nix shell

Goes into a shell with the dependencies specified in shell.nix.
Similar to doing: nix-shell in the repository root.

Install

nix install package-name

Installs any package from official Nix or custom defined in this repo.
Similar to doing: nix-env -f ./default.nix -iA package-name

Build

nix build package-name-or-shell

Builds any packages from official Nix or custom defined in this repo. Can also build the nix shell environment when called with shell instead of the package name. The result will be stored in /nix/store and linked locally at result.
Similar to doing: nix-build . -A package-name-or-shell

Docker

nix docker package-name-or-shell

Same as nix build but result will point to a Docker compatible tarball that will automatically be loaded into Docker as the root base system and run.
Similar to doing:

nix-build . -A dockerTar --argstr pkg package-name-or-shell
docker load < result
docker run -ti --rm -v $(pwd):/data package-name-or-shell:pkg-version_nix-version /bin/sh

Singularity

nix singularity package-name-or-shell

Similar to nix docker but instead of running the Docker image loaded from the result Docker tarball, it will export it back into another tarball that can be loaded by Singularity with:
singularity exec package-name-or-shell_pkg-version_nix-version.tar.gz
Similar to doing:

nix-build . -A dockerTar --argstr pkg package-name-or-shell
docker load < result
docker run package-name-or-shell:pkg-version_nix-version /bin/sh
docker export package-name-or-shell:pkg-version_nix-version | \
  gzip > package-name-or-shell_pkg-version_nix-version.tar.gz

Add new packages

Put a default.nix derivation for your package in the appropriate folder structure inside pkgs (have a look at how packages are organized at NixOS/nixpkgs). Then add a callPackage definition inside the property customPkgs of pkgs/top-level/all-packages.nix.

biopkgs's People

Contributors

bmpvieira avatar

Stargazers

Rik avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.