build with flake

This commit is contained in:
Max Känner 2024-10-10 13:59:43 +02:00
parent 90428a3cbe
commit ac99133302
2 changed files with 19 additions and 6 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
/target /target
.envrc .envrc
.direnv .direnv
/result

View File

@ -6,7 +6,6 @@
url = "github:oxalica/rust-overlay"; url = "github:oxalica/rust-overlay";
inputs = { inputs = {
nixpkgs.follows = "nixpkgs"; nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
}; };
}; };
}; };
@ -14,6 +13,9 @@
flake-utils.lib.eachDefaultSystem flake-utils.lib.eachDefaultSystem
(system: (system:
let let
pname = "vikunja-gatherer";
version = "0.1.0";
src = ./.;
overlays = [ (import rust-overlay) ]; overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system overlays; inherit system overlays;
@ -23,11 +25,21 @@
with pkgs; with pkgs;
{ {
devShells.default = mkShell { devShells.default = mkShell {
# 👇 we can just use `rustToolchain` here: nativeBuildInputs = [ rustToolchain pkg-config ];
buildInputs = [
rustToolchain buildInputs = [ openssl ];
openssl };
];
packages.default = rustPlatform.buildRustPackage {
inherit src pname version;
cargoLock = {
lockFile = ./Cargo.lock;
};
nativeBuildInputs = [ rustToolchain pkg-config ];
buildInputs = [ openssl ];
}; };
} }
); );