diff --git a/flake.nix b/flake.nix index 8bc38bd..c372cd5 100644 --- a/flake.nix +++ b/flake.nix @@ -7,20 +7,23 @@ outputs = { self, nixpkgs, ... }@inputs: let system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages.${system}; - in - { - devShells.${system}.default = pkgs.mkShell - { + pkgs = nixpkgs.legacyPackages.${system}; + common = { + buildInputs = [ pkgs.openssl ]; + nativeBuildInputs = [ pkgs.pkg-config ]; + }; + in { + devShells.${system}.default = pkgs.mkShell ({ packages = with pkgs; [ rustc cargo ]; - buildInputs = with pkgs; [ - openssl - ]; - nativeBuildInputs = [ pkgs.pkg-config ]; - # env.RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rust}"; - }; + } // common); + + packages.${system}.default = pkgs.rustPlatform.buildRustPackage ({ + name = "icomidal"; + src = ./.; + cargoHash = "sha256-vaMAQmDT2ZCZTbI9Kp/5MOTbe1a1DFqTKlcQqvR4vxA="; + } // common); }; }