Skip to content

Instantly share code, notes, and snippets.

@quinn-dougherty
Created May 26, 2024 15:53
Show Gist options
  • Select an option

  • Save quinn-dougherty/e8b78c147cbc7116b67c53b25602c1a1 to your computer and use it in GitHub Desktop.

Select an option

Save quinn-dougherty/e8b78c147cbc7116b67c53b25602c1a1 to your computer and use it in GitHub Desktop.
pvs flake
{
description = "A PVS derivation in nix";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
pvs = {
url = "github:SRI-CSL/PVS";
flake = false;
};
};
outputs = { self, nixpkgs, pvs }: let
system = "x86_64-linux"; # or "x86_64-darwin", "aarch64-linux", etc.
config.permittedInsecurePackages = [ ];
pkgs = import nixpkgs { inherit system config; };
buildInputs = with pkgs; [
sbcl
gcc
libgcc
gnumake
openssl
emacs
curl
git
coreutils-full
];
shellHook = ''
export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath([pkgs.openssl])}
# sudo ln -s $(which chmod) /bin/chmod
'';
in
{
devShells.${system}.default = pkgs.mkShell {
inherit buildInputs shellHook;
name = "pvs-dev";
};
packages.${system}.pvs = pkgs.stdenv.mkDerivation {
inherit buildInputs;
name = "pvs";
src = "${pvs}";
buildPhase = ''
${shellHook}
./configure
make
'';
installPhase = ''
mkdir -p $out
cp -r $src/bin $out
'';
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment