···
crane.url = "github:ipetkov/crane";
-
outputs = { self, nixpkgs, rust-overlay, crane }:
-
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
-
mkPkgs = system: import nixpkgs {
-
overlays = [ rust-overlay.overlays.default ];
-
packages = forAllSystems (system:
rustToolchain = pkgs.rust-bin.stable.latest.default;
···
src = craneLib.cleanCargoSource ./.;
-
buildInputs = with pkgs; [
-
] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
-
pkgs.darwin.apple_sdk.frameworks.Security
-
pkgs.darwin.apple_sdk.frameworks.SystemConfiguration
nativeBuildInputs = with pkgs; [
···
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
-
prism = craneLib.buildPackage (commonArgs // {
-
inherit cargoArtifacts;
-
devShells = forAllSystems (system:
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
-
extensions = [ "rust-src" "rust-analyzer" ];
-
buildInputs = with pkgs; [
-
] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
-
pkgs.darwin.apple_sdk.frameworks.Security
-
pkgs.darwin.apple_sdk.frameworks.SystemConfiguration
DATABASE_URL = "postgres://postgres:postgres@localhost:5432/prism";
···
echo "Database: $DATABASE_URL"
overlays.default = final: prev: {
prism = self.packages.${final.stdenv.hostPlatform.system}.prism;