breeze/flake.nix

71 lines
1.7 KiB
Nix
Raw Normal View History

2024-06-16 17:09:06 -05:00
{
description = "breeze file server";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
crane.url = "github:ipetkov/crane";
flake-utils.url = "github:numtide/flake-utils";
};
2024-09-07 18:29:29 -05:00
outputs = {
self,
nixpkgs,
crane,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
2024-06-16 17:09:06 -05:00
2024-09-07 18:29:29 -05:00
craneLib = crane.mkLib pkgs;
2024-06-16 17:09:06 -05:00
2024-09-07 18:29:29 -05:00
# Common arguments can be set here to avoid repeating them later
# Note: changes here will rebuild all dependency crates
commonArgs = {
src = craneLib.cleanCargoSource ./.;
strictDeps = true;
2024-06-16 17:09:06 -05:00
2024-09-07 18:29:29 -05:00
buildInputs =
[
pkgs.openssl
]
++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
# Additional darwin specific inputs can be set here
pkgs.libiconv
];
};
2024-06-16 17:09:06 -05:00
2024-09-07 18:29:29 -05:00
breeze = craneLib.buildPackage (commonArgs
// {
2024-06-16 17:09:06 -05:00
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
2024-09-07 18:29:29 -05:00
# Additional environment variables or build phases/hooks can be set
# here *without* rebuilding all dependency crates
# MY_CUSTOM_VAR = "some value";
2024-06-16 17:09:06 -05:00
});
2024-09-07 18:29:29 -05:00
in {
checks = {
inherit breeze;
};
2024-06-16 17:09:06 -05:00
2024-09-07 18:29:29 -05:00
packages.default = breeze;
2024-06-16 17:09:06 -05:00
2024-09-07 18:29:29 -05:00
apps.default = flake-utils.lib.mkApp {
drv = breeze;
};
2024-06-16 17:09:06 -05:00
2024-09-07 18:29:29 -05:00
devShells.default = craneLib.devShell {
# Inherit inputs from checks.
checks = self.checks.${system};
2024-06-16 17:09:06 -05:00
2024-09-07 18:29:29 -05:00
# Additional dev-shell environment variables can be set directly
# MY_CUSTOM_DEVELOPMENT_VAR = "something else";
2024-06-16 17:09:06 -05:00
2024-09-07 18:29:29 -05:00
# Extra inputs can be added here; cargo and rustc are provided by default.
packages = [
pkgs.rewrk
];
};
});
2024-06-16 17:09:06 -05:00
}