Skip to content
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

docs: Adjust flake name, fix casing in README, refactor flake slightly, enable direnv #30

Closed
wants to merge 1 commit into from
Closed
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
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; };
}