2024-01-29 17:33:33 +00:00
|
|
|
{
|
|
|
|
description = "URL shortener written in Go";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
|
|
|
|
treefmt-nix.url = "github:numtide/treefmt-nix";
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = inputs @ {flake-parts, ...}:
|
|
|
|
flake-parts.lib.mkFlake {inherit inputs;} ({...}: {
|
|
|
|
imports = [
|
|
|
|
inputs.treefmt-nix.flakeModule
|
|
|
|
];
|
|
|
|
systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"];
|
|
|
|
|
|
|
|
perSystem = {pkgs, ...}: {
|
|
|
|
treefmt = {
|
|
|
|
projectRootFile = ".git/config";
|
|
|
|
programs = {
|
|
|
|
alejandra.enable = true;
|
|
|
|
deadnix.enable = true;
|
|
|
|
gofumpt.enable = true;
|
2024-01-29 17:45:50 +00:00
|
|
|
prettier.enable = true;
|
2024-01-29 17:33:33 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
|
|
buildInputs = with pkgs; [
|
|
|
|
# Go tools
|
|
|
|
go
|
|
|
|
gopls
|
2024-01-29 17:45:50 +00:00
|
|
|
|
|
|
|
# Database
|
|
|
|
atlas
|
|
|
|
sqlc
|
|
|
|
postgresql_16
|
|
|
|
|
|
|
|
# Lint
|
|
|
|
golangci-lint
|
|
|
|
|
|
|
|
# Tools
|
|
|
|
just
|
2024-01-29 17:33:33 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|