From c841a9fd4f8bab8b9500550a2989e4a0dfec443a Mon Sep 17 00:00:00 2001 From: Leon Liu Date: Tue, 31 Dec 2024 07:33:47 +0000 Subject: [PATCH] nix flake --- .envrc | 1 + .gitignore | 2 +- flake.lock | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 20 ++++++++++++++++++ 4 files changed, 83 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 d16c893..3f55b3a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ - +.direnv/ dist .solid .output diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..53a843f --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1735471104, + "narHash": "sha256-0q9NGQySwDQc7RhAV2ukfnu7Gxa5/ybJ2ANT8DQrQrs=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "88195a94f390381c6afcdaa933c2f6ff93959cb4", + "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 0000000..a95310d --- /dev/null +++ b/flake.nix @@ -0,0 +1,20 @@ +{ + description = "A Nix flake using nixos-unstable with a development shell"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; # Use the unstable channel + flake-utils.url = "github:numtide/flake-utils"; # Utility for handling multiple systems + }; + + outputs = { nixpkgs, flake-utils, ... }: + flake-utils.lib.eachDefaultSystem (system: let + pkgs = import nixpkgs { inherit system; }; # Import packages for the specified system + in { + devShell = pkgs.mkShell { + name = "dev-shell"; # Name of the development shell + buildInputs = [ + pkgs.bun + ]; + }; + }); +}