From f5cea555cdfdd219242ed024d56c8bbafdf9f24b Mon Sep 17 00:00:00 2001 From: Niklas Koll Date: Mon, 19 Jan 2026 12:50:12 +0100 Subject: [PATCH] chore: Add flake and direnv stuff --- .envrc | 1 + .gitignore | 1 + flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 40 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 69 insertions(+) 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 8b9576a..e500d05 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ node_modules/ # Added by cargo /target +.direnv/ diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..69125b4 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1768564909, + "narHash": "sha256-Kell/SpJYVkHWMvnhqJz/8DqQg2b6PguxVWOuadbHCc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "e4bae1bd10c9c57b2cf517953ab70060a828ee6f", + "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..b8d7bcc --- /dev/null +++ b/flake.nix @@ -0,0 +1,40 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + }; + + outputs = {nixpkgs, ...}: let + systems = ["aarch64-darwin" "x86_64-linux"]; + eachSystem = function: + nixpkgs.lib.genAttrs systems (system: + function { + inherit system; + pkgs = nixpkgs.legacyPackages.${system}; + }); + in { + devShells = eachSystem ({pkgs, ...}: { + default = pkgs.mkShellNoCC { + packages = [ + # general deps + pkgs.nodejs_24 + pkgs.pnpm_10 + + # wasm/rust stuff + pkgs.rustc + pkgs.cargo + pkgs.rust-analyzer + pkgs.rustfmt + pkgs.wasm-bindgen-cli + pkgs.wasm-pack + pkgs.lld + + # frontend + pkgs.vscode-langservers-extracted + pkgs.typescript-language-server + pkgs.prettier + pkgs.tailwindcss-language-server + ]; + }; + }); + }; +}