diff --git a/flake.nix b/flake.nix index 2e8ed0794..01013e219 100644 --- a/flake.nix +++ b/flake.nix @@ -29,12 +29,28 @@ buildInputs = with pkgs; [ openssl ] ++ osxDependencies; nativeBuildInputs = with pkgs; [ pkg-config openssl.dev ]; - cargoBuildFlags = [ "--package aiken" ]; - src = pkgs.lib.cleanSourceWith { src = self; }; + src = pkgs.lib.cleanSourceWith { + filter = name: type: builtins.elem (baseNameOf name) [ "target" ]; + src = ./.; + }; + + # Tests might be impure and we shouldn't need to run them. + doCheck = false; cargoLock.lockFile = ./Cargo.lock; + buildPhase = '' + cargo build --release + ''; + + installPhase = '' + find . -type f ! -executable -name "aiken" -delete + + mkdir -p $out/bin + install -Dm755 target/release/aiken $out/bin + ''; + meta = with pkgs.lib; { description = "Cardano smart contract language and toolchain"; homepage = "https://github.com/aiken-lang/aiken";