flake-template-hell/templates/rust/flake.nix
2024-12-04 17:35:06 +00:00

45 lines
975 B
Nix

{
description = "Rust Developer Environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust.url = "github:oxalica/rust-overlay";
};
outputs = {
self,
nixpkgs,
rust,
}: let
systems = [
"x86_64-linux"
"aarch64-linux"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
in {
packages = forAllSystems (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [
(import rust)
];
};
inherit system;
in {
rust-app = pkgs.callPackage ./nix/package.nix {};
default = self.packages.${system}.rust-app;
});
devShells = forAllSystems (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [
(import rust)
];
};
inherit system;
in {
default = pkgs.callPackage ./nix/shell.nix {
inherit (self.packages.${system}) rust-app;
};
});
};
}