Skip to content

Commit 40ec4e7

Browse files
committed
add nix flake
1 parent 4ade10b commit 40ec4e7

File tree

5 files changed

+105
-1
lines changed

5 files changed

+105
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/playground
55
node_modules
66
site
7+
/result
78
# Added by goreleaser init:
89
dist/
910
.intentionally-empty-file.o

.vscode/settings.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"./Cargo.toml",
66
"./Cargo.toml"
77
],
8-
"rust-analyzer.showUnlinkedFileNotification": false
8+
"rust-analyzer.showUnlinkedFileNotification": false,
9+
"nixEnvSelector.nixFile": "${workspaceRoot}/flake.nix"
910
}

default.nix

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{ lib, rustPlatform }:
2+
3+
rustPlatform.buildRustPackage {
4+
pname = "goboscript";
5+
version = "3.0.0";
6+
7+
src = ./.;
8+
9+
cargoLock = {
10+
lockFile = ./Cargo.lock;
11+
};
12+
13+
meta = {
14+
description = "Scratch compiler";
15+
homepage = "https://github.com/aspizu/goboscript";
16+
license = lib.licenses.mit;
17+
};
18+
}

flake.lock

+61
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
description = "Scratch compiler";
3+
4+
inputs = {
5+
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
6+
flake-utils.url = "github:numtide/flake-utils";
7+
};
8+
9+
outputs = inputs@{ self, nixpkgs, flake-utils, ... }:
10+
flake-utils.lib.eachSystem [ "x86_64-linux" ] (system: let
11+
pkgs = nixpkgs.legacyPackages.${system};
12+
in rec {
13+
packages.goboscript = pkgs.callPackage ./default.nix { };
14+
15+
legacyPackages = packages;
16+
17+
defaultPackage = packages.goboscript;
18+
19+
devShell = pkgs.mkShell {
20+
buildInputs = with pkgs; [ cargo rustc git ];
21+
};
22+
});
23+
}

0 commit comments

Comments
 (0)