From 9c9d653768c4e019501333bc96ea49d36af1464a Mon Sep 17 00:00:00 2001 From: Marcin Kulik Date: Mon, 12 Feb 2024 22:17:05 +0100 Subject: [PATCH] Add dev shell flake --- .gitignore | 2 ++ flake.lock | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 28 +++++++++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.gitignore b/.gitignore index 2b87557f..d595dbbe 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ /node_modules /dist /public +/.direnv +/.envrc diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..0d631001 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1707743206, + "narHash": "sha256-AehgH64b28yKobC/DAWYZWkJBxL/vP83vkY+ag2Hhy4=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "2d627a2a704708673e56346fcb13d25344b8eaf3", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..e958d338 --- /dev/null +++ b/flake.nix @@ -0,0 +1,28 @@ +{ + description = "asciinema player"; + + inputs = { + nixpkgs.url = github:nixos/nixpkgs/nixpkgs-unstable; + flake-utils.url = github:numtide/flake-utils; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem + (system: + let pkgs = nixpkgs.legacyPackages.${system}; in + { + devShells.default = pkgs.mkShell { + nativeBuildInputs = [ + pkgs.rustup + pkgs.nodejs_18 + pkgs.python3 + ]; + + shellHook = '' + alias build='npm run build && npm run bundle' + alias serve='cd public && python -m http.server 5000' + ''; + }; + } + ); +}