nixos.org Open in urlscan Pro
2a05:d014:275:cb01::c8  Public Scan

Submitted URL: https://s15.gafagabaghe.com/
Effective URL: https://nixos.org/
Submission: On June 09 via api from US — Scanned from DE

Form analysis 1 forms found in the DOM

GET https://search.nixos.org/packages

<form method="get" action="https://search.nixos.org/packages" class="flex flex-col items-stretch md:items-center justify-center gap-6 w-full md:w-auto">
  <div class="relative"> <svg width="1em" height="1em" viewBox="0 0 24 24" alt="Search" class="h-8 w-8 absolute text-nix-blue top-3.5 left-3 md:block" data-icon="mdi:search">
      <use xlink:href="#ai:mdi:search"></use>
    </svg> <input type="text" class="outline-nix-blue-light outline-2 focus:outline focus:border-nix-blue-light rounded-full placeholder-gray-400 text-normal text-nix-blue placeholder-grey-200 w-full py-3 text-xl pl-11 pr-4 md:w-[30rem] border-2"
      name="query" placeholder="Search for Nix packages"> </div> <button type="submit" class="bg-nix-green font-bold px-8 py-2.5 rounded-3xl md:w-auto w-full text-center text-white drop-shadow">Search</button>
</form>

Text Content

ExploreDownloadLearnCommunityBlogDonate Search
NixOS 24.05 released Announcement


DECLARATIVE BUILDS
AND DEPLOYMENTS.

Nix is a tool that takes a unique approach to package management and system
configuration. Learn how to make reproducible, declarative and reliable systems.

Download Get started

$ # Typing "nix-shell -p ..." each time can be tedious. We can do better.           $ # We can write everything down in shell.nix                                       $ cat -n shell.nix                                                                       1  {                                                                                2    pkgs ? import <nixpkgs> { }, # here we import the nixpkgs packages             3  }:                                                                               4  # mkShell is a helper function                                                   5  pkgs.mkShell {                                                                   6    name = "dev-environment"; # that requires a name                               7    buildInputs = [                                                                8      # and a list of packages                                                     9      pkgs.nodejs                                                                 10    ];                                                                            11    shellHook = ''                                                                12      # bash to run when you enter the shell                                      13      echo "Start developing..."                                                  14    '';                                                                           15  }                                                                           $ # This snippet provides a developer environment named "dev-environment"           $ # with the node command line tool available                                       $ # and which will print "Start developing..." on first start.                      $ # To enter this developer environment, run:                                       $ nix-shell                                                                                                                                                             

00:00-04:1100:11 - Ad-Hoc development environments00:41 - Declarative
development environments01:25 - Build docker image with Nix02:02 - Build minimal
docker image with Nix



REPRODUCIBLE

Nix builds packages in isolation from each other. This ensures that they are
reproducible and don’t have undeclared dependencies, so if a package works on
one machine, it will also work on another.


DECLARATIVE

Nix makes it trivial to share development and build environments for your
projects, regardless of what programming languages and tools you’re using.


RELIABLE

Nix ensures that installing or upgrading one package cannot break other
packages. It allows you to roll back to previous versions, and ensures that no
package is in an inconsistent state during an upgrade.


CHOOSE FROM THOUSANDS OF PACKAGES

The Nix Packages collection (Nixpkgs) is a set of over 100 000 packages for the
Nix package manager.


Search


EXAMPLES


TRY NEW TOOLS WITHOUT FEAR

$ # Lets see if python is present on the system                                  $ python --version                                                               python: command not found                                                        $ # Use nix-shell to create a shell environment with python                      $ nix-shell -p python3                                                           (nix-shell) $ python --version                                                   Python 3.7.7                                                                     (nix-shell) $ # YAAAY! Python is available                                       (nix-shell) $ exit                                                               $ # And this is how you create on demand environments                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          

00:00-00:29



MULTIPLE LANGUAGES, ONE TOOL

$ # Lets create an environment with multiple packages                            $ nix-shell -p python3 nodejs go rustc                                           (nix-shell) $ node --version                                                     v10.20.1                                                                         (nix-shell) $ go version                                                         go version go1.14.1 linux/amd64                                                  (nix-shell) $ rustc --version                                                    rustc 1.42.0                                                                     (nix-shell) $ # Imagine how easy                                                 (nix-shell) $ exit                                                               $ # And POOF, just like that you are back to your normal environment after       $ # playing aro                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              

