2022-06-07 14:53:23 +02:00
|
|
|
{
|
2022-07-21 00:28:28 +02:00
|
|
|
inputs = {
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
oxalica.url = "github:oxalica/rust-overlay";
|
|
|
|
naersk.url = "github:nix-community/naersk";
|
|
|
|
};
|
2022-06-07 14:53:23 +02:00
|
|
|
|
2022-07-21 00:28:28 +02:00
|
|
|
outputs = { self, nixpkgs, flake-utils, naersk, oxalica }:
|
|
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
|
|
let pkgs = import nixpkgs { inherit system; overlays = [ oxalica.overlay ]; };
|
|
|
|
naersk-lib = naersk.lib."${system}";
|
|
|
|
in rec {
|
|
|
|
# `nix build`
|
|
|
|
packages."hermit" = naersk-lib.buildPackage {
|
|
|
|
pname = "hermit";
|
|
|
|
root = ./.;
|
|
|
|
};
|
|
|
|
|
|
|
|
defaultPackage = packages."hermit";
|
2022-06-07 14:53:23 +02:00
|
|
|
|
2022-07-21 00:28:28 +02:00
|
|
|
# `nix run`
|
|
|
|
apps."hermit"= flake-utils.lib.mkApp {
|
|
|
|
drv = packages."hermit";
|
|
|
|
};
|
2022-06-07 14:53:23 +02:00
|
|
|
|
2022-07-21 00:28:28 +02:00
|
|
|
defaultApp = apps."hermit";
|
|
|
|
|
|
|
|
# `nix develop`
|
|
|
|
devShell = pkgs.mkShell {
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
|
|
(rust-bin.selectLatestNightlyWith (t: t.default))
|
|
|
|
openssl
|
|
|
|
pkgconfig
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
);
|
2022-06-07 14:53:23 +02:00
|
|
|
}
|