Skip to content

Commit 5d97c3b

Browse files
committed
feat: added foundry.nix.
1 parent 7a219b6 commit 5d97c3b

File tree

1 file changed

+19
-44
lines changed

1 file changed

+19
-44
lines changed

foundry.nix

+19-44
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,23 @@
1-
{
2-
description = "A flake for Foundry setup";
1+
{ pkgs, }:
32

4-
inputs = {
5-
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; // Adjust as per your requirements
6-
flake-utils.url = "github:numtide/flake-utils";
7-
};
3+
pkgs.stdenv.mkDerivation rec {
4+
pname = "foundry";
5+
version = "latest";
86

9-
outputs = { self, nixpkgs, flake-utils, ... }:
10-
flake-utils.lib.eachDefaultSystem (system:
11-
let
12-
pkgs = import nixpkgs {
13-
inherit system;
14-
config = {
15-
allowUnfree = true;
16-
};
17-
};
18-
in
19-
{
20-
packages.foundry = pkgs.stdenv.mkDerivation {
21-
pname = "foundry";
22-
version = "latest";
7+
# Note: In a real Nix build, you wouldn't be able to fetch from the internet like this.
8+
# This script is for illustrative purposes and would be run post-build or would need to be adapted.
9+
buildCommand = ''
10+
mkdir -p $out/bin
11+
echo "#!${pkgs.stdenv.shell}" > $out/bin/install-foundry
12+
echo "curl -L https://foundry.paradigm.xyz | bash" >> $out/bin/install-foundry
13+
echo "foundryup" >> $out/bin/install-foundry
14+
chmod +x $out/bin/install-foundry
15+
'';
2316

24-
# Note: In a real Nix build, you wouldn't be able to fetch from the internet like this.
25-
# This script is for illustrative purposes and would be run post-build or would need to be adapted.
26-
buildCommand = ''
27-
mkdir -p $out/bin
28-
echo "#!${pkgs.stdenv.shell}" > $out/bin/install-foundry
29-
echo "curl -L https://foundry.paradigm.xyz | bash" >> $out/bin/install-foundry
30-
echo "foundryup" >> $out/bin/install-foundry
31-
chmod +x $out/bin/install-foundry
32-
'';
33-
34-
meta = with pkgs.lib; {
35-
description = "Setup script for Foundry, a smart contract development toolchain";
36-
homepage = "https://github.com/foundry-rs/foundry";
37-
license = licenses.mit;
38-
maintainers = with maintainers; [ maintainers.example ];
39-
};
40-
};
41-
42-
apps.foundry = flake-utils.lib.mkApp {
43-
drv = self.packages.${system}.foundry;
44-
};
45-
46-
defaultPackage = self.packages.${system}.foundry;
47-
});
17+
meta = with pkgs.lib; {
18+
description = "Setup script for Foundry, a smart contract development toolchain";
19+
homepage = "https://github.com/foundry-rs/foundry";
20+
license = licenses.mit;
21+
maintainers = with maintainers; [ maintainers.example ];
22+
};
4823
}

0 commit comments

Comments
 (0)