From 84ff4719bebc23e4c7a86607c49c786776224ed6 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Fri, 28 Mar 2025 11:20:04 +0100 Subject: [PATCH] add devshell --- .envrc | 1 + .gitignore | 5 ++++- flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 .envrc create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index ddf4317..26d3edf 100644 --- a/.gitignore +++ b/.gitignore @@ -37,4 +37,7 @@ node_modules /target # .env -.env \ No newline at end of file +.env + +# .direnv +.direnv diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..a691adf --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1742889210, + "narHash": "sha256-hw63HnwnqU3ZQfsMclLhMvOezpM7RSB0dMAtD5/sOiw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "698214a32beb4f4c8e3942372c694f40848b360d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..fb7757c --- /dev/null +++ b/flake.nix @@ -0,0 +1,32 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + + outputs = + inputs@{ + self, + nixpkgs, + ... + }: + let + forSystems = f: nixpkgs.lib.attrsets.genAttrs nixpkgs.lib.systems.flakeExposed (system: f system); + pkgs' = system: nixpkgs.legacyPackages.${system}; + in + { + devShells = forSystems ( + system: + let + pkgs = pkgs' system; + in + { + default = pkgs.mkShell { + packages = with pkgs; [ + corepack_latest + nodejs + ]; + }; + } + ); + }; +}