Skip to content

Commit

Permalink
Reformat nix
Browse files Browse the repository at this point in the history
  • Loading branch information
kubukoz committed Dec 24, 2024
1 parent d5e542f commit 4f1e82f
Showing 1 changed file with 28 additions and 33 deletions.
61 changes: 28 additions & 33 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@
};

outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
in
{
flake-utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs { inherit system; };
in {
devShells.default = pkgs.mkShell {
buildInputs = [
pkgs.yarn
Expand All @@ -23,35 +20,33 @@
pkgs.coursier
] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [ pkgs.xvfb-run ];
};
packages.tree-sitter-smithyql =
pkgs.stdenv.mkDerivation {
name = "tree-sitter-smithyql";
src = ./tree-sitter-smithyql;
buildInputs = [pkgs.tree-sitter pkgs.nodejs];
buildPhase = ''
tree-sitter generate
make
'';
installPhase = if system == "x86_64-darwin" || system == "aarch64-darwin" then ''
packages.tree-sitter-smithyql = pkgs.stdenv.mkDerivation {
name = "tree-sitter-smithyql";
src = ./tree-sitter-smithyql;
buildInputs = [ pkgs.tree-sitter pkgs.nodejs ];
buildPhase = ''
tree-sitter generate
make
'';
installPhase =
if system == "x86_64-darwin" || system == "aarch64-darwin" then ''
cp libtree-sitter-smithyql.dylib $out
'' else ''
cp libtree-sitter-smithyql.so $out
'';
};
packages.tree-sitter-smithyql-all =
pkgs.stdenv.mkDerivation {
name = "tree-sitter-smithyql-all";
src = ./tree-sitter-smithyql;
dontBuild=true;
installPhase = ''
mkdir $out
cd $out
mkdir darwin-aarch64 && cp ${self.packages.aarch64-darwin.tree-sitter-smithyql} darwin-aarch64/libtree-sitter-smithyql.dylib
mkdir darwin-x86-64 && cp ${self.packages.x86_64-darwin.tree-sitter-smithyql} darwin-x86-64/libtree-sitter-smithyql.dylib
mkdir linux-aarch64 && cp ${self.packages.aarch64-linux.tree-sitter-smithyql} linux-aarch64/libtree-sitter-smithyql.so
mkdir linux-x86-64 && cp ${self.packages.x86_64-linux.tree-sitter-smithyql} linux-x86-64/libtree-sitter-smithyql.so
'';
};
}
);
};
packages.tree-sitter-smithyql-all = pkgs.stdenv.mkDerivation {
name = "tree-sitter-smithyql-all";
src = ./tree-sitter-smithyql;
dontBuild = true;
installPhase = ''
mkdir $out
cd $out
mkdir darwin-aarch64 && cp ${self.packages.aarch64-darwin.tree-sitter-smithyql} darwin-aarch64/libtree-sitter-smithyql.dylib
mkdir darwin-x86-64 && cp ${self.packages.x86_64-darwin.tree-sitter-smithyql} darwin-x86-64/libtree-sitter-smithyql.dylib
mkdir linux-aarch64 && cp ${self.packages.aarch64-linux.tree-sitter-smithyql} linux-aarch64/libtree-sitter-smithyql.so
mkdir linux-x86-64 && cp ${self.packages.x86_64-linux.tree-sitter-smithyql} linux-x86-64/libtree-sitter-smithyql.so
'';
};
});
}

0 comments on commit 4f1e82f

Please sign in to comment.