Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e855c18

Browse files
authored
update flake (windmill-labs#851)
* add flakes * add git to flake
1 parent 2c2b9ce commit e855c18

File tree

5 files changed

+61
-59
lines changed

5 files changed

+61
-59
lines changed

.envrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
.env.development.local
1515
.env.test.local
1616
.env.production.local
17+
.direnv
1718

1819
npm-debug.log*
1920
yarn-debug.log*

README.md

+25
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,43 @@
33
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern
44
static website generator.
55

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+
621
### Installation
722

823
```
924
$ npm i --legacy-peer-deps
1025
```
1126

27+
#### Nix
28+
```
29+
$ wm-setup
30+
```
31+
1232
### Local development
1333

1434
```
1535
$ npm start
1636
```
1737

38+
#### Nix
39+
```
40+
$ wm-dev
41+
```
42+
1843
This command starts a local development server and opens up a browser window.
1944
Most changes are reflected live without having to restart the server.
2045

flake.lock

+1-36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+33-23
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,39 @@
22
inputs = {
33
nixpkgs.url = "nixpkgs/nixos-unstable";
44
flake-utils.url = "github:numtide/flake-utils";
5-
rust-overlay.url = "github:oxalica/rust-overlay";
65
};
76

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+
});
3040
}

0 commit comments

Comments
 (0)