Coder Social home page Coder Social logo

staff-d / nix-environments Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nix-community/nix-environments

0.0 1.0 0.0 99 KB

Repository to maintain out-of-tree shell.nix files (maintainer=@mic92)

License: MIT License

Ruby 0.39% Nix 97.94% Makefile 1.67%

nix-environments's Introduction

Nix-environments

Repository to maintain out-of-tree shell.nix files.

For some projects it is non-trivial to get a minimal develop environment that work with Nix/NixOS. The purpose of this repository is to share shell.nix expression that help to get started with those projects. The goal of the project is not to build or package those projects (which is often even harder) but to document the build requirements.

What environments should include:

  • dependencies to build, develop or test the project

What environments should not include:

  • opinionated, user-specific dependencies for example editors or favorite debugging tools

Current available environments

Name Attribute
Arduino arduino
cc2538-bsl cc2538-bsl
Jruby jruby
Firefox firefox
Github Pages github-pages
Homeassistant home-assistant
Nannou nannou
Phoronix test suite phoronix-test-suite
OpenWRT openwrt
SPEC benchmark spec-benchmark
Yocto yocto
Xilinx vitis xilinx-vitis

How to use

Stable Nix

All environments referenced in default.nix can be loaded by running nix-shell like that:

$ nix-shell https://github.com/nix-community/nix-environments/archive/master.tar.gz -A PROJECT_NAME

for example openwrt:

$ nix-shell https://github.com/nix-community/nix-environments/archive/master.tar.gz -A openwrt

To apply custom modification one can also import environments into their own shell.nix files and override them. Note that this approach does currently not work for buildFHSUserEnv-based environments!

{ pkgs ? import <nixpkgs> {} }:
let
  envs = (import (builtins.fetchTarball {
    url = "https://github.com/nix-community/nix-environments/archive/master.tar.gz";
  }));
  phoronix = envs.phoronix-test-suite { inherit pkgs; };
in (phoronix.overrideAttrs (old: {
  # this will append python to the existing dependencies
  buildInputs = old.buildInputs ++ [ pkgs.python3 ];
}))

Nix Flakes

Nix-environments are also available as Flake outputs. Flakes are an experimental new way to handle Nix expressions.

For dropping into the environment for the OpenWRT project, just run:

nix develop --no-write-lock-file github:nix-community/nix-environments#openwrt

The last part is a flake URL and is an abbreviation of github:nix-community/nix-environments#devShells.SYSTEM.openwrt, where SYSTEM is your current system, e.g. x86_64-linux.

You can also use these environments in your own flake and extend them:

{
  inputs.nix-environments.url = "github:nix-community/nix-environments";

  outputs = { self, nixpkgs, nix-environments }: let
    # Replace this string with your actual system, e.g. "x86_64-linux"
    system = "SYSTEM";
  in {
    devShell.${system} = let
        pkgs = import nixpkgs { inherit system; };
      in nix-environments.devShells.${system}.phoronix-test-suite.overrideAttrs (old: {
        buildInputs = old.buildInputs ++ [ pkgs.python3 ];
      });
  };
}

Similar projects

nix-environments's People

Contributors

mic92 avatar dependabot[bot] avatar jhol avatar sebtm avatar abmantis avatar peteut avatar erictapen avatar bignaux avatar fzakaria avatar anderslundstedt avatar matthewcroughan avatar mayniklas avatar heyarne avatar

Watchers

 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.