diff options
author | Alan Pearce | 2023-09-12 10:55:15 +0200 |
---|---|---|
committer | Alan Pearce | 2023-09-12 10:55:15 +0200 |
commit | 7fc8048d3104cf9e129920326b30aaefaaaeb89b (patch) | |
tree | bfd093932e8f5332877d9fd2a189b27ee044e8f5 | |
parent | 51cc4389f6dc7947ee34d1b3367876941e8a8fbc (diff) | |
download | website-7fc8048d3104cf9e129920326b30aaefaaaeb89b.tar.lz website-7fc8048d3104cf9e129920326b30aaefaaaeb89b.tar.zst website-7fc8048d3104cf9e129920326b30aaefaaaeb89b.zip |
Init flake
-rw-r--r-- | .envrc | 1 | ||||
-rw-r--r-- | flake.lock | 27 | ||||
-rw-r--r-- | flake.nix | 31 |
3 files changed, 59 insertions, 0 deletions
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/flake.lock b/flake.lock new file mode 100644 index 0000000..0f56f8b --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1689261696, + "narHash": "sha256-LzfUtFs9MQRvIoQ3MfgSuipBVMXslMPH/vZ+nM40LkA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "df1eee2aa65052a18121ed4971081576b25d6b5c", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-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..04bef10 --- /dev/null +++ b/flake.nix @@ -0,0 +1,31 @@ +{ + description = "A Nix-flake-based Node.js development environment"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + + outputs = { self, nixpkgs }: + let + overlays = [ + (final: prev: rec { + nodejs = prev.nodejs-18_x; + bun = (prev.bun.override { inherit nodejs; }); + }) + ]; + supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; + forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f { + pkgs = import nixpkgs { inherit overlays system; }; + }); + in + { + devShells = forEachSupportedSystem ({ pkgs }: { + default = pkgs.mkShell { + packages = with pkgs; [ + node2nix + nodejs + ] ++ (with pkgs.nodePackages; [ + prettier + ]); + }; + }); + }; +} |