From d996c2a1a140b4f1bd5e32073a7c874aa8554b8f Mon Sep 17 00:00:00 2001 From: taskylizard <75871323+taskylizard@users.noreply.github.com> Date: Wed, 18 Sep 2024 11:35:07 +0000 Subject: [PATCH] chore: add flake.nix add instructions for nix --- .github/CONTRIBUTING.md | 20 ++++++++++++++++++++ .gitignore | 1 + default.nix | 7 ------- docs/.vitepress/theme/style.scss | 11 ++++++----- flake.lock | Bin 0 -> 569 bytes flake.nix | 26 ++++++++++++++++++++++++++ 6 files changed, 53 insertions(+), 12 deletions(-) delete mode 100644 default.nix create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 01fd8fea5..3e4a87449 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -96,6 +96,8 @@ ### Using the GitHub editor ### Manually setting up a development environment +#### Manually + 1. Fork the repository by clicking the "Fork" button in the top right corner. 2. Make sure you have [Node.js](https://nodejs.org/en/), [pnpm](https://pnpm.io/), [git](https://git-scm.com/), and [VSCode](https://code.visualstudio.com/) or any other editor installed. @@ -107,3 +109,21 @@ ### Manually setting up a development environment 5. Add your changes with git (`git add `) and commit (`git commit -m "commit message"`), then push them (`git push`). 6. Create a pull request by clicking the "New Pull Request" button in your forked repository, and don't forget to explain why you think the site(s) in question should be removed, unstarred, and/or changed. + +#### Nix + +You can use [nix](https://nixos.org/) to set up a development environment, we have a [flake](https://nixos.wiki/wiki/Flakes) that setups `nodejs` and `pnpm`. + +1. Fork the repository by clicking the "Fork" button in the top right corner and clone your forked repository to your local machine. + +2. Run `nix flake update` to update the flake lock file. + +3. Run `nix develop` to enter the development environment. + +4. Make changes. + +5. Exit the development environment by running `exit`. + +6. Commit your changes and push them to your forked repository. + +7. Create a pull request by clicking the "New Pull Request" button in your forked repository, and don't forget to explain why you think the site(s) in question should be removed, unstarred, and/or changed. diff --git a/.gitignore b/.gitignore index 29a87bf7a..37fa45c91 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ node_modules dist .eslintcache docs/.vitepress/.temp +result diff --git a/default.nix b/default.nix deleted file mode 100644 index f700ab88f..000000000 --- a/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ pkgs ? import {} }: - -pkgs.mkShell { - buildInputs = [ - pkgs.nodejs_20 - ]; -} diff --git a/docs/.vitepress/theme/style.scss b/docs/.vitepress/theme/style.scss index 60e1b0895..fcf538187 100644 --- a/docs/.vitepress/theme/style.scss +++ b/docs/.vitepress/theme/style.scss @@ -35,11 +35,12 @@ :root { --vp-custom-block-tip-text: theme('colors.meadow.800'); --vp-custom-block-tip-text-deep: theme('colors.meadow.900'); /** Warning */ - --vp-custom-block-warning-bg: theme('colors.merlin.100'), - --vp-custom-block-warning-border: theme('colors.merlin.800'), - --vp-custom-block-warning-text: theme('colors.merlin.800'), - --vp-custom-block-warning-text-deep: theme('colors.merlin.900'), - /** Danger */ --vp-custom-block-danger-bg: theme('colors.carnation.100'); + --vp-custom-block-warning-bg: theme('colors.merlin.100'); + --vp-custom-block-warning-border: theme('colors.merlin.800'); + --vp-custom-block-warning-text: theme('colors.merlin.800'); + --vp-custom-block-warning-text-deep: theme('colors.merlin.900'); + /** Danger */ + --vp-custom-block-danger-bg: theme('colors.carnation.100'); --vp-custom-block-danger-border: theme('colors.carnation.800'); --vp-custom-block-danger-text: theme('colors.carnation.800'); --vp-custom-block-danger-text-deep: theme('colors.carnation.900'); diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000000000000000000000000000000000000..16cb3721a8857d5e5787a5f795e3c4f5b1330d22 GIT binary patch literal 569 zcmaKpO;3X`7{~8?3eqbsvE{9pcyKeu9Xu>18oj}IfCkc%7AAAqcefOn_24dT`n>#} z|G&@4ab3hk4hr45C;b?oY-sE9H=sj}*w>I>N=#Xks_sSPtY9XCV-khbPkeG?FcT`3 z _(BT`jL!f5sVuo>8Hpfz9nPt^Ma53gJHA-CQptA^uyyMNt2CiPoY@9vRB5?>tT z$kFPAvNIA|F(-^{t4YFP%xGN@6XN3p=Oj#M6yQ9(1qgs96q6{9XaO{cZEAOHVeBng zSM?d1Eu9xQ5|WjSr;VfdBw;-YK*E`6Oux7mKwx(+jsUB f|E%`1<;B^=(x>4qwCNsQqXS6A1lJ>C=j{9dAF+=b literal 0 HcmV?d00001 diff --git a/flake.nix b/flake.nix new file mode 100644 index 000000000..82b3c2aa1 --- /dev/null +++ b/flake.nix @@ -0,0 +1,26 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + }; + outputs = {nixpkgs, ...}: let + forAllSystems = f: + nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed (system: let + pkgs = nixpkgs.legacyPackages.${system}; + in + f pkgs); + in { + packages = forAllSystems (pkgs: { + formatter = pkgs.alejandra; + }); + + devShells = forAllSystems (pkgs: { + default = pkgs.mkShell { + packages = with pkgs; [ + nodejs + pnpm + git + ]; + }; + }); + }; +}