Skip to content

Provide condensed quick start #222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions src/pages/breeze.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
---
title: The Nix breeze
layout: plain
---

<Admonition info open title="The target audience for the Nix breeze" id="quick-start-audience" client:load>
We wrote this [Zero to Nix][z2n] breeze with one specific audience in mind: people who have heard about [Nix] but don't yet know much about it and aren't quite sure where to start with the learning process.
In this one-page guide, we'll [install Nix](#up) and use it to do some things that people often do with Nix, such as [running a program](#run) without needing to install it, using a [Nix development environment](#develop), [building](#build) a Nix [package]

If you're intrigued and would like to go further, check out the [quick start][start].
</Admonition>

## Get Nix running \{#up}

First, install [Nix] using the [Determinate Nix Installer][installer], an unofficial and experimental tool from [Determinate Systems][ds]:

```shell
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
```

Our installer supports [several platforms][platforms].

## Run

Nix enables you to [run] programs without a separate installation step.
This runs [ponysay], one of the many packages available in [Nixpkgs]:

```shell
echo "Hello Nix" | nix run "nixpkgs#ponysay"
```

<Admonition warning title="This could take a while" id="nix-run-loading" client:load>
The first time you run a program using `nix run` it's likely to be a slow operation.
Subsequent runs should be instantaneous.
</Admonition>

Let's try a slightly more realistic example and use [bat] to render some Markdown in our terminal:

```shell
echo '# Hello, Nix!\n\nSo happy to be here.' > hello.md
nix run "nixpkgs#bat" -- hello.md
rm hello.md # let's clean up after ourselves
```

## Develop

Running programs in a one-off way is good for experimentation, but more often you'll want to create [development environments][dev-env] for specific projects.
Run this to activate one:

```shell
nix develop "github:DeterminateSystems/zero-to-nix#example"
```

<Admonition warning title="This could take a while" id="nix-develop-loading" client:load>
The first time you activate a development environment using `nix develop` it's likely to be a slow operation.
Subsequent activations should be much speedier.
</Admonition>

This development environment provides specific versions of [curl], [jq], and [Git].
You should enter a shell with this prompt:

```shell
(nix:zero-to-nix-env) bash-5.1$
```

Run `type git` to see where Git

## Build

```shell
nix build "nixpkgs#bat"
```

## Install

```shell
nix profile install "nixpkgs#ponysay"
```

```shell
echo "Hello Nix" | ponysay
```

## Uninstall Nix \{#uninstall}

While we'd love for you to keep using Nix, you can uninstall it at any time if you need to:

```shell
/nix/nix-installer uninstall
```

<Admonition success client:load>
The ability to seamlessly uninstall Nix from your system is one of the differentiating features of the [Determinate Nix Installer][dni].
If you install Nix using the [official installer][official], by contrast, you'd need to uninstall Nix manually.
</Admonition>

[bat]: https://github.com/sharkdp/bat
[curl]: https://curl.se
[dev-env]: /concepts/dev-env
[dni]: /concepts/nix-installer
[ds]: https://determinate.systems
[git]: https://git-scm.com
[installer]: /concepts/nix-installer
[jq]: https://stedolan.github.io/jq
[nix]: /concepts/nix
[nixpkgs]: /concepts/nixpkgs
[official]: https://nixos.org/download
[package]: /concepts/packages
[platforms]: /start/install
[ponysay]: https://github.com/erkin/ponysay
[run]: /start/nix-run
[selinux]: https://www.redhat.com/en/topics/linux/what-is-selinux
[start]: /start
[steamdeck]: https://steamdeck.com
[systemd]: https://systemd.io
[z2n]: /
8 changes: 6 additions & 2 deletions src/site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@ const site: Site = {
canonical: "zero-to-nix.com",
githubUrl: "https://github.com/DeterminateSystems/zero-to-nix",
languageCode: "en",
navbarLinks: [{ text: "About", href: "/about" }],
navbarLinks: [
{ text: "Breeze", href: "/breeze" },
{ text: "About", href: "/about" },
],
heroButtons: [
{ text: "Quick start", href: "/start/install", highlight: true },
{ text: "Breeze", href: "/breeze", highlight: true },
{ text: "Quick start", href: "/start/install" },
{ text: "Concepts", href: "/concepts" },
{ text: "About", href: "/about" },
],
Expand Down