Skip to content

Commit

Permalink
update flake (#851)
Browse files Browse the repository at this point in the history
* add flakes

* add git to flake
  • Loading branch information
pyranota authored Mar 5, 2025
1 parent 2c2b9ce commit e855c18
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 59 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
Expand Up @@ -14,6 +14,7 @@
.env.development.local
.env.test.local
.env.production.local
.direnv

npm-debug.log*
yarn-debug.log*
Expand Down
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,43 @@
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern
static website generator.

### Nix

If you are using nix, you can:
```
$ nix develop
```
This will bring into scope all dependencies and helpers.

#### Direnv
Additionally if you are using [nix-direnv](https://github.com/nix-community/nix-direnv):
```
$ direnv allow
```
This will automatically enable shell when you enter the repository

### Installation

```
$ npm i --legacy-peer-deps
```

#### Nix
```
$ wm-setup
```

### Local development

```
$ npm start
```

#### Nix
```
$ wm-dev
```

This command starts a local development server and opens up a browser window.
Most changes are reflected live without having to restart the server.

Expand Down
37 changes: 1 addition & 36 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 33 additions & 23 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,39 @@
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
};

outputs = {
nixpkgs,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
};
buildInputs = with pkgs; [
# dev libxml2.dev xmlsec.dev libxslt.dev libtool
nodejs
];
in {
devShell = pkgs.mkShell {
buildInputs =
buildInputs
++ (with pkgs; [
git
]);
};
});
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in {
devShell = pkgs.mkShell {
buildInputs = with pkgs; [ nodejs git ];
shellHook = ''
echo ""
echo "1. wm-setup"
echo "2. wm-dev"
echo ""
'';

packages = [
(pkgs.writeScriptBin "wm-setup" ''
${pkgs.nodejs}/bin/npm i --legacy-peer-deps
'')
# Start dev server
(pkgs.writeScriptBin "wm-dev" ''
${pkgs.nodejs}/bin/npm start
'')
# TODO:
# (pkgs.writeScriptBin "wm-build" ''
# ${pkgs.nodejs}/bin/npm run build
# '')
# (pkgs.writeScriptBin "wm-check" "")
];
};
});
}

0 comments on commit e855c18

Please sign in to comment.