From 32f71702c99f8d043ba4b07f4ca694309bbd192a Mon Sep 17 00:00:00 2001 From: jmug Date: Wed, 1 Jan 2025 16:42:33 -0800 Subject: [PATCH] Add a development shell flake Signed-off-by: jmug --- .envrc | 1 + .gitignore | 3 +++ flake.lock | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 30 +++++++++++++++++++++++++ 4 files changed, 98 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 6285544..e526553 100644 --- a/.gitignore +++ b/.gitignore @@ -89,3 +89,6 @@ tags # Persistent undo [._]*.un~ +# ---> Direnv +# Don't track direnv cache +.direnv diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..f2abf38 --- /dev/null +++ b/flake.lock @@ -0,0 +1,64 @@ +{ + "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": 1735768178, + "narHash": "sha256-0w1qs1Z/ct4nBM4sL+ldJSwXaVJNgmq8rm8pfq3uvUw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b2775252bac01d5ec8cd983ea05b233dbd73e208", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "systems": "systems" + } + }, + "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..bba384a --- /dev/null +++ b/flake.nix @@ -0,0 +1,30 @@ +{ + description = "Dev shell flake with go tools"; + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/release-24.11"; + systems.url = "github:nix-systems/default"; + flake-utils = { + url = "github:numtide/flake-utils"; + inputs.systems.follows = "systems"; + }; + }; + + outputs = + { nixpkgs, flake-utils, ... }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + devShells.default = pkgs.mkShell { + packages = with pkgs; [ + go + gotools + gopls + ]; + }; + } + ); +} +