Skip to content

Commit

Permalink
flatten nixos-install tutorial slug
Browse files Browse the repository at this point in the history
use 'nixos-install-flake' as slug, to distinguish it from 'nixos-install' command'

will setup redirect in cloudflare soon.
  • Loading branch information
srid committed Jan 16, 2024
1 parent 46a958e commit 39544b9
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
slug: en/configuration-as-flake
---

# Convert `configuration.nix` to be a flake

A problem with the default NixOS `configuration.nix` generated by the official installer is that it is not "pure" and thus not reproducible (see [here](https://www.tweag.io/blog/2020-07-31-nixos-flakes/#what-problems-are-we-trying-to-solve)), as it still uses a mutable Nix channel (which is generally [discouraged](https://zero-to-nix.com/concepts/channels#the-problem-with-nix-channel)). For this reason (among others), it is recommended to immediately switch to using #[[flakes]] for our NixOS configuration. Doing this is pretty simple. Just add a `flake.nix` file in `/etc/nixos`:
Expand Down
2 changes: 1 addition & 1 deletion en/tutorial/nixos-install.md → en/nixos-install-flake.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ $ which nvim

![[configuration-as-flake]]

Let's store our whole configuration in a [[git]] repository.
Let's [[configuration-as-flake|store our whole configuration]]# in a [[git]] repository.

{#git}
## Store the configuration in Git
Expand Down
2 changes: 1 addition & 1 deletion en/nixos.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ NixOS is a Linux distribution based on the [[nix]] package manager.

## Getting Started

See our tutorial: [[nixos-install]]
See our tutorial: [[nixos-install-flake]]

```query
children:.
Expand Down
28 changes: 27 additions & 1 deletion en/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,33 @@ order: -100

- [[nix-rapid]]#
- [[nixos]] tutorial series
- [[nixos-install]]
- [[nixos-install-flake]]#
- [ ] ...
- [[nixify-haskell]]

## Scratch

- Nix series
- Ext nixpkgs using `nix *`
- `nix run`, `nix shell`, `nix profile install` (fn - hm)
- eg: run redis (or lsd with yaml)
- Rapid introduction to flakes
- evalModules
- Example 1: generate [redis.conf](https://redis.io/docs/management/config-file/) and returns drv with conf file only
- consider cluster
- Example 2: ... returns shell script that runs redis with that conf file
- add `package = pkgs.redis`; output would include writeShellApplication derivaiton
- ultimately, people can just `nix run` it.
- flake-parts
- System series
- NixOS ...
- install
- basics:
- services:
- home-manager ...
- Basics: install, packages, dotfiles, ..
- Advanced: run services (ubuntu + macos)
- try with our redis above
- show official redis module (if there's any)
- Dev series
- Haskell series
File renamed without changes

0 comments on commit 39544b9

Please sign in to comment.