feat(rust): add rust to the templates
This commit is contained in:
parent
cd612f03ad
commit
9083ff41ab
8 changed files with 139 additions and 0 deletions
41
templates/rust/flake.nix
Normal file
41
templates/rust/flake.nix
Normal file
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
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;
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue