commit 5d1d966349841b18d7933843ed96a5a4fb300075 Author: Sam Date: Mon Jun 3 19:10:53 2024 +0100 added sqlfmt diff --git a/sqlfmt/flake.nix b/sqlfmt/flake.nix new file mode 100644 index 0000000..7955e6c --- /dev/null +++ b/sqlfmt/flake.nix @@ -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; + }; + }); +}