Skip to content

Commit 87b95ae

Browse files
committed
v0.7.0
1 parent 596e4ff commit 87b95ae

File tree

3 files changed

+31
-29
lines changed

3 files changed

+31
-29
lines changed

default.nix

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{ npm2nix, runCommand, nodejs, zip, unzip, sqls }:
2+
npm2nix.v2.build {
3+
src = runCommand "src-with-sqls" { } ''
4+
mkdir $out
5+
cp -r ${./.}/* $out
6+
cp -r ${sqls}/bin $out/sqls_bin
7+
'';
8+
inherit nodejs;
9+
buildCommands = [ "npm run build" ];
10+
buildInputs = [ zip unzip ];
11+
installPhase = ''
12+
# vsce errors when modtime of zipped files are > present
13+
new_modtime="0101120000" # MMDDhhmmYY (just needs to be fixed and < present)
14+
mkdir ./tmp
15+
unzip -q ./*.vsix -d ./tmp
16+
17+
for file in $(find ./tmp/ -type f); do
18+
touch -m "$new_modtime" "$file"
19+
touch -t "$new_modtime" "$file"
20+
done
21+
22+
cd ./tmp
23+
zip -q -r $out .
24+
'';
25+
}

flake.nix

+5-28
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
let
1515
pkgs = nixpkgs.legacyPackages.${system};
1616
npm2nix = import npmlock2nix { inherit pkgs; };
17-
sqls = { arch, os }: with pkgs; (buildGoModule {
17+
buildSqls = { arch, os }: with pkgs; (buildGoModule {
1818
name = "sqls_${arch}_${os}";
1919
src = fetchFromGitHub {
2020
owner = "cmoog";
@@ -32,41 +32,18 @@
3232
(arch:
3333
# skip this invalid os/arch combination
3434
if arch == "386" && os == "darwin" then "" else
35-
"cp $(find ${sqls { inherit os arch; }} -type f) $out/bin/sqls_${arch}_${os}"
35+
"cp $(find ${buildSqls { inherit os arch; }} -type f) $out/bin/sqls_${arch}_${os}"
3636
) [ "amd64" "arm64" "386" ])) [ "linux" "darwin" "windows" ]));
37-
sqlsBins = pkgs.runCommand "multiarch-sqls" { } ''
37+
sqls = pkgs.runCommand "multiarch-sqls" { } ''
3838
mkdir -p $out/bin
3939
${sqlsInstallCommands}
4040
'';
4141
in
4242
{
4343
formatter = pkgs.nixpkgs-fmt;
4444
packages = {
45-
inherit sqlsBins;
46-
default = npm2nix.v2.build {
47-
src = pkgs.runCommand "src-with-sqls" { } ''
48-
mkdir $out
49-
cp -r ${./.}/* $out
50-
cp -r ${sqlsBins}/bin $out/sqls_bin
51-
'';
52-
nodejs = pkgs.nodejs;
53-
buildCommands = [ "npm run build" ];
54-
buildInputs = with pkgs; [ zip unzip ];
55-
installPhase = ''
56-
# vsce errors when modtime of zipped files are > present
57-
new_modtime="0101120000" # MMDDhhmmYY (just needs to be fixed and < present)
58-
mkdir ./tmp
59-
unzip -q ./*.vsix -d ./tmp
60-
61-
for file in $(find ./tmp/ -type f); do
62-
touch -m "$new_modtime" "$file"
63-
touch -t "$new_modtime" "$file"
64-
done
65-
66-
cd ./tmp
67-
zip -q -r $out .
68-
'';
69-
};
45+
inherit sqls;
46+
default = pkgs.callPackage ./. { inherit sqls npm2nix; };
7047
};
7148
devShells.default = pkgs.mkShell {
7249
packages = with pkgs; [

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"repository": {
88
"url": "https://github.com/cmoog/vscode-sql-notebook"
99
},
10-
"version": "0.6.1",
10+
"version": "0.7.0",
1111
"preview": false,
1212
"engines": {
1313
"vscode": "^1.59.0"

0 commit comments

Comments
 (0)