Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 45 lines 1.1 kB view raw
1{ 2 lib, 3 rustPlatform, 4 fetchFromGitHub, 5 versionCheckHook, 6 nix-update-script, 7}: 8 9rustPlatform.buildRustPackage (finalAttrs: { 10 pname = "sus-compiler"; 11 version = "0.2.1"; 12 13 src = fetchFromGitHub { 14 owner = "pc2"; 15 repo = "sus-compiler"; 16 rev = "v${finalAttrs.version}"; 17 hash = "sha256-dQef5TiOV33lnNl7XKl7TlCY0E2sEclehWOmy2uvISY="; 18 fetchSubmodules = true; 19 }; 20 21 # no lockfile upstream 22 cargoLock.lockFile = ./Cargo.lock; 23 24 preBuild = '' 25 export HOME="$TMPDIR"; 26 ''; 27 28 postPatch = '' 29 ln -s ${./Cargo.lock} Cargo.lock 30 ''; 31 32 doInstallCheck = true; 33 nativeInstallCheckInputs = [ versionCheckHook ]; 34 versionCheckProgram = "${placeholder "out"}/bin/sus_compiler"; 35 36 updateScript = nix-update-script { extraArgs = [ "--generate-lockfile" ]; }; 37 38 meta = { 39 description = "New Hardware Design Language that keeps you in the driver's seat"; 40 homepage = "https://github.com/pc2/sus-compiler"; 41 license = lib.licenses.gpl3Only; 42 maintainers = with lib.maintainers; [ pbsds ]; 43 mainProgram = "sus_compiler"; 44 }; 45})