Last active
April 27, 2024 08:54
-
-
Save netlooker/2c1981872337d97fbded302d850d21b0 to your computer and use it in GitHub Desktop.
Flake for go development
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
description = "A Nix flake for Go and Templ projects with npm packages"; | |
inputs = { | |
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; | |
systems.url = "github:nix-systems/default"; | |
flake-utils.url = "github:numtide/flake-utils"; | |
}; | |
outputs = { self, nixpkgs, systems, flake-utils, ... }: | |
flake-utils.lib.eachDefaultSystem (system: | |
let | |
pkgs = import nixpkgs { | |
inherit system; | |
overlays = []; | |
}; | |
in { | |
devShells.default = pkgs.mkShell { | |
buildInputs = [ | |
pkgs.templ | |
pkgs.go | |
pkgs.golangci-lint | |
pkgs.gopls | |
pkgs.gotools | |
pkgs.go-tools | |
pkgs.tailwindcss | |
pkgs.nodejs | |
pkgs.nodePackages.node2nix | |
]; | |
shellHook = '' | |
if [ ! -d "node_modules" ]; then | |
echo "Installing npm packages..." | |
npm install daisyui | |
fi | |
''; | |
}; | |
} | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment