diff --git a/Cargo.lock b/Cargo.lock index 5ff51b5..b75175d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3250,7 +3250,7 @@ checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "sql-studio" -version = "0.1.26" +version = "0.1.27" dependencies = [ "async-trait", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 8f62f60..ffe2731 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sql-studio" -version = "0.1.26" +version = "0.1.27" edition = "2021" repository = "https://github.com/frectonz/sql-studio" description = "Single binary, single command SQL Database Explorer." diff --git a/flake.nix b/flake.nix index 50a9830..2d32a63 100644 --- a/flake.nix +++ b/flake.nix @@ -16,91 +16,91 @@ }; }; }; - outputs = { self, nixpkgs, flake-utils, rust-overlay, crane }: - flake-utils.lib.eachDefaultSystem (system: - let - overlays = [ (import rust-overlay) ]; - pkgs = import nixpkgs { - inherit system overlays; - }; + outputs = { self, nixpkgs, flake-utils, rust-overlay, crane }: flake-utils.lib.eachDefaultSystem (system: + let + overlays = [ (import rust-overlay) ]; + pkgs = import nixpkgs { + inherit system overlays; + }; - rustToolchain = pkgs.rust-bin.stable.latest.default; - craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchain; + rustToolchain = pkgs.rust-bin.stable.latest.default; + craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchain; - src = pkgs.lib.cleanSourceWith { - src = ./.; - filter = path: type: - (pkgs.lib.hasSuffix "\.css" path) || - (pkgs.lib.hasSuffix "\.js" path) || - (pkgs.lib.hasSuffix "\.svg" path) || - (pkgs.lib.hasSuffix "\.sqlite3" path) || - (craneLib.filterCargoSources path type) - ; - }; - commonArgs = { - inherit src; - buildInputs = [ pkgs.git ]; - }; + src = pkgs.lib.cleanSourceWith { + src = ./.; + filter = path: type: + (pkgs.lib.hasSuffix "\.css" path) || + (pkgs.lib.hasSuffix "\.js" path) || + (pkgs.lib.hasSuffix "\.svg" path) || + (pkgs.lib.hasSuffix "\.sqlite3" path) || + (craneLib.filterCargoSources path type) + ; + }; + commonArgs = { + inherit src; + buildInputs = [ pkgs.git ]; + }; - ui = pkgs.buildNpmPackage { - pname = "ui"; - version = "0.0.0"; - src = ./ui; - npmDepsHash = "sha256-kGukH0PKF7MtIO5UH+55fddj6Tv2dNLmOC6oytEhP3c="; - installPhase = '' - cp -pr --reflink=auto -- dist "$out/" - ''; - }; + ui = pkgs.buildNpmPackage { + pname = "ui"; + version = "0.0.0"; + src = ./ui; + npmDepsHash = "sha256-kGukH0PKF7MtIO5UH+55fddj6Tv2dNLmOC6oytEhP3c="; + installPhase = '' + cp -pr --reflink=auto -- dist "$out/" + ''; + }; - cargoArtifacts = craneLib.buildDepsOnly commonArgs; - bin = craneLib.buildPackage (commonArgs // { - inherit cargoArtifacts; - preBuild = '' - cp -pr --reflink=auto -- ${ui} ui/dist - ''; - }); + cargoArtifacts = craneLib.buildDepsOnly commonArgs; + bin = craneLib.buildPackage (commonArgs // { + inherit cargoArtifacts; + preBuild = '' + cp -pr --reflink=auto -- ${ui} ui/dist + ''; + }); - docker = pkgs.dockerTools.streamLayeredImage { - name = "sql-studio"; - tag = "latest"; - created = "now"; - config.Cmd = [ - "${bin}/bin/sql-studio" - "--no-browser" - "--no-shutdown" - "--address=0.0.0.0:3030" - "sqlite" - "preview" - ]; - config.Expose = "3030"; - }; - in - { - packages = { - default = bin; - docker = docker; - }; + docker = pkgs.dockerTools.streamLayeredImage { + name = "sql-studio"; + tag = "latest"; + created = "now"; + config.Cmd = [ + "${bin}/bin/sql-studio" + "--no-browser" + "--no-shutdown" + "--address=0.0.0.0:3030" + "sqlite" + "preview" + ]; + config.Expose = "3030"; + }; + in + { + packages = { + default = bin; + docker = docker; + stable = pkgs.callPackage ./package.nix { }; + }; - devShells.default = pkgs.mkShell { - buildInputs = [ - pkgs.bacon - pkgs.emmet-ls - pkgs.cargo-dist - pkgs.cargo-watch - pkgs.rust-analyzer - rustToolchain + devShells.default = pkgs.mkShell { + buildInputs = [ + pkgs.bacon + pkgs.emmet-ls + pkgs.cargo-dist + pkgs.cargo-watch + pkgs.rust-analyzer + rustToolchain - pkgs.nodejs - pkgs.nodePackages.typescript-language-server - pkgs.nodePackages.vscode-langservers-extracted - pkgs.nodePackages."@tailwindcss/language-server" + pkgs.nodejs + pkgs.nodePackages.typescript-language-server + pkgs.nodePackages.vscode-langservers-extracted + pkgs.nodePackages."@tailwindcss/language-server" - pkgs.httpie - pkgs.sqlite - ]; - }; + pkgs.httpie + pkgs.sqlite + ]; + }; - formatter = pkgs.nixpkgs-fmt; - } - ); + formatter = pkgs.nixpkgs-fmt; + } + ); }