From fe4da406a265ca3f6ad27b08c76b049279d16abf Mon Sep 17 00:00:00 2001 From: Yan Mendes <53550620+kings177@users.noreply.github.com> Date: Sat, 9 Mar 2024 22:43:21 -0300 Subject: [PATCH] Update flake.nix --- flake.nix | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/flake.nix b/flake.nix index 94f76b14..da7758fb 100644 --- a/flake.nix +++ b/flake.nix @@ -1,37 +1,37 @@ { description = "A massively parallel functional runtime."; - + inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-utils.url = "github:numtide/flake-utils"; - rust-overlay.url = "github:oxalica/rust-overlay"; + nix-cargo-integration.url = "github:yusdacra/nix-cargo-integration"; + nix-filter.url = "github:numtide/nix-filter"; }; - outputs = { self, nixpkgs, flake-utils, rust-overlay }: + outputs = { self, nixpkgs, flake-utils, nix-cargo-integration, nix-filter }: flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; - overlays = [ rust-overlay.overlay ]; + overlays = [ nix-cargo-integration.overlay ]; }; - src = builtins.filterSource - (name: type: builtins.elem (baseNameOf name) [ + filteredSrc = nix-filter.lib.filterSource { + src = ./.; + filter = name: type: builtins.elem (baseNameOf name) [ "src" "Cargo.lock" "Cargo.toml" "rust-toolchain.toml" - ]) - ./.; - + ] || (type == "directory" && builtins.elem (baseNameOf name) [ + "src" + ]); + }; + in { - packages = { - hvm = pkgs.stdenv.mkDerivation { - pname = "hvm"; - version = "0.1.0"; - src = pkgs.lib.cleanSource src; - buildInputs = [ pkgs.openssl pkgs.pkg-config ]; - }; + defaultPackage = pkgs.nci.buildPackage { + name = "hvm"; + src = filteredSrc; + cargoToml = "Cargo.toml"; + buildInputs = with pkgs; [ openssl pkg-config ]; }; - - defaultPackage = self.packages.${system}.hvm; } ); }