flake-template-hell/templates/rust/flake.nix

42 lines
932 B
Nix
Raw Normal View History

2024-08-14 23:44:43 +01:00
{
description = "Rust Developer Environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
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;
};
});
};
}