From 56da209a90112f6bb721c1c49f798ec4f2906f06 Mon Sep 17 00:00:00 2001 From: Niklas Gruhn Date: Mon, 15 Jul 2024 22:19:44 +0200 Subject: [PATCH] chore: replace legacy nix with flake setup --- .envrc | 1 + .gitignore | 2 ++ CONTRIBUTING.md | 2 +- flake.lock | 61 +++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 25 ++++++++++++++++++++ shell.nix | 12 ---------- 6 files changed, 90 insertions(+), 13 deletions(-) create mode 100644 .envrc create mode 100644 flake.lock create mode 100644 flake.nix delete mode 100644 shell.nix diff --git a/.envrc b/.envrc new file mode 100644 index 00000000..3550a30f --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index 740aeb0d..3ff7c80a 100644 --- a/.gitignore +++ b/.gitignore @@ -228,3 +228,5 @@ $RECYCLE.BIN/ *.lnk # End of https://www.toptal.com/developers/gitignore/api/node,linux,macos,windows,vue + +.direnv diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d8dfd41e..23ab826e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ Don't hesitate to open an issue if you have trouble. ### Setup Dev Environment Canonically this package uses Node 18 and `pnpm` as a package manager. -If you are a [Nix](https://nixos.org/) user, there is a `shell.nix` file in the project root. +If you are a [Nix](https://nixos.org/) user, there is a `flake.nix` file in the project root. Clone the repository and run diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..269804cf --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1720957393, + "narHash": "sha256-oedh2RwpjEa+TNxhg5Je9Ch6d3W1NKi7DbRO1ziHemA=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "693bc46d169f5af9c992095736e82c3488bf7dbb", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-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..a8e4cd6f --- /dev/null +++ b/flake.nix @@ -0,0 +1,25 @@ +{ + description = ""; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-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 { + buildInputs = with pkgs; [ + nodejs_18 + nodePackages.pnpm + nodePackages.typescript-language-server + vue-language-server + ]; + }; + } + ); +} diff --git a/shell.nix b/shell.nix deleted file mode 100644 index 49f4a83b..00000000 --- a/shell.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs ? import {} }: - -pkgs.mkShell { - - buildInputs = with pkgs; [ - nodejs_18 - nodePackages.pnpm - nodePackages.typescript-language-server - nodePackages.volar - ]; - -}