init
This commit is contained in:
commit
b2e0936d4a
7 changed files with 982 additions and 0 deletions
44
flake.nix
Normal file
44
flake.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
inputs.systems.url = "github:nix-systems/default-linux";
|
||||
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
systems,
|
||||
}:
|
||||
let
|
||||
forAllSystems =
|
||||
function: nixpkgs.lib.genAttrs (import systems) (system: function nixpkgs.legacyPackages.${system});
|
||||
in
|
||||
{
|
||||
devShells = forAllSystems (pkgs: {
|
||||
default = pkgs.mkShell {
|
||||
RUSTFLAGS = "-C prefer-dynamic=yes";
|
||||
packages = builtins.attrValues {
|
||||
inherit (pkgs)
|
||||
rustc
|
||||
cargo
|
||||
rust-analyzer
|
||||
rustfmt
|
||||
clippy
|
||||
;
|
||||
};
|
||||
};
|
||||
});
|
||||
packages = forAllSystems (pkgs: {
|
||||
default =
|
||||
let
|
||||
project = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package;
|
||||
in
|
||||
pkgs.rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = project.name;
|
||||
version = project.version;
|
||||
src = ./.;
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
RUSTFLAGS = "-C prefer-dynamic=yes";
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue