From 1d855b7a50b61650f7ddf40f604c788de1c9e914 Mon Sep 17 00:00:00 2001 From: Joris Date: Sat, 2 Apr 2022 17:40:00 +0200 Subject: Use nix flakes --- README.md | 4 ++-- flake.lock | 42 ++++++++++++++++++++++++++++++++++++++++++ flake.nix | 21 +++++++++++++++++++++ 3 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/README.md b/README.md index 9f5b91f..47c92d0 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # Getting started -Run: +Having nix installed, run: ```sh -nix-shell --run bin/watch.sh +nix develop --command bin/watch.sh ``` Then, open your browser at `http://localhost:8000`. diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..a0f22fb --- /dev/null +++ b/flake.lock @@ -0,0 +1,42 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1648297722, + "narHash": "sha256-W+qlPsiZd8F3XkzXOzAoR+mpFqzm3ekQkJNa+PIh1BQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "0f8662f1319ad6abf89b3380dd2722369fc51ade", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1648912099, + "narHash": "sha256-aZrPTPlRaOdI1bPdBuzcV1dS9BGSQrZHDZjdJjW4zb0=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "247c48bc3afe677ed31e21ab32ee0018f9e70307", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..92bf81f --- /dev/null +++ b/flake.nix @@ -0,0 +1,21 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem + (system: + let pkgs = nixpkgs.legacyPackages.${system}; + in { devShell = pkgs.mkShell { + buildInputs = with pkgs; [ + nodePackages.typescript + python3 + psmisc + esbuild + watchexec + ]; + }; } + ); +} -- cgit v1.2.3