File tree 5 files changed +61
-59
lines changed
5 files changed +61
-59
lines changed Original file line number Diff line number Diff line change
1
+ use flake
Original file line number Diff line number Diff line change 14
14
.env.development.local
15
15
.env.test.local
16
16
.env.production.local
17
+ .direnv
17
18
18
19
npm-debug.log *
19
20
yarn-debug.log *
Original file line number Diff line number Diff line change 3
3
This website is built using [ Docusaurus 2] ( https://docusaurus.io/ ) , a modern
4
4
static website generator.
5
5
6
+ ### Nix
7
+
8
+ If you are using nix, you can:
9
+ ```
10
+ $ nix develop
11
+ ```
12
+ This will bring into scope all dependencies and helpers.
13
+
14
+ #### Direnv
15
+ Additionally if you are using [ nix-direnv] ( https://github.com/nix-community/nix-direnv ) :
16
+ ```
17
+ $ direnv allow
18
+ ```
19
+ This will automatically enable shell when you enter the repository
20
+
6
21
### Installation
7
22
8
23
```
9
24
$ npm i --legacy-peer-deps
10
25
```
11
26
27
+ #### Nix
28
+ ```
29
+ $ wm-setup
30
+ ```
31
+
12
32
### Local development
13
33
14
34
```
15
35
$ npm start
16
36
```
17
37
38
+ #### Nix
39
+ ```
40
+ $ wm-dev
41
+ ```
42
+
18
43
This command starts a local development server and opens up a browser window.
19
44
Most changes are reflected live without having to restart the server.
20
45
Original file line number Diff line number Diff line change 2
2
inputs = {
3
3
nixpkgs . url = "nixpkgs/nixos-unstable" ;
4
4
flake-utils . url = "github:numtide/flake-utils" ;
5
- rust-overlay . url = "github:oxalica/rust-overlay" ;
6
5
} ;
7
6
8
- outputs = {
9
- nixpkgs ,
10
- flake-utils ,
11
- ...
12
- } :
13
- flake-utils . lib . eachDefaultSystem ( system : let
14
- pkgs = import nixpkgs {
15
- inherit system ;
16
- } ;
17
- buildInputs = with pkgs ; [
18
- # dev libxml2.dev xmlsec.dev libxslt.dev libtool
19
- nodejs
20
- ] ;
21
- in {
22
- devShell = pkgs . mkShell {
23
- buildInputs =
24
- buildInputs
25
- ++ ( with pkgs ; [
26
- git
27
- ] ) ;
28
- } ;
29
- } ) ;
7
+ outputs = { self , nixpkgs , flake-utils } :
8
+ flake-utils . lib . eachDefaultSystem ( system :
9
+ let
10
+ pkgs = import nixpkgs {
11
+ inherit system ;
12
+ config . allowUnfree = true ;
13
+ } ;
14
+ in {
15
+ devShell = pkgs . mkShell {
16
+ buildInputs = with pkgs ; [ nodejs git ] ;
17
+ shellHook = ''
18
+ echo ""
19
+ echo "1. wm-setup"
20
+ echo "2. wm-dev"
21
+ echo ""
22
+ '' ;
23
+
24
+ packages = [
25
+ ( pkgs . writeScriptBin "wm-setup" ''
26
+ ${ pkgs . nodejs } /bin/npm i --legacy-peer-deps
27
+ '' )
28
+ # Start dev server
29
+ ( pkgs . writeScriptBin "wm-dev" ''
30
+ ${ pkgs . nodejs } /bin/npm start
31
+ '' )
32
+ # TODO:
33
+ # (pkgs.writeScriptBin "wm-build" ''
34
+ # ${pkgs.nodejs}/bin/npm run build
35
+ # '')
36
+ # (pkgs.writeScriptBin "wm-check" "")
37
+ ] ;
38
+ } ;
39
+ } ) ;
30
40
}
You can’t perform that action at this time.
0 commit comments