Skip to content

Commit

Permalink
docs: Adjust flake name, fix casing in README, refactor flake slightl…
Browse files Browse the repository at this point in the history
…y, enable direnv
  • Loading branch information
sshine committed Nov 12, 2024
1 parent 8dba3f9 commit b2339ab
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 20 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
result*
.direnv/

# This is the output directory of mdbook
book
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ The Nix Package Manager

Rendered book can be found at https://book.divnix.com/

This book is heavily inspired by the [rust-lang/book](https://doc.rust-lang.org/stable/book/) and serves to provide new nix users a quick introduction to fundamental nix concepts.
This book is heavily inspired by the [rust-lang/book](https://doc.rust-lang.org/stable/book/) and serves to provide new Nix users a quick introduction to fundamental Nix concepts.

It's recommended to use this resource as a precursor to [nix-pills](https://nixos.org/guides/nix-pills/) which is much more in-depth on details, but a much longer read.

## Contributing

Use `nix develop` to have `mdbook` on your shell.
For a dev environment with `mdbook` on your shell:

Use `nix develop` or `direnv allow`

Run `mdbook serve` to launch a local webserver hosting the contents

Expand Down
34 changes: 16 additions & 18 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
description = "Nix-book";
description = "Nix-Book: The Nix Package Manager";

inputs = {
utils.url = "github:numtide/flake-utils";
Expand All @@ -8,23 +8,21 @@

outputs = { self, nixpkgs, utils }:
let
systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin"];
localOverlay = import ./nix/overlay.nix;
pkgsForSystem = system: import nixpkgs {
overlays = [
localOverlay
];
inherit system;
forSystem = system: rec {
legacyPackages = import nixpkgs {
inherit system;
overlays = [localOverlay];
};
packages = utils.lib.flattenTree {
inherit (legacyPackages) devShell nix-book;
};
defaultPackage = packages.nix-book;
apps.nix-book = utils.lib.mkApp {drv = packages.nix-book;};
hydraJobs = {inherit (legacyPackages) nix-book;};
checks = {inherit (legacyPackages) nix-book;};
};
in utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ] (system: rec {
legacyPackages = pkgsForSystem system;
packages = utils.lib.flattenTree {
inherit (legacyPackages) devShell nix-book;
};
defaultPackage = packages.nix-book;
apps.nix-book = utils.lib.mkApp { drv = packages.nix-book; };
hydraJobs = { inherit (legacyPackages) nix-book; };
checks = { inherit (legacyPackages) nix-book; };
}) // {
overlay = localOverlay;
};
in
utils.lib.eachSystem systems forSystem // { overlay = localOverlay; };
}

0 comments on commit b2339ab

Please sign in to comment.