|
1 | 1 | { |
2 | | - description = "Scratch compiler"; |
| 2 | + description = "goboscript is the Scratch compiler"; |
3 | 3 |
|
4 | 4 | inputs = { |
5 | 5 | nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; |
6 | 6 | flake-utils.url = "github:numtide/flake-utils"; |
| 7 | + rust-overlay.url = "github:oxalica/rust-overlay"; |
7 | 8 | }; |
8 | 9 |
|
9 | | - outputs = inputs@{ self, nixpkgs, flake-utils, ... }: |
| 10 | + outputs = inputs@{ self, nixpkgs, flake-utils, rust-overlay, ... }: |
10 | 11 | flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-darwin" ] (system: let |
11 | | - pkgs = nixpkgs.legacyPackages.${system}; |
| 12 | + overlays = [ (import rust-overlay) ]; |
| 13 | + pkgs = import nixpkgs { |
| 14 | + inherit system overlays; |
| 15 | + }; |
| 16 | + rust = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default); |
12 | 17 | in rec { |
13 | | - packages.goboscript = pkgs.callPackage ./default.nix { }; |
| 18 | + packages.goboscript = pkgs.callPackage ./default.nix { |
| 19 | + inherit (pkgs) pkg-config openssl; |
| 20 | + inherit rust; |
| 21 | + }; |
14 | 22 |
|
15 | 23 | legacyPackages = packages; |
16 | 24 |
|
17 | 25 | defaultPackage = packages.goboscript; |
18 | 26 |
|
19 | 27 | devShell = pkgs.mkShell { |
20 | | - buildInputs = with pkgs; [ cargo rustc git ]; |
| 28 | + buildInputs = with pkgs; [ git openssl pkg-config ]; |
| 29 | + packages = [ packages.goboscript ]; |
| 30 | + nativeBuildInputs = [ rust ]; |
21 | 31 | }; |
22 | 32 | }); |
23 | 33 | } |
0 commit comments