File tree 1 file changed +43
-4
lines changed
1 file changed +43
-4
lines changed Original file line number Diff line number Diff line change
1
+ # To use get a shell ready to build the website run `nix develop`.
2
+ #
3
+ # To set up automatic rendering of the HTML in the development shell, run:
4
+ #
5
+ # python3 pre.py
6
+ # mdbook watch
7
+ #
8
+ # If you also want to serve the HTML from a local webserver, run
9
+ #
10
+ # python3 pre.py
11
+ # mdbook serve
12
+ #
13
+ # To build the book:
14
+ #
15
+ # nix build .\#default
16
+ #
17
+ # The build artifacts are available through the symlink `result` in the current
18
+ # working directory directory.
19
+ #
20
+ # Note: flakes and the `nix` command are experimental and must be enabled
21
+ # explicitly [1][2]. Also see the NixOS Wiki entry on flakes [3].
22
+ #
23
+ # [1] https://nix.dev/manual/nix/2.17/contributing/experimental-features#xp-feature-nix-command
24
+ # [2] https://nix.dev/manual/nix/2.17/contributing/experimental-features#xp-feature-flakes
25
+ # [3] https://nixos.wiki/wiki/Flakes
1
26
2
27
{
3
28
description = "Shell for building rust-for-linux.com" ;
14
39
system :
15
40
let
16
41
pkgs = nixpkgs . legacyPackages . ${ system } ;
17
- in
18
- {
19
- devShells . default = pkgs . mkShell { packages = with pkgs ; [
42
+ buildDeps = with pkgs ; [
20
43
python3
21
44
mdbook
22
- ] ; } ;
45
+ ] ;
46
+ in
47
+ {
48
+ devShells . default = pkgs . mkShell { packages = buildDeps ; } ;
49
+ packages . default = pkgs . stdenv . mkDerivation {
50
+ name = "rust-for-linux.com" ;
51
+ nativeBuildInputs = buildDeps ;
52
+ src = ./. ;
53
+ buildPhase = ''
54
+ python3 pre.py
55
+ mdbook build
56
+ python3 post.py
57
+ '' ;
58
+ installPhase = ''
59
+ cp -r book $out
60
+ '' ;
61
+ } ;
23
62
}
24
63
) ;
25
64
}
You can’t perform that action at this time.
0 commit comments