00:00-00:34



DECLARATIVE DEV-ENVIRONMENTS

     2    pkgs ? import <nixpkgs> { }, # here we import the nixpkgs packages          3  }:                                                                            4  # mkShell is a helper function                                                5  pkgs.mkShell {                                                                6    name = "dev-environment"; # that requires a name                            7    buildInputs = [                                                             8      # and a list of packages                                                  9      pkgs.python3                                                             10      pkgs.python3Packages.virtualenv                                          11      pkgs.nodejs                                                              12      pkgs.yarn                                                                13    ];                                                                         14    shellHook = ''                                                             15       # bash to run when you enter the shell                                  16      echo "Start developing..."                                               17    '';                                                                        18  }                                                                        $ # Pause the video to read and understand the shell.nix                         $ # To enter the dev-environment simply run:                                     $ nix-shell                                                                      Start developing...                                                              (nix-shell) $ python --version                                                   Python 3.7.7                                                                     (nix-shell) $ vi                                                                 

00:00-01:08



MINIMAL DOCKER IMAGES

$ # We all love docker. But over time it can become tedious to write             $ # reliable docker files.                                                       $ # What if you could use the power of Nix to build Docker images?               $ cat -n docker.nix                                                                  1  {                                                                             2    pkgs ? import <nixpkgs> { system = "x86_64-linux"; }, # nixpkgs package set                                                                                  3  }:                                                                            4  # helper to build Docker image                                                5  pkgs.dockerTools.buildLayeredImage {                                          6    name = "nix-hello"; # give docker image a name                              7    tag = "latest"; # provide a tag                                             8    contents = [ pkgs.hello ]; # packages in docker image                       9  }                                                                         $ # Pause the video to read and understand the docker.nix                        $ # Now we build a Docker imag                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

00:00-01:19



DECLARATIVE CLOUD IMAGES

$ # How hard would it be to build and configure an Amazon EC2 image?             $ # Let us configure a Nginx to serve a "Welcome to nginx!" page, with a         $ # valid SSL certificate (via LetsEncrypt) and recommended security settings    $ cat -n amazon.nix                                                                   1  { pkgs, ... }:                                                                2  {                                                                             3    security.acme.acceptTerms = true;                                           4    security.acme.email = "nix@example.com";                                    5    services.nginx = {                                                          6      enable = true;                                                            7      recommendedGzipSettings = true;                                           8      recommendedOptimisation = true;                                           9      recommendedProxySettings = true;                                         10      recommendedTlsSettings = true;                                           11      virtualHosts."example.com" = {                                           12        enableACME = true;                                                     13        forceSSL = true;                                                       14        locations."/".root = "${pkgs.nginx}/html";                             15      };                                                                       16    };                                                                         17  }                                                                        $ # Pause the video to understand t                                                                                                                                                                                                                

00:00-00:53



TEST YOUR CONFIGURATIONS

$ # In this example we will look into how to test your NixOS configuration       $ # We will create a simple configuration with the `hello` package installed     $ # system wide and check that the `hello` world binary works.                   $ cat -n test.nix                                                                     1  {                                                                             2    pkgs ? import <nixpkgs> { },                                                3  }:                                                                            4  pkgs.nixosTest {                                                              5    name = "example-test";                                                      6    # virtual machine with one package installed system wide                    7    machine =                                                                   8      { pkgs, ... }:                                                            9      {                                                                        10        environment.systemPackages = [ pkgs.hello ];                           11      };                                                                       12    testScript = ''                                                            13      # run hello on machine and check for output                              14      machine.succeed('hello | grep "Hello, world!"')                          15      # test is a simple python script                                         16    '';                                                                        17  }                                                                        $ # Pause the video to understand the t                                                                                                                                                                                                            

00:00-01:07


THE PROJECT

 * Channel Status
 * Packages search
 * Options search
 * Reproducible Builds Status
 * Security

GET IN TOUCH

 * Forum
 * Matrix Chat
 * Commercial support

CONTRIBUTE

 * Contributing Guide
 * Donate

STAY UP TO DATE

 * Blog
 * Newsletter

--------------------------------------------------------------------------------

Copyright © 2024 NixOS contributors
CC-BY-SA-4.0

--------------------------------------------------------------------------------

CONNECT WITH US: