added sqlfmt

This commit is contained in:
Sam 2024-06-03 19:10:53 +01:00
commit 5d1d966349
1 changed files with 34 additions and 0 deletions

34
sqlfmt/flake.nix Normal file
View File

@ -0,0 +1,34 @@
{
description = "sqlfmt packaged using poetry2nix";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, poetry2nix }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
src = pkgs.fetchFromGitHub {
owner = "tconbeer";
repo = "sqlfmt";
rev = "v0.21.3";
sha256 = "1sx8gf13pwsw63v5hfnml18fs2lnb2piigc1d4q8hmiywzmhzf85";
};
inherit (poetry2nix.lib.mkPoetry2Nix { inherit pkgs; }) mkPoetryApplication;
in
{
packages = {
sqlfmt = mkPoetryApplication {
projectDir = src;
};
default = self.packages.${system}.sqlfmt;
};
});
}