mirror of
https://github.com/anomalyco/opencode.git
synced 2026-02-01 14:44:46 +00:00
57 lines
1.4 KiB
Nix
57 lines
1.4 KiB
Nix
{
|
|
description = "OpenCode development flake";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
};
|
|
|
|
outputs =
|
|
{ self, nixpkgs, ... }:
|
|
let
|
|
systems = [
|
|
"aarch64-linux"
|
|
"x86_64-linux"
|
|
"aarch64-darwin"
|
|
"x86_64-darwin"
|
|
];
|
|
forEachSystem = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});
|
|
rev = self.shortRev or self.dirtyShortRev or "dirty";
|
|
in
|
|
{
|
|
devShells = forEachSystem (pkgs: {
|
|
default = pkgs.mkShell {
|
|
packages = with pkgs; [
|
|
bun
|
|
nodejs_20
|
|
pkg-config
|
|
openssl
|
|
git
|
|
];
|
|
};
|
|
});
|
|
|
|
packages = forEachSystem (
|
|
pkgs:
|
|
let
|
|
node_modules = pkgs.callPackage ./nix/node_modules.nix {
|
|
inherit rev;
|
|
};
|
|
opencode = pkgs.callPackage ./nix/opencode.nix {
|
|
inherit node_modules;
|
|
};
|
|
desktop = pkgs.callPackage ./nix/desktop.nix {
|
|
inherit opencode;
|
|
};
|
|
in
|
|
{
|
|
default = opencode;
|
|
inherit opencode desktop;
|
|
# Updater derivation with fakeHash - build fails and reveals correct hash
|
|
node_modules_updater = node_modules.override {
|
|
hash = pkgs.lib.fakeHash;
|
|
};
|
|
}
|
|
);
|
|
};
|
|
}
|