diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml deleted file mode 100644 index 0efa4ff..0000000 --- a/.github/workflows/nix.yml +++ /dev/null @@ -1,34 +0,0 @@ -on: - push: - pull_request: - merge_group: - schedule: - - cron: '0 18 * * *' - -name: Nix -permissions: - contents: read - -jobs: - flake: - name: Nix Flake - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: Install Nix - uses: DeterminateSystems/nix-installer-action@main - - - name: Setup Nix Caching - uses: DeterminateSystems/flakehub-cache-action@main - - - name: Check Flake & Outputs - run: nix flake check --all-systems - - - name: Build default package - run: nix build .# - - - name: Build debug package - run: nix build .#rustls-platform-verifier-dbg diff --git a/flake.lock b/flake.lock deleted file mode 100644 index 29ce0d5..0000000 --- a/flake.lock +++ /dev/null @@ -1,93 +0,0 @@ -{ - "nodes": { - "flake-parts": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib" - }, - "locked": { - "lastModified": 1719994518, - "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1722087241, - "narHash": "sha256-2ShmEaFi0kJVOEEu5gmlykN5dwjWYWYUJmlRTvZQRpU=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "8c50662509100d53229d4be607f1a3a31157fa12", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-24.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-lib": { - "locked": { - "lastModified": 1719876945, - "narHash": "sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI=", - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1718428119, - "narHash": "sha256-WdWDpNaq6u1IPtxtYHHWpl5BmabtpmLnMAx0RdJ/vo8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs", - "rust-overlay": "rust-overlay" - } - }, - "rust-overlay": { - "inputs": { - "nixpkgs": "nixpkgs_2" - }, - "locked": { - "lastModified": 1722219664, - "narHash": "sha256-xMOJ+HW4yj6e69PvieohUJ3dBSdgCfvI0nnCEe6/yVc=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "a6fbda5d9a14fb5f7c69b8489d24afeb349c7bb4", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/flake.nix b/flake.nix deleted file mode 100644 index 350d19f..0000000 --- a/flake.nix +++ /dev/null @@ -1,130 +0,0 @@ -{ - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; - flake-parts.url = "github:hercules-ci/flake-parts"; - rust-overlay.url = "github:oxalica/rust-overlay"; - }; - - outputs = inputs: - inputs.flake-parts.lib.mkFlake { inherit inputs; } { - # TODO(XXX): in theory this flake could support aarch64-linux, - # x86_64-darwin and aarch64-darwin, but it is untested. - systems = [ "x86_64-linux" ]; - perSystem = { config, self', pkgs, lib, system, ... }: - let - buildToolsVersion = "30.0.3"; - platformVersion = "33"; - rustTargets = [ "${system}-android" ]; - abi = (lib.systems.elaborate system).linuxArch; - - devDeps = with pkgs; [ - android-sdk - android-studio - maven - jdk11 # Matched to CI setup-java task's java-version - der-ascii - ]; - - android-comp = pkgs.androidenv.composeAndroidPackages { - buildToolsVersions = [ buildToolsVersion ]; - platformVersions = [ platformVersion ]; - abiVersions = [ abi ]; - - # Note: Pinned presently to NDK 23 specifically to workaround an issue - # with the bundled clang missing libc++ in NDK 24. We can't use NDK - # 22, as it's too old for cargo-ndk. - ndkVersion = "23.1.7779620"; - - systemImageTypes = [ "default" ]; - - includeNDK = true; - includeEmulator = true; - includeSystemImages = true; - }; - - # Note: additional flags can be provided to emulator through - # the $NIX_ANDROID_EMULATOR_FLAGS env var. - android-emu = pkgs.androidenv.emulateApp { - name = "emulate-PlatformVerifier"; - platformVersion = platformVersion; - abiVersion = abi; - systemImageType = "default"; - - # Note: Depending on your hardware you may wish to enable or disable - # this option. - enableGPU = false; - }; - - android-sdk = android-comp.androidsdk; - android-sdk-root = "${android-sdk}/libexec/android-sdk"; - - verifierCargoToml = builtins.fromTOML - (builtins.readFile ./rustls-platform-verifier/Cargo.toml); - msrv = verifierCargoToml.package.rust-version; - - verifierPackage = features: - (pkgs.makeRustPlatform { - cargo = pkgs.rust-bin.stable.latest.minimal; - rustc = pkgs.rust-bin.stable.latest.minimal; - }).buildRustPackage { - inherit (verifierCargoToml.package) name version; - src = ./.; - buildAndTestSubdir = "rustls-platform-verifier"; - cargoLock.lockFile = ./Cargo.lock; - buildFeatures = features; - doCheck = false; # Some tests require networking - }; - - mkDevShell = rustc: - pkgs.mkShell { - ANDROID_HOME = "${android-sdk-root}"; - ANDROID_SDK_ROOT = "${android-sdk-root}"; - ANDROID_NDK_ROOT = "${android-sdk-root}/ndk-bundle"; - JAVA_HOME = "${pkgs.jdk11}"; - # Note: It's important to set this so that gradle uses the correct - # aapt2 binary. - GRADLE_OPTS = - "-Dorg.gradle.project.android.aapt2FromMavenOverride=${android-sdk-root}/build-tools/${buildToolsVersion}/aapt2"; - shellHook = '' - export RUST_SRC_PATH=${pkgs.rustPlatform.rustLibSrc} - echo 1>&2 "🔒🔍 rustls-platform-verifier" - ''; - nativeBuildInputs = devDeps ++ [ rustc ]; - }; - - in { - _module.args.pkgs = import inputs.nixpkgs { - inherit system; - overlays = [ (import inputs.rust-overlay) ]; - config = { - # Allow unfree packages and agree to the Android SDK terms of service. - # Review https://developer.android.com/studio/terms before use. - allowUnfree = true; - android_sdk.accept_license = true; - }; - }; - - # Base library. - packages.rustls-platform-verifier = (verifierPackage [ ]); - # Library with debug extras. - packages.rustls-platform-verifier-dbg = - (verifierPackage [ "dbg" "base64" "docsrs" ]); - # Test emulator. - packages.android-emu = android-emu; - packages.default = self'.packages.rustls-platform-verifier; - - devShells.nightly = (mkDevShell (pkgs.rust-bin.selectLatestNightlyWith - (toolchain: - toolchain.default.override { targets = rustTargets; }))); - devShells.stable = (mkDevShell - (pkgs.rust-bin.stable.latest.default.override { - targets = rustTargets; - })); - devShells.msrv = (mkDevShell - (pkgs.rust-bin.stable.${msrv}.default.override { - targets = rustTargets; - })); - devShells.default = self'.devShells.nightly; - }; - }; -}