From 9cd1e1b1e9e33f8c98b8715e03c8b95fbb2c5bc5 Mon Sep 17 00:00:00 2001 From: "Gustavo L de Mello (Guz)" Date: Fri, 4 Oct 2024 19:41:07 -0300 Subject: [PATCH] chore: add golang tools to flake.niix --- .gitignore | 1 + flake.lock | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++++- flake.nix | 17 +++++- 3 files changed, 170 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..03bd412 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.env diff --git a/flake.lock b/flake.lock index 34dde40..a8f7697 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,81 @@ { "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "templ", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gomod2nix": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "templ", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1722589758, + "narHash": "sha256-sbbA8b6Q2vB/t/r1znHawoXLysCyD4L/6n6/RykiSnA=", + "owner": "nix-community", + "repo": "gomod2nix", + "rev": "4e08ca09253ef996bd4c03afa383b23e35fe28a1", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "gomod2nix", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1726243404, @@ -16,9 +92,85 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1724322575, + "narHash": "sha256-kRYwAdYsaICNb2WYcWtBFG6caSuT0v/vTAyR8ap0IR0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2a02822b466ffb9f1c02d07c5dd6b96d08b56c6b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "templ": "templ" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "templ": { + "inputs": { + "gitignore": "gitignore", + "gomod2nix": "gomod2nix", + "nixpkgs": "nixpkgs_2", + "xc": "xc" + }, + "locked": { + "lastModified": 1725786353, + "narHash": "sha256-lU8aVTw73HX0lNGPyD8Xnvtnr2VFTXv/S6xCVn6Lg74=", + "owner": "a-h", + "repo": "templ", + "rev": "e2511cd57e5ecd28ce6e3d944c87f1e31e20b596", + "type": "github" + }, + "original": { + "owner": "a-h", + "ref": "v0.2.778", + "repo": "templ", + "type": "github" + } + }, + "xc": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": [ + "templ", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1724404748, + "narHash": "sha256-p6rXzNiDm2uBvO1MLzC5pJp/0zRNzj/snBzZI0ce62s=", + "owner": "joerdav", + "repo": "xc", + "rev": "960ff9f109d47a19122cfb015721a76e3a0f23a2", + "type": "github" + }, + "original": { + "owner": "joerdav", + "repo": "xc", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index 5be7a89..2030402 100644 --- a/flake.nix +++ b/flake.nix @@ -2,11 +2,13 @@ description = "My development environment"; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + templ.url = "github:a-h/templ?ref=v0.2.778"; }; outputs = { self, nixpkgs, - }: let + ... + } @ inputs: let systems = [ "x86_64-linux" "aarch64-linux" @@ -18,14 +20,27 @@ pkgs = import nixpkgs {inherit system;}; in f system pkgs); + templ = system: inputs.templ.packages.${system}.templ; in { devShells = forAllSystems (system: pkgs: { default = pkgs.mkShell { buildInputs = with pkgs; [ + # Javascript tools eslint nodejs_22 nodePackages_latest.prettier bun + # Go tools + go + gofumpt + golangci-lint + golines + gotools + delve + (templ system) + # Sqlite tools + sqlite + lazysql ]; }; });