Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/svelterust/bix

Use Nix to build project and run it with Bun
https://github.com/svelterust/bix

bun flake nix

Last synced: about 1 month ago
JSON representation

Use Nix to build project and run it with Bun

Awesome Lists containing this project

README

        

# bix

For `bun` you need a `yarn.lock`, make sure to install that automatically with following in `~/.bunfig.toml`:

```toml
[install.lockfile]
print = "yarn"

```

# Use `bun`

```nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
bix = {
url = "github:knarkzel/bix";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = { bix, ... }: {
packages.x86_64-linux = bix.buildBunPackage {
src = ./.;
packages = ./package.json;
hash = "run-nix-build-for-the-hash";
};
};
}

```

# Use `node`

```nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
bix = {
url = "github:knarkzel/bix";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = { bix, ... }: {
packages.x86_64-linux = bix.buildNodePackage {
src = ./.;
packages = ./package.json;
hash = "run-nix-build-for-the-hash";
};
};
}
```

# Fix issue building vips when using sharp

```nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
bix = {
url = "github:knarkzel/bix";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = { nixpkgs, bix, ... }: let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
};
in {
packages.x86_64-linux = bix.buildNodePackage {
src = ./.;
packages = ./package.json;
hash = "run-nix-build-for-the-hash";
config = {
buildInputs = [pkgs.vips];
nativeBuildInputs = [pkgs.pkg-config pkgs.python3];
npmInstallFlags = ["--build-from-source"];
};
};
};
}
